Commit a3bf428e by Motohisa Nakano

20121221-3

parent d00b065d
......@@ -64,7 +64,7 @@
"dspBkCancel":"Logout",
"txtSearchResult":"Result",
"dspHome":"Home",
"txtLoginUser":"(Ver.20121221-2)User:",
"txtLoginUser":"(Ver.20121221-3)User:",
"txtAll":"All",
"txtMkgSize":"Size",
"txtMkgS":"S",
......@@ -120,8 +120,8 @@
"txtMemoPaste":"Paste",
"txtMemoClear":"Clear",
"txtMemo":"Memo",
"msgBGMPlayConfirm":"EN:BGMが流れるようになっています。<br/>OKボタンをクリックしてください。",
"msgPWDNeedChange":"EN:パスワード変更が必要ですので、設定変更画面に戻って変更してください。",
"msgBGMPagePlayConfirm":"EN:BGMが流れるようになっています。<br/>OKボタンをクリックしてください。"
"msgBGMPlayConfirm":"Content BGM will be played automatically.",
"msgPWDNeedChange":"Change password is required. Please back Setting view.",
"msgBGMPagePlayConfirm":"Page BGM will be played automatically."
}
......@@ -64,7 +64,7 @@
"dspBkCancel":"バックアップせずにログアウト",
"txtSearchResult":"検索結果",
"dspHome":"ホーム",
"txtLoginUser":"(Ver.20121221-2)ログイン中:",
"txtLoginUser":"(Ver.20121221-3)ログイン中:",
"txtAll":"すべて",
"txtMkgSize":"太さ",
"txtMkgS":"小",
......@@ -120,7 +120,7 @@
"txtMemoPaste":"貼り付け",
"txtMemoClear":"クリア",
"txtMemo":"メモ",
"msgBGMPlayConfirm":"BGMが流れるようになっています。<br/>OKボタンをクリックしてください。",
"msgPWDNeedChange":"パスワード変更が必要ですので、設定変更画面に戻って変更してください。",
"msgBGMPagePlayConfirm":"BGMが流れるようになっています。<br/>OKボタンをクリックしてください。"
"msgBGMPlayConfirm":"コンテンツBGMが自動再生されます。",
"msgPWDNeedChange":"パスワードの変更が必要です。設定変更画面に戻って変更してください。",
"msgBGMPagePlayConfirm":"ページBGMが自動再生されます。"
}
......@@ -13,7 +13,7 @@
"txtOpt003":"마킹",
"dspOptReset":"설정 리셋",
"txtBkResCap":"서버 백업/복원",
"txtOptBkCfm":"로그아웃 시, 백업을 할지 항상 확인",
"txtOptBkCfm":"로그아웃할 때 백업을 할지 항상 확인",
"dspOptBk":"백업",
"dspOptRes":"복원",
"dspSave":"저장",
......@@ -41,7 +41,7 @@
"txtPwdRemind":"스킵을 선택하면 30일 이내에는 이 메세지를 표시하지 않습니다.",
"txtSearch":"검색",
"dspShiori":"북마크",
"dspSetting":"설정 변경",
"dspSetting":"환경설정",
"dspLogout":"로그아웃",
"txtRead":"열람",
"txtSort":"정렬",
......@@ -64,7 +64,7 @@
"dspBkCancel":"로그아웃",
"txtSearchResult":"검색 결과",
"dspHome":"홈",
"txtLoginUser":"(Ver.20121221-2)로그인 중:",
"txtLoginUser":"(Ver.20121221-3)로그인 중:",
"txtAll":"전체",
"txtMkgSize":"두께",
"txtMkgS":"소",
......@@ -113,14 +113,14 @@
"txtMemoCopy":"복사",
"msgPageImgErr":"컨텐츠를 표시할 수 없습니다. 이 컨텐츠는 삭제되었을 가능성이 있습니다.",
"sysAppTitle":"ABook : 멀티미디어 컨텐츠 플랫폼",
"sysLockScrPwdInput":"입력 암호",
"txtOpt005":"탭 브라우저 종료 · F5 때 경고가 표시",
"txtMemoMenu":"참고 편집",
"sysLockScrPwdInput":"패스워드를 입력해 주십시오.",
"txtOpt005":"새로고침을 하거나, 탭/창을 닫을 때 경고 표시",
"txtMemoMenu":"편집",
"txtMemoNew":"신규",
"txtMemoPaste":"붙여 넣기",
"txtMemoPaste":"붙여넣기",
"txtMemoClear":"클리어",
"txtMemo":"메모",
"msgBGMPlayConfirm":"KO:BGMが流れるようになっています。<br/>OKボタンをクリックしてください。",
"msgPWDNeedChange":"KO:パスワード変更が必要ですので、設定変更画面に戻って変更してください。",
"msgBGMPagePlayConfirm":"KO:BGMが流れるようになっています。<br/>OKボタンをクリックしてください。"
"msgBGMPlayConfirm":"이 컨텐츠는 BGM을 포함하고 있습니다. 재생을 시작합니다.",
"msgPWDNeedChange":"패스워드를 변경해야 합니다. 환경설정에서 패스워드를 변경해 주십시오.",
"msgBGMPagePlayConfirm":"이 페이지는 BGM을 포함하고 있습니다. 재생을 시작합니다."
}
This source diff could not be displayed because it is too large. You can view the blob instead.
/// しおりリスト画面 - SCRSLS0100
/// <reference path="../common/js/avweb.js" />
/// <reference path="../common/js/screenLock.js" />
/// <reference path="../common/js/common.js" />
/// <reference path="../common/js/i18n.js" />
/// <reference path="../common/js/jquery-1.8.1.min.js" />
/// <reference path="../common/js/jquery-ui-1.8.23.custom.min.js" />
/// <reference path="../common/js/jquery.toastmessage.js" />
/// <reference path="../common/js/pageViewer.js" />
/// <reference path="init.js" />
//var TotalThread = 0;
// Init function of page
$(document).ready(function () {
if (!avwCheckLogin(ScreenIds.Login)) return;
LockScreen();
document.title = i18nText('dspShiori') + ' | ' + i18nText('sysAppTitle');
// Set bookmark screen
ClientData.BookmarkScreen(ScreenIds.BookmarkList);
//Check if Force Change password
if(ClientData.requirePasswordChange() != 1){
// Synchronize bookmarks with server
SyncContent();
// Collection all detail of pages
bookmark_collectAllPages();
$("#dspDelete").click(dspDelete_Click);
$("#dspDelete1").click(dspDelete1_Click);
$("#dspCancel").click(dspCancel_Click);
$("#dspConfirmOK").click(dspConfirmOK_Click);
ClearGrid();
if (ClientData.BookMarkData().length == 0) {
// Show error
$("#msgShioriNotExists").show();
$("#dspDelete").hide();
$("#dspDelete1").hide();
}
else {
$("#msgShioriNotExists").hide();
$("#dspDelete").show();
$("#dspDelete1").show();
}
// Show book in local storage
//ShowBookmark();
$("a[name='dspRead']").unbind('click');
$("a[name='dspRead']").click(dspRead_Click);
HideSorting();
// Default sort is タイトル名, default is asc
ClientData.sortOpt_searchDivision(1);
ClientData.sortOpt_sortType(2);
dspTitleNm_Click();
}
else{
checkForceChangePassword();
}
});
/*
----------------------------------------------------------------------------
Event groups [start]
----------------------------------------------------------------------------
*/
function dspTitleNm_Click() {
var isAsc = false;
if (ClientData.sortOpt_searchDivision() == 1) { // Name
if (ClientData.sortOpt_sortType() == 1) { // ASC
isAsc = false;
ClientData.sortOpt_sortType(2);
}
else {
isAsc = true;
ClientData.sortOpt_sortType(1);
}
}
else {
ClientData.sortOpt_searchDivision(1);
ClientData.sortOpt_sortType(1); // default is asc
isAsc = true;
}
SortTitleName(isAsc);
$("#dspTitleNm").addClass("active_tops");
$("#dspTitleNmKn").removeClass("active_tops");
$("#dspPubDt").removeClass("active_tops");
};
function dspTitleNmKn_Click() {
var isAsc = false;
if (ClientData.sortOpt_searchDivision() == 2) { // Kana
if (ClientData.sortOpt_sortType() == 1) { // ASC
isAsc = false;
ClientData.sortOpt_sortType(2);
}
else {
isAsc = true;
ClientData.sortOpt_sortType(1);
}
}
else {
ClientData.sortOpt_searchDivision(2); // Kana
ClientData.sortOpt_sortType(1); // default is asc
isAsc = true;
}
SortTitleNameKana(isAsc);
$("#dspTitleNm").removeClass("active_tops");
$("#dspTitleNmKn").addClass("active_tops");
$("#dspPubDt").removeClass("active_tops");
};
function dspPubDt_Click() {
var isAsc = false;
if (ClientData.sortOpt_searchDivision() == 3) { // Publish date
if (ClientData.sortOpt_sortType() == 1) { // ASC
isAsc = false;
ClientData.sortOpt_sortType(2);
}
else {
isAsc = true;
ClientData.sortOpt_sortType(1);
}
}
else {
ClientData.sortOpt_searchDivision(3); // Kana
ClientData.sortOpt_sortType(1); // default is asc
isAsc = true;
}
SortPubDate(isAsc);
$("#dspTitleNm").removeClass("active_tops");
$("#dspTitleNmKn").removeClass("active_tops");
$("#dspPubDt").addClass("active_tops");
};
// Event of each button [読む]
function dspRead_Click() {
var jsondata = $(this).attr("value");
var data = JSON.parse(jsondata);
ClientData.contentInfo_contentId(data.contentid);
ClientData.bookmark_pageNo(data.pageNo);
ClientData.IsRefresh(false);
avwScreenMove(ScreenIds.ContentView);
};
// Cancel dialog of deleting
function dspCancel_Click() {
// Close dialog
//$('#dlgConfirm').dialog('close');
$("#delete_shiori").hide();
unlockLayout();
};
// Process deleting
function dspConfirmOK_Click() {
// --------------------------------
// Process deleting [start]
// --------------------------------
// Get selected bookmarks
var arrSelectedBookmarks = $("input[name='chkDelete']:checked");
$.each(arrSelectedBookmarks, function () {
// Delete selected items on layout
var contentid = JSON.parse(this.value).contentid;
var pageNo = JSON.parse(this.value).pageNo;
$(this).parent().parent().parent().remove();
// Remove from ClientData
var bm = ClientData.BookMarkData();
for (var nIndex = bm.length - 1; nIndex >= 0; nIndex--) {
if (bm[nIndex].contentid == contentid && bm[nIndex].pageNo == pageNo) {
bm.splice(nIndex, 1);
ClientData.isChangedBookmark(true);
}
}
ClientData.BookMarkData(bm);
if (ClientData.BookMarkData().length == 0) {
// Show error
$("#msgShioriNotExists").show();
$("#dspDelete").hide();
$("#dspDelete1").hide();
}
});
// --------------------------------
// Process deleting [ end ]
// --------------------------------
$("#delete_shiori").hide();
unlockLayout();
};
function dspDelete1_Click() {
dspDelete_Click();
};
function dspDelete_Click() {
if ($("input[name='chkDelete']:checked").length > 0) {
lockLayout();
$("#delete_shiori").show();
$("#delete_shiori").center();
}
};
// Show detail content
function ShowBookmark() {
if (avwHasError()) {
return;
}
else {
var hasMemo = false;
var hasMarking = false;
var contentid = "";
var pageNo = 0;
if (ClientData.BookMarkData().length > 0) {
$("#dspDelete").show();
$("#dspDelete1").show();
}
//TotalThread = ClientData.BookMarkData().length;
for (var nIndex = ClientData.BookMarkData().length - 1; nIndex >= 0; nIndex--) {
hasMarking = false;
hasMemo = false;
contentid = ClientData.BookMarkData()[nIndex].contentid;
pageNo = ClientData.BookMarkData()[nIndex].pageNo;
// Check if contentid has marking
for (var nIndex1 = 0; nIndex1 < ClientData.MarkingData().length; nIndex1++) {
if (ClientData.MarkingData()[nIndex1].contentid == contentid
&& ClientData.MarkingData()[nIndex1].pageNo == pageNo) {
hasMarking = true;
}
}
// Check if contentid has memo
for (var nIndex1 = 0; nIndex1 < ClientData.MemoData().length; nIndex1++) {
if (ClientData.MemoData()[nIndex1].contentid == contentid
&& ClientData.MemoData()[nIndex1].pageNo == pageNo) {
hasMemo = true;
}
}
var pageDetail;
var contentTitle = "";
var contentTitleKana = "";
// Search current page if collection that get details before
for (var nIndex2 = 0; nIndex2 < collection_contents.length; nIndex2++) {
if (collection_contents[nIndex2].contentid == contentid) {
contentTitle = collection_contents[nIndex2].contentTitle;
contentTitleKana = collection_contents[nIndex2].contentTitleKana;
// Search in pages
for (var nIndex3 = 0; nIndex3 < collection_contents[nIndex2].pages.length; nIndex3++) {
if (pageNo == collection_contents[nIndex2].pages[nIndex3].pageNo) {
pageDetail = collection_contents[nIndex2].pages[nIndex3];
break;
}
}
}
}
if (pageDetail) {
// If bookmark does not exist
if (pageDetail.existed == true) {
// Show normal
UpdateBookmark(contentid, pageDetail.pageNo, contentTitle, contentTitleKana);
insertRow(contentid, "data:image/jpeg;base64," + pageDetail.pageThumbnail, htmlEncode(contentTitle), pageDetail.pageText, pageDetail.pageNo, hasMemo, hasMarking, nIndex);
}
else {
// Not existed -> Show error
insertRowError(contentid, htmlEncode(contentTitle), pageDetail.pageNo);
}
}
}
$("a[name='dspRead']").unbind('click');
$("a[name='dspRead']").click(dspRead_Click);
}
};
// Hide all sorting symbol
function HideSorting() {
$("#txtTitleNmAsc").hide();
$("#txtTitleNmDesc").hide();
$("#txtTitleNmKnAsc").hide();
$("#txtTitleNmKnDesc").hide();
$("#txtPubDtAsc").hide();
$("#txtPubDtDesc").hide();
};
// Sort by title name
function SortTitleName(isAsc) {
HideSorting();
if (isAsc) {
$("#txtTitleNmAsc").show();
}
else {
$("#txtTitleNmDesc").show();
}
var arrSource = ClientData.BookMarkData();
var arrTarget = [];
var strTemp = "";
var nTempIndex = 0;
var isStop = false;
while (!isStop) {
if (arrSource.length > 0) {
strTemp = "";
// Lookup min item
for (var nIndex = 0; nIndex < arrSource.length; nIndex++) {
if (strTemp == "") {
strTemp = arrSource[nIndex].contentTitle;
nTempIndex = nIndex;
}
else {
// ASC
if (isAsc) {
if (arrSource[nIndex].contentTitle < strTemp) {
strTemp = arrSource[nIndex].contentTitle;
nTempIndex = nIndex;
}
}
else {
if (arrSource[nIndex].contentTitle > strTemp) {
strTemp = arrSource[nIndex].contentTitle;
nTempIndex = nIndex;
}
}
}
}
// Add to target array
arrTarget.push(arrSource[nTempIndex]);
// Remove min item from source array
arrSource.splice(nTempIndex, 1);
}
else {
isStop = true;
}
}
ClearGrid();
ClientData.BookMarkData(arrTarget);
ShowBookmark();
};
// Clear all rows of grid
function ClearGrid() {
var arrSelectedBookmarks = $("input[name='chkDelete']");
$.each(arrSelectedBookmarks, function () {
$(this).parent().parent().parent().remove();
});
//if (TotalThread == 0) {
//$('#grid tr').remove();
//}
// var arrSelectedBookmarks = $("input[name='chkDelete']");
};
// Sort by title name kana
function SortTitleNameKana(isAsc) {
HideSorting();
if (isAsc) {
$("#txtTitleNmKnAsc").show();
}
else {
$("#txtTitleNmKnDesc").show();
}
var arrSource = ClientData.BookMarkData();
var arrTarget = [];
var strTemp = "";
var nTempIndex = 0;
var isStop = false;
while (!isStop) {
if (arrSource.length > 0) {
strTemp = "";
// Lookup min item
for (var nIndex = 0; nIndex < arrSource.length; nIndex++) {
if (strTemp == "") {
strTemp = arrSource[nIndex].contentTitleKana;
nTempIndex = nIndex;
}
else {
// ASC
if (isAsc) {
if (arrSource[nIndex].contentTitleKana < strTemp) {
strTemp = arrSource[nIndex].contentTitleKana;
nTempIndex = nIndex;
}
}
else {
if (arrSource[nIndex].contentTitleKana > strTemp) {
strTemp = arrSource[nIndex].contentTitleKana;
nTempIndex = nIndex;
}
}
}
}
// Add to target array
arrTarget.push(arrSource[nTempIndex]);
// Remove min item from source array
arrSource.splice(nTempIndex, 1);
}
else {
isStop = true;
}
}
ClearGrid();
ClientData.BookMarkData(arrTarget);
ShowBookmark();
};
// Sort by publish date
function SortPubDate(isAsc) {
HideSorting();
if (isAsc) {
$("#txtPubDtAsc").show();
}
else {
$("#txtPubDtDesc").show();
}
var arrSource = ClientData.BookMarkData();
var arrTarget = [];
var dateTemp = undefined;
var nTempIndex = 0;
var isStop = false;
while (!isStop) {
if (arrSource.length > 0) {
dateTemp = undefined;
// Lookup min item
for (var nIndex = 0; nIndex < arrSource.length; nIndex++) {
if (dateTemp == undefined) {
dateTemp = arrSource[nIndex].registerDate;
nTempIndex = nIndex;
}
else {
// ASC
if (isAsc) {
if (arrSource[nIndex].registerDate < dateTemp) {
dateTemp = arrSource[nIndex].registerDate;
nTempIndex = nIndex;
}
}
else {
if (arrSource[nIndex].registerDate > dateTemp) {
dateTemp = arrSource[nIndex].registerDate;
nTempIndex = nIndex;
}
}
}
}
// Add to target array
arrTarget.push(arrSource[nTempIndex]);
// Remove min item from source array
arrSource.splice(nTempIndex, 1);
}
else {
isStop = true;
}
}
ClearGrid();
ClientData.BookMarkData(arrTarget);
ShowBookmark();
};
/*
Update information of specified bookmark
*/
function UpdateBookmark(contentid, pageNo, contentTitle, contentTitleKana) {
var arrBookmarks = ClientData.BookMarkData();
for (var nIndex = 0; nIndex < arrBookmarks.length; nIndex++) {
if (contentid == arrBookmarks[nIndex].contentid && pageNo == arrBookmarks[nIndex].pageNo) {
if (contentTitle != null && contentTitle != undefined) {
arrBookmarks[nIndex].contentTitle = contentTitle;
}
if (contentTitleKana != null && contentTitleKana != undefined) {
arrBookmarks[nIndex].contentTitleKana = contentTitleKana;
}
break;
}
}
// Set bookmark back to client data
ClientData.BookMarkData(arrBookmarks);
};
/*
Insert error row
*/
function insertRowError(contentid, pageTitle, pageNo) {
var newRow = "";
newRow += "<section>";
newRow += " <div class='cnt_section'>";
newRow += " <div class='check'>";
newRow += " <input type='checkbox' name='chkDelete' value='{\"contentid\":" + contentid + ", \"pageNo\":" + pageNo + "}'/>";
newRow += " </div>";
newRow += " <div class='text'>";
newRow += ' <label class="name" style="color: #2D83DA;">' + truncate(pageTitle, 20) + '</label>';
newRow += ' <div class="info">';
newRow += " <label class='lang name' lang='msgShioriDeleted'>" + i18nText('msgShioriDeleted') + "</label>";
newRow += " </div>";
newRow += " </div>";
newRow += "</section>";
$('#pnlTop').after(newRow);
};
// Insert row to grid
function insertRow(contentid, pageThumbnail, pageTitle, pageText, pageNo, hasMemo, hasMarking, index) {
var imgMarkingHide = '<img style="visibility:hidden" class="pen" alt="" src="./img/list/pic_2.png" />';
var imgMemoHide = '<img style="visibility:hidden" class="sticker" alt="" src="./img/list/pic_1.png" />';
var imgMarking = '<img class="pen" alt="" src="./img/list/pic_2.png" />';
var imgMemo = '<img class="sticker" alt="" src="./img/list/pic_1.png" />';
var newRow = "";
newRow += "<section>";
newRow += "<div class='cnt_section'>";
newRow += "<div class='check'>";
newRow += "<input type='checkbox' name='chkDelete' value='{\"contentid\":" + contentid + ", \"pageNo\":" + pageNo + ", \"index\": " + index+ "}'/>";
newRow += "</div>";
newRow += "<a class='img'>";
newRow += '<img id="pageImg' + contentid + '" src="' + pageThumbnail + '" width="160" height="120" style="display:none;">';
newRow += '<img id="loadingIcon' + contentid + "_" + pageNo + '" src="./img/data_loading.gif" height="25px" width="25px" style="padding: 46px; "/>';
newRow += "</a>";
newRow += "<div class='text'>";
newRow += '<label id="Label1" class="name" style="color: #2D83DA;">' + truncate(pageTitle, 20) + '</label>';
newRow += '<div class="info">';
newRow += '<ul class="date">';
newRow += '<li><label id="Label2" class="lang" lang="txtPage">' + i18nText('txtPage') + '</label><label id="Label3">' + pageNo + '</label></li>';
var contentText = htmlEncode(getLines(pageText, 3));
newRow += '<li><label id="Label1">' + truncate(contentText, 80) + '</label></li>';
newRow += "</ul>";
newRow += '<ul class="pic" style="align:right">';
newRow += "<li>";
//Resize Image
var imgTemp = new Image();
imgTemp.onload = function () {
if (imgTemp.width > imgTemp.height) {
$("img#pageImg" + contentid).attr('height', '');
$("img#pageImg" + contentid).removeAttr('height');
$("img#pageImg" + contentid).attr('width', '120');
var realHeight = (120 * imgTemp.height) / imgTemp.width;
$("img#pageImg" + contentid).css('padding-top', (120 - realHeight) / 2 + 'px');
}
else {
$("img#pageImg" + contentid).attr('width', '');
$("img#pageImg" + contentid).removeAttr('width');
$("img#pageImg" + contentid).attr('height', '120');
$("img#pageImg" + contentid).css('padding-top', '0px');
}
$("#loadingIcon" + contentid + "_" + pageNo).fadeOut('slow', function () {
$("img#pageImg" + contentid).fadeIn('slow');
});
};
imgTemp.src = pageThumbnail;
if (hasMemo) {
newRow += imgMemo;
}
else {
newRow += imgMemoHide;
}
newRow += "</li>";
newRow += "<li>";
if (hasMarking) {
newRow += imgMarking;
}
else {
newRow += imgMarkingHide;
}
newRow += "</li>";
newRow += "<li><a class='read lang' name='dspRead' value='{\"contentid\":\"" + contentid + "\", \"pageNo\":\"" + pageNo + "\"}' lang='txtRead'>" + i18nText('txtRead') + "</a></li>";
newRow += "</ul>";
newRow += "</div>";
newRow += "</div>";
newRow += "</div>";
newRow += "</section>";
$('#pnlTop').after(newRow);
};
/*
----------------------------------------------------------------------------
Event groups [ end ]
----------------------------------------------------------------------------
*/
/*
----------------------------------------------------------------------------
Setting dialog [start]
----------------------------------------------------------------------------
*/
$(function () {
$("#dspTitleNm").click(dspTitleNm_Click);
$("#dspTitleNmKn").click(dspTitleNmKn_Click);
$("#dspPubDt").click(dspPubDt_Click);
// Check JP language and show title kana
if (getCurrentLanguage() != Consts.ConstLanguage_Ja) {
$("#dspTitleNmKn").hide();
$("#dspTitleNmKn_Seperate").hide();
}
else {
$("#dspTitleNmKn").show();
$("#dspTitleNmKn_Seperate").show();
}
});
// Contains non-exist content
var bookmark_errorContent = [];
// Contain contents
var collection_contents = [];
/*
Get all detail pages of content in bookmark
*/
function bookmark_collectAllPages() {
var arrBookMarks = ClientData.BookMarkData();
for (var nIndex = 0; nIndex < collection_contents.length; nIndex++) {
var contentid = collection_contents[nIndex].contentid;
var pages = [];
// Collect all pages of current content
for (var nIndex1 = 0; nIndex1 < arrBookMarks.length; nIndex1++) {
// Found content
if (arrBookMarks[nIndex1].contentid == contentid) {
pages.push({ pageNo: arrBookMarks[nIndex1].pageNo, pageText: "", pageThumbnail: "", existed: false });
}
}
// Add collected pages to content
collection_contents[nIndex].pages = pages;
// Join pages to request to server
var strPageNos = buildPageNos(collection_contents[nIndex].pages);
// Call api to get all details of pages 1 time
avwCmsApiSync(ClientData.userInfo_accountPath(), "webContentPage", "GET",
{ contentId: contentid, sid: ClientData.userInfo_sid(), pageNos: strPageNos, thumbnailFlg: 1 },
function (data) {
collection_contents[nIndex].contentTitle = data.contentTitle;
collection_contents[nIndex].contentTitleKana = data.contentTitleKana;
for (var nIndex2 = 0; nIndex2 < collection_contents[nIndex].pages.length; nIndex2++) {
var comparePageNo = collection_contents[nIndex].pages[nIndex2].pageNo;
for (var nIndex3 = 0; nIndex3 < data.pages.length; nIndex3++) {
if (comparePageNo == data.pages[nIndex2].pageNo) {
// Set flag to determine page existed
collection_contents[nIndex].pages[nIndex2].existed = true;
// Store detail of page
collection_contents[nIndex].pages[nIndex2].pageText = data.pages[nIndex2].pageText;
collection_contents[nIndex].pages[nIndex2].pageThumbnail = data.pages[nIndex2].pageThumbnail;
}
}
}
},
null
);
}
};
/*
Build pageNos
*/
function buildPageNos(pages) {
var strResult = "";
for (var nIndex = 0; nIndex < pages.length; nIndex++) {
if (strResult == "") {
strResult = "" + pages[nIndex].pageNo;
}
else {
strResult += "," + pages[nIndex].pageNo;
}
}
return strResult;
};
/*
Check a content is error or not
*/
function IsErrorContent(strContentId) {
var isError = false;
for (var nIndex = 0; nIndex < bookmark_errorContent.length; nIndex++) {
if (strContentId == bookmark_errorContent[nIndex].contentid) {
isError = true;
break;
}
}
return isError;
};
/*
Check a content is checked + ok
*/
function IsOKCheckedContent(strContentId) {
var isOK = false;
for (var nIndex = 0; nIndex < collection_contents.length; nIndex++) {
if (strContentId == collection_contents[nIndex].contentid) {
isOK = true;
break;
}
}
return isOK;
};
// Add OK checked content
function AddContent(strContentId) {
var isFound = false;
for (var nIndex = 0; nIndex < collection_contents.length; nIndex++) {
if (collection_contents[nIndex].contentid == strContentId) {
isFound = true;
break;
}
}
// Add to bufer if it does not exist
if(!isFound) {
collection_contents.push({ contentid: strContentId, contentTitle: "", contentTitleKana: "", pages: [] });
}
};
/*
event of changing language
*/
function changeLanguageCallBackFunction() {
if (getCurrentLanguage() != Consts.ConstLanguage_Ja) {
$("#dspTitleNmKn").hide();
$("#dspTitleNmKn_Seperate").hide();
$("#txtTitleNmKnAsc").hide();
$("#txtTitleNmKnDesc").hide();
}
else {
$("#dspTitleNmKn").show();
$("#dspTitleNmKn_Seperate").show();
if (ClientData.sortOpt_searchDivision() == 2) { // Kana
if (ClientData.sortOpt_sortType() == 1) { // ASC
$("#txtTitleNmKnAsc").show();
}
else {
$("#txtTitleNmKnDesc").show();
}
}
}
document.title = i18nText('dspShiori') + ' | ' + i18nText('sysAppTitle');
};
/*
Synchronize bookmark with server
. Check existence of content
-> Delete absence content in local
. Check existence of pages
-> Delete absence pages in local
*/
function SyncContent() {
// Reset error contents
bookmark_errorContent = [];
// Reset ok checked content
collection_contents = [];
// Get bookmarks from local storage
var arrBookmarks = ClientData.BookMarkData();
for (var nIndex = arrBookmarks.length - 1; nIndex >= 0; nIndex--) {
var oneBookMark = arrBookmarks[nIndex];
// ==================================
// Check existence of content [start]
// ==================================
if (IsErrorContent(oneBookMark.contentid) == false) {
// If content is ok + checked
if (IsOKCheckedContent(oneBookMark.contentid) == false) {
if (!IsExistContent(oneBookMark.contentid)) {
if (avwHasError()) {
// System error excepting 404
showSystemError();
return;
}
else {
// Add to list of error content
bookmark_errorContent.push({ contentid: oneBookMark.contentid });
// Remove bookmark
arrBookmarks.splice(nIndex, 1);
ClientData.isChangedBookmark(true);
}
}
// ==================================
// Check existence of content [ end ]
// ==================================
else {
// Add nromal content
AddContent(oneBookMark.contentid);
}
}
}
else {
arrBookmarks.splice(nIndex, 1);
ClientData.isChangedBookmark(true);
}
}
// Set back to storage
ClientData.BookMarkData(arrBookmarks);
};
/*
Check content whether existed or not
*/
function IsExistContent(strContentId) {
var isExisted = false;
var params = {
sid: ClientData.userInfo_sid(),
getType: '1',
contentId: strContentId
};
avwCmsApiSync(ClientData.userInfo_accountPath(), "webGetContent", 'GET', params,
function (data) {
isExisted = true;
},
function (xmlHttpRequest, txtStatus, errorThrown) {
if (xmlHttpRequest.status == 404) {
isExisted = false;
}
else {
// Show system error
isExisted = true; // Mark this flag to prevent bookmarks from deleting
showSystemError();
}
});
return isExisted;
};
/*
----------------------------------------------------------------------------
Setting dialog [ end ]
----------------------------------------------------------------------------
*/
function truncate(strInput, length){
if (strInput.length <= length)
{
return strInput;
}
else
{
return strInput.substring(0, length) + "...";
}
};
/// <reference path="../common/js/avweb.js" />
/// <reference path="../common/js/screenLock.js" />
/// <reference path="../common/js/common.js" />
/// <reference path="../common/js/i18n.js" />
/// <reference path="../common/js/jquery-1.8.1.min.js" />
/// <reference path="../common/js/jquery-ui-1.8.23.custom.min.js" />
/// <reference path="../common/js/jquery.toastmessage.js" />
/// <reference path="../common/js/pageViewer.js" />
/// <reference path="header.js" />
//Start Declare Variables
//----Constant-----------//
var DEFAULT_DISP_NUMBER_RECORD_FROM = 1;
var DEFAULT_DISP_NUMBER_RECORD_TO = 15;
var DEFAULT_SORT_TYPE = '1';
var DEFAULT_SORT_ORDER = '1';
var DEFAULT_SEARCH_DIVISION = 0;
var DEFAULT_IMG_OPTION_MEMO = 'img/list/pic_1.png';
var DEFAULT_IMG_OPTION_MARKING = 'img/list/pic_2.png';
var DEFAULT_IMG_CONTENT_EDIT = 'img/list/updatebook.png';
var DEFAULT_IMG_CONTENT_NEW = 'img/list/newbook.png';
var iNumberOfNextRecord = 15;
var arrayTemp = [];
var contentIdArray = [];
var resourceVersionArr = [];
var metaVersionArr = [];
var totalPage;
var chkSearchTextEmpty = false;
var noRecordFlg = false;
var home_isMove = false;
$(document).ready(function(){
if (!avwCheckLogin(ScreenIds.Login)){
return;
}
LockScreen();
document.title = i18nText('txtSearchResult') + ' | ' + i18nText('sysAppTitle');
// Set bookmark screen ClientData.BookmarkScreen(ScreenIds.ContentSearch);
//Check if Force Change password
if(ClientData.requirePasswordChange() != 1){
//Format text display more record
formatDisplayMoreRecord();
//remove hover effect when is touch device
removeHoverCss();
//InitScreen
initialScreen();
//Render Grid
renderGridView();
//Go To Details Page
$('canvas').live('click', canvasClickFunction);
//$('canvas').live('touchstart', canvasClickFunction);
$('canvas').live('touchend', canvasClickFunction);
$('canvas').live('touchmove', function () { home_isMove = true; });
//Open dialog
$('.dialog').live('click', titleClickFunction);
//$('.dialog').live('touchstart', titleClickFunction);
$('.dialog').live('touchend', titleClickFunction);
$('.dialog').live('touchmove', function () { home_isMove = true; });
//Show Next Record
$('a#control-nextrecord').click(showNextRecordFunction);
//Sort Title
$('#control-sort-title').click(sortByTitleFunction);
//Sort by title kana
$('#control-sort-titlekana').click(sortByTitleKanaFunction);
//sort by release date
$('#control-sort-releasedate').click(sortByReleaseDateFunction);
//Go To Details Page
$('.button-details').live('click', readSubmenuFunction);
//$('.button-details').live('touchstart', readSubmenuFunction);
$('.button-details').live('touchend', readSubmenuFunction);
$('.button-details').live('touchmove', function () { home_isMove = true; });
$('#main-search').click(searchEventButtonFunction);
$('#txtSearch').keydown(mainSearchKeyDownFunction);
$('#main-search-content').click(mainSearchContentClickFunction);
$('#main-search-tag').click(mainSearchTagClickFunction);
$('#main-search-body').click(mainSearchBodyClickFunction);
$('#control-nextrecord').css('visibility', 'hidden');
$(window).resize(function () {
if ($("#contentDetail").css("display") != "none") {
// Refresh panel of detail to center.
$("#contentDetail").center();
if ($("#contentDetail").height() > $(window).height()){
$("#contentDetail").css('top', '0');
}
}
});
}else{
//Check if Force Change password
checkForceChangePassword();
}
});
function mainSearchBodyClickFunction(){
$('#main-body').attr('checked','checked');
$('#main-tag').removeAttr('checked');
$('#main-content').removeAttr('checked');
};
function mainSearchTagClickFunction(){
$('#main-tag').attr('checked','checked');
$('#main-body').removeAttr('checked');
$('#main-content').removeAttr('checked');
};
function mainSearchContentClickFunction(){
$('#main-content').attr('checked','checked');
$('#main-tag').removeAttr('checked');
$('#main-body').removeAttr('checked');
};
function mainSearchKeyDownFunction(e){
var code = (e.keyCode ? e.keyCode : e.which);
if(code == 13) { //Enter keycode
$('#main-search').click();
}
};
//Call API
function abapi(name, param, method, callback){
avwCmsApi(ClientData.userInfo_accountPath(), name, method, param, callback, null);
};
//Initial screen
function initialScreen(){
var searchText = ClientData.searchCond_searchText();
var searchDivision = ClientData.searchCond_searchDivision();
$('#txtSearch').val(searchText);
//ClientData.searchCond_searchText('');
if(searchDivision == 1){
$('#main-tag').attr('checked',false);
$('#main-body').attr('checked',false);
$('#main-content').attr('checked','checked');
}
else if(searchDivision == 2){
$('#main-content').attr('checked',false);
$('#main-body').attr('checked',false);
$('#main-tag').attr('checked','checked');
}
else
{
$('#main-content').attr('checked',false);
$('#main-tag').attr('checked',false);
$('#main-body').attr('checked','checked');
}
handleLanguage();
};
///Render Content
function renderContent(id, text, division, type, order, from, to, cateid, grpid){
var params = {
sid: id,
searchText: text,
searchDivision: division,
sortType: type,
sortOrder: order,
recordFrom: from,
recordTo: to,
genreId: cateid,
groupId: grpid
};
abapi('webContentList', params, 'POST', function (data) {
$.each(data.contentList, function (i, post) {
var outputDate = formatDeliveryDate(post.contentDeliveryDate);
$('#content-grid').append(
'<section>'
+' <div class="cnt_section">'
+' <a class="img">'
+' <canvas height="105px" width="150px" id="content-thumbnail'+post.contentId+'" contentid="'+post.contentId+'" style="display:none;">'
+ ' </canvas>'
+ ' <img id="loadingIcon' + post.contentId + '" src="./img/data_loading.gif" height="25px" width="25px" style="padding-top: 46px; padding-left: 66px"/>'
+ ' </a>'
+' <div class="text">'
+' <a id="title'+post.contentId+'" class="dialog name" contentid="'+post.contentId+'">'+ truncate(htmlEncode(post.contentTitle), 25)+'</a>'
+' <div class="info">'
+' <ul class="date">'
+' <li><span class="lang" lang="txtPubDt"> </span> : '+outputDate+'</li>'
+' <li><span class="lang" lang="txtViewDt"> </span>:<span id="lblVdate'+post.contentId+'"> </span></li>'
+' </ul>'
+' <ul class="pic">'
+' <li><img src="'+DEFAULT_IMG_OPTION_MEMO+'" id="imgMemo'+post.contentId+'" class="sticker" /></li>'
+' <li><img src="'+DEFAULT_IMG_OPTION_MARKING+'" id="imgBookMark'+post.contentId+'" class="pen" /></li>'
+' <li><a class="read lang button-details" contentid="' + post.contentId + '" lang="txtRead">読む</a></li>'
+' </ul>'
+' </div>'
+' </div>'
+' </div>'
+'</section>'
);
//assign thumbnail to array
arrayTemp.push({ contentId: post.contentId, thumbnail: formatStringBase64(post.contentThumbnail) });
//Check if user has read this content or not.
checkUserHasReadContent(post.contentId, post.resourceVersion, post.metaVersion);
//assign version to array
resourceVersionArr.push({ contentid: post.contentId, resourceversion: post.resourceVersion });
//assign meta version to array
metaVersionArr.push({ contentid: post.contentId, metaversion: post.metaVersion });
//Check if content has marking or memo
checkContentMarkingMemoOption(post.contentId);
//renderViewDate
var viewdate = renderViewDate(post.contentId);
if (viewdate != null || viewdate != 'undefined') {
$('#lblVdate' + post.contentId).html(viewdate);
}
});
//Get Next record number for list
getNextRecordNumForList();
if(data.totalRecord < data.recordTo){
ClientData.searchCond_recordTo(data.totalRecord);
}else{
ClientData.searchCond_recordTo(data.recordTo);
}
ClientData.searchCond_recordFrom(data.recordFrom);
totalPage = data.totalRecord;
//Render Page number
if(totalPage == 0){
reRenderPageNumber(totalPage, totalPage);
}
else{
reRenderPageNumber(ClientData.searchCond_recordTo(), totalPage);
}
//Toggle scroll to top Control
handleBackToTop();
//changeLanguage(ClientData.userInfo_language());
i18nReplaceText();
});
};
//Handle Back To Top Button
function handleBackToTop(){
if(ClientData.searchCond_recordTo() >= totalPage){
$('#control-nextrecord').css('visibility','hidden');
}
else{
$('#control-nextrecord').css('visibility','visible');
}
if(totalPage == 0){
$('#control-nextrecord').css('visibility','hidden');
displayResultNoRecord();
noRecordFlg = true;
}
else {
$('#msgSearchNotExist').hide();
$('#content-grid').removeClass('lang');
$('#content-grid').removeAttr('lang');
enableSort();
noRecordFlg = false;
}
};
//Handle language
function handleLanguage(){
//if(ClientData.userInfo_language() == Consts.ConstLanguage_En || ClientData.userInfo_language() == Consts.ConstLanguage_Ko)
if (getCurrentLanguage() == Consts.ConstLanguage_En || getCurrentLanguage() == Consts.ConstLanguage_Ko)
{
$('#control-sort-titlekana').css('display','none');
$('#label-sort-titlekana').css('display','none');
$('#separate').css('display','none');
$("#titlekana-sorttype").html('');
}
else {
if (ClientData.searchCond_sortOrder() != null && ClientData.searchCond_sortOrder() != 'undefined' || ClientData.searchCond_sortType() != '') {
var typeSort = ClientData.searchCond_sortType();
var orderSort = ClientData.searchCond_sortOrder();
if (typeSort == 2) {
if (orderSort == Consts.ConstOrderSetting_Asc) {
$('#titlekana-sorttype').html('');
$('#titlekana-sorttype').html('▲');
$('#titlekana-sorttype').css('width', '12px');
}
else {
$('#titlekana-sorttype').html('');
$('#titlekana-sorttype').html('▼');
$('#titlekana-sorttype').css('width', '12px');
}
}
}
if(noRecordFlg){
$('#label-sort-titlekana').css('display','block');
$('#separate').css('display','block');
}else{
$('#control-sort-titlekana').css('display','block');
$('#separate').css('display','block');
}
}
};
//Initial Screen
function renderGridView(){
var fromPage = DEFAULT_DISP_NUMBER_RECORD_FROM;
var toPage = returnNumberDispRecordForList();
var sortType = DEFAULT_SORT_TYPE;
var sortOrder = DEFAULT_SORT_ORDER;
var searchText = ClientData.searchCond_searchText();
var searchDivision = ClientData.searchCond_searchDivision();
var sid = ClientData.userInfo_sid();
ClientData.searchCond_recordFrom(fromPage);
ClientData.searchCond_recordTo(toPage);
ClientData.searchCond_sortType(sortType);
ClientData.searchCond_sortOrder(sortOrder);
ClientData.searchCond_searchDivision(searchDivision);
ClientData.searchCond_genreId('');
ClientData.searchCond_groupId('');
var genreId = ClientData.searchCond_genreId();
var groupId = ClientData.searchCond_groupId();
//Handle display sort
handleSortDisp();
//Language Handle
handleLanguage();
//Refresh GridView
refreshGrid();
if(searchText == '' || searchText == null){
displayResultNoRecord();
chkSearchTextEmpty = true;
noRecordFlg = true;
reRenderPageNumber(0, 0);
}
else {
$('#msgSearchNotExist').hide();
chkSearchTextEmpty = false;
//Render Gridview
renderContent(sid, searchText, searchDivision, sortType, sortOrder, fromPage, toPage, genreId, groupId);
$('#control-nextrecord').css('visibility','visible');
}
};
//Canvas Click function
function canvasClickFunction(e){
if (e) {
e.preventDefault();
}
if (home_isMove == true) {
home_isMove = false;
return;
}
var contentId = $(this).attr('id');
var outputId = contentId.substring(17);
var checkflag = false;
// Set content id for screen: content detail
ClientData.contentInfo_contentId(outputId);
// Get image of selected image
var base64String = returnThumbnail(outputId);
ClientData.contentInfo_contentThumbnail(base64String);
//Store Content id that user has read
if(ClientData.ReadingContentIds().length > 0){
contentIdArray = ClientData.ReadingContentIds();
for(var nIndex = 0; nIndex < contentIdArray.length; nIndex++){
if(contentIdArray[nIndex].contentid == outputId){
checkflag = true;
break;
}
else{
checkflag = false;
}
}
if(!checkflag){
contentIdArray.push({contentid: outputId, viewdate: '', originviewdate: ''});
}
}
else{
contentIdArray.push({contentid: outputId, viewdate: '', originviewdate: ''});
}
//Renew ReadingContentID
var newArray = [];
ClientData.ReadingContentIds(newArray);
//Set data for readingcontentid
ClientData.ReadingContentIds(contentIdArray);
//Set ResouceVersion for content
setResourceVersionData(outputId);
//Set MetaVersion for content
setMetaVersionData(outputId);
//Close Submenu
$('#dlgSubMenu').hide();
//Delete 'new' icon
drawEditImage(outputId);
//Open content Detail
openContentDetail();
};
//Re-render page from and total record
function reRenderPageNumber(dispRecord, dispTotal){
$('#dispPage').html(dispRecord);
$('#totalPage').html(dispTotal);
$('.pageNumControl').css('visibility','visible');
};
//Show Next Record Function
function showNextRecordFunction(){
var fromPage = ClientData.searchCond_recordFrom();
var toPage = ClientData.searchCond_recordTo();
var sortType = ClientData.searchCond_sortType();
var sortOrder = ClientData.searchCond_sortOrder();
var searchText = ClientData.searchCond_searchText();
var searchDivision = ClientData.searchCond_searchDivision();
var genreId = ClientData.searchCond_genreId();
var groupId = ClientData.searchCond_groupId();
var sid = ClientData.userInfo_sid();
var totalrecord = totalPage;
if(fromPage == null || fromPage == 'undefined'){
fromPage = DEFAULT_DISP_NUMBER_RECORD_FROM;
}
if(toPage == null || toPage == 'undefined'){
toPage = returnNumberDispRecordForList();
}
fromPage = eval(toPage) + 1;
var iRecordNumber = eval(totalrecord) - eval(fromPage);
if(iRecordNumber < iNumberOfNextRecord)
{
toPage = eval(fromPage) + eval(iRecordNumber);
}
else
{
toPage = eval(fromPage) + (eval(iNumberOfNextRecord) - 1);
}
ClientData.searchCond_recordFrom(fromPage);
ClientData.searchCond_recordTo(toPage);
if(fromPage <= totalrecord)
{
renderContent(sid, searchText, searchDivision, sortType, sortOrder, fromPage, toPage, genreId, groupId);
}
};
//Sort By Title Function
function sortByTitleFunction(){
$(this).addClass('active_tops');
$('#control-sort-titlekana').removeClass('active_tops');
$('#control-sort-releasedate').removeClass('active_tops');
var sortOrder = ClientData.searchCond_sortOrder();
var sortType = ClientData.searchCond_sortType();
var sid = ClientData.userInfo_sid();
var recordFrom = DEFAULT_DISP_NUMBER_RECORD_FROM;
var recordTo = ClientData.searchCond_recordTo();
var genreId = ClientData.searchCond_genreId();
var groupId = ClientData.searchCond_groupId();
if(sortOrder == Consts.ConstOrderSetting_Asc)
{
if(sortType == '1'){
sortOrder = Consts.ConstOrderSetting_Desc;
$('#title-sorttype').html('');
$('#title-sorttype').html('▼');
$('#title-sorttype').css('width', '12px');
$('#titlekana-sorttype').html('');
$('#rDate-sorttype').html('');
}
else{
sortOrder = Consts.ConstOrderSetting_Asc;
$('#title-sorttype').html('');
$('#title-sorttype').html('▲');
$('#title-sorttype').css('width', '12px');
$('#titlekana-sorttype').html('');
$('#rDate-sorttype').html('');
}
ClientData.searchCond_sortOrder(sortOrder);
}
else
{
sortOrder = Consts.ConstOrderSetting_Asc;
$('#title-sorttype').html('');
$('#title-sorttype').html('▲');
$('#title-sorttype').css('width', '12px');
$('#titlekana-sorttype').html('');
$('#rDate-sorttype').html('');
ClientData.searchCond_sortOrder(sortOrder);
}
if(recordFrom == null || recordFrom == 'undefined'){
recordFrom = DEFAULT_DISP_NUMBER_RECORD_FROM;
ClientData.searchCond_recordFrom(recordFrom);
}
if(recordTo == null || recordTo == 'undefined'){
recordTo = returnNumberDispRecordForList();
ClientData.searchCond_recordFrom(recordTo);
}
sortType = '1';
ClientData.searchCond_sortType(sortType);
//refresh Gridview
refreshGrid();
//refresh add more record
$('#control-nextrecord').css('visibility','hidden');
renderContent(sid, ClientData.searchCond_searchText(), ClientData.searchCond_searchDivision(), sortType, sortOrder, recordFrom, recordTo, genreId, groupId);
};
//Sort By Title Kana function
function sortByTitleKanaFunction(){
$(this).addClass('active_tops');
$('#control-sort-title').removeClass('active_tops');
$('#control-sort-releasedate').removeClass('active_tops');
var sortOrder = ClientData.searchCond_sortOrder();
var sortType = ClientData.searchCond_sortType();
var sid = ClientData.userInfo_sid();
var recordFrom = DEFAULT_DISP_NUMBER_RECORD_FROM;
var recordTo = ClientData.searchCond_recordTo();
var genreId = ClientData.searchCond_genreId();
var groupId = ClientData.searchCond_groupId();
if(sortOrder == Consts.ConstOrderSetting_Asc)
{
if(sortType == '2'){
sortOrder = Consts.ConstOrderSetting_Desc;
$('#title-sorttype').html('');
$('#titlekana-sorttype').html('');
$('#titlekana-sorttype').html('▼');
$('#titlekana-sorttype').css('width', '12px');
$('#rDate-sorttype').html('');
}
else{
sortOrder = Consts.ConstOrderSetting_Asc;
$('#title-sorttype').html('');
$('#titlekana-sorttype').html('');
$('#titlekana-sorttype').html('▲');
$('#titlekana-sorttype').css('width', '12px');
$('#rDate-sorttype').html('');
}
ClientData.searchCond_sortOrder(sortOrder);
}
else
{
sortOrder = Consts.ConstOrderSetting_Asc;
$('#title-sorttype').html('');
$('#titlekana-sorttype').html('');
$('#titlekana-sorttype').html('▲');
$('#titlekana-sorttype').css('width', '12px');
$('#rDate-sorttype').html('');
ClientData.searchCond_sortOrder(sortOrder);
}
if(recordFrom == null || recordFrom == 'undefined'){
recordFrom = DEFAULT_DISP_NUMBER_RECORD_FROM;
ClientData.searchCond_recordFrom(recordFrom);
}
if(recordTo == null || recordTo == 'undefined'){
recordTo = returnNumberDispRecordForList();
ClientData.searchCond_recordFrom(recordTo);
}
sortType = '2';
//refresh gridview
refreshGrid();
//refresh add more record
$('#control-nextrecord').css('visibility','hidden');
ClientData.searchCond_sortType(sortType);
renderContent(sid, ClientData.searchCond_searchText(), ClientData.searchCond_searchDivision(), sortType, sortOrder, recordFrom, recordTo, genreId, groupId);
};
//Sort By Release Date
function sortByReleaseDateFunction(){
$(this).addClass('active_tops');
$('#control-sort-title').removeClass('active_tops');
$('#control-sort-titlekana').removeClass('active_tops');
var sortOrder = ClientData.searchCond_sortOrder();
var sortType = ClientData.searchCond_sortType();
var sid = ClientData.userInfo_sid();
var recordFrom = DEFAULT_DISP_NUMBER_RECORD_FROM;
var recordTo = ClientData.searchCond_recordTo();
var genreId = ClientData.searchCond_genreId();
var groupId = ClientData.searchCond_groupId();
if(sortOrder == Consts.ConstOrderSetting_Asc)
{
if(sortType == '3'){
sortOrder = Consts.ConstOrderSetting_Desc;
$('#title-sorttype').html('');
$('#titlekana-sorttype').html('');
$('#rDate-sorttype').html('');
$('#rDate-sorttype').html('▼');
$('#rDate-sorttype').css('width', '12px');
}
else{
sortOrder = Consts.ConstOrderSetting_Asc;
$('#title-sorttype').html('');
$('#titlekana-sorttype').html('');
$('#rDate-sorttype').html('');
$('#rDate-sorttype').html('▲');
$('#rDate-sorttype').css('width', '12px');
}
ClientData.searchCond_sortOrder(sortOrder);
}
else
{
sortOrder = Consts.ConstOrderSetting_Asc;
$('#title-sorttype').html('');
$('#titlekana-sorttype').html('');
$('#rDate-sorttype').html('');
$('#rDate-sorttype').html('▲');
$('#rDate-sorttype').css('width', '12px');
ClientData.searchCond_sortOrder(sortOrder);
}
if(recordFrom == null || recordFrom == 'undefined'){
recordFrom = DEFAULT_DISP_NUMBER_RECORD_FROM;
ClientData.searchCond_recordFrom(recordFrom);
}
if(recordTo == null || recordTo == 'undefined'){
recordTo = returnNumberDispRecordForList();
ClientData.searchCond_recordFrom(recordTo);
}
sortType = '3';
//refresh gridview
refreshGrid();
//refresh add more record
$('#control-nextrecord').css('visibility','hidden');
ClientData.searchCond_sortType(sortType);
renderContent(sid, ClientData.searchCond_searchText(), ClientData.searchCond_searchDivision(), sortType, sortOrder, recordFrom, recordTo, genreId, groupId);
};
//Get Thumnail base on contentid
function returnThumbnail(contentid){
for(var i = 0; i < arrayTemp.length; i++){
if(arrayTemp[i].contentId == contentid){
return arrayTemp[i].thumbnail;
}
}
};
//Dialog Read Button CLick
function readSubmenuFunction(e){
if (e) {
e.preventDefault();
}
if (home_isMove == true) {
home_isMove = false;
return;
}
var contentId = $(this).attr('contentid');
var contentThumbnail = returnThumbnail(contentId);
var date = new Date();
var month = date.getMonth()+1;
var day = date.getDate();
var outputDate = formatNormalDate(day, month, date.getFullYear());
ClientData.contentInfo_contentId(contentId);
ClientData.contentInfo_contentThumbnail(contentThumbnail);
var checkflag = false;
//Store Content id that user has read
if(ClientData.ReadingContentIds().length > 0){
contentIdArray = ClientData.ReadingContentIds();
for(var nIndex = 0; nIndex < contentIdArray.length; nIndex++){
if(contentIdArray[nIndex].contentid == contentId){
checkflag = true;
if(contentIdArray[nIndex].viewdate == null || contentIdArray[nIndex].viewdate == 'undefined' || contentIdArray[nIndex].viewdate == ''){
contentIdArray[nIndex].viewdate = outputDate;
contentIdArray[nIndex].originviewdate = date;
}
break;
}
else{
checkflag = false;
}
}
if(!checkflag){
contentIdArray.push({contentid: contentId, viewdate: outputDate, originviewdate: date});
}
}
else{
contentIdArray.push({contentid: contentId, viewdate: outputDate, originviewdate: date});
}
//Renew ReadingContentID
var newArray = [];
ClientData.ReadingContentIds(newArray);
//Set ResouceVersion for content
setResourceVersionData(contentId);
//Set MetaVersion for content
setMetaVersionData(contentId);
//Set data for readingcontentid
ClientData.ReadingContentIds(contentIdArray);
ClientData.IsRefresh(false);
avwScreenMove(ScreenIds.ContentView);
};
//Check if Content Has marking or memo
function checkContentMarkingMemoOption(contentId){
//Check if contentid has marking
if(ClientData.MarkingData().length == 0){
$('#imgBookMark'+contentId).css('visibility','hidden');
}
else{
for (var nIndex1 = 0; nIndex1 < ClientData.MarkingData().length; nIndex1++) {
if (ClientData.MarkingData()[nIndex1].contentid == contentId) {
$('#imgBookMark'+contentId).css('visibility','visible');
break;
}
else{
$('#imgBookMark'+contentId).css('visibility','hidden');
}
}
}
if(ClientData.MemoData().length == 0){
$('#imgMemo'+contentId).css('visibility','hidden');
}
else{
// Check if contentid has memo
for (var nIndex1 = 0; nIndex1 < ClientData.MemoData().length; nIndex1++) {
if (ClientData.MemoData()[nIndex1].contentid == contentId) {
$('#imgMemo'+contentId).css('visibility','visible');
break;
}
else
{
$('#imgMemo'+contentId).css('visibility','hidden');
}
}
}
};
//Check if User has read content
function checkUserHasReadContent(contId, resourceVer, metaVer){
var imgThumb = new Image();
//imgThumb.src = returnThumbnail(contId);
var imgIconNew = new Image();
//imgIconNew.src = DEFAULT_IMG_CONTENT_NEW;
var imgIconEdit = new Image();
//imgIconEdit.src = DEFAULT_IMG_CONTENT_EDIT;
var c = document.getElementById('content-thumbnail'+contId);
var ctx = c.getContext('2d');
var readFlg = false;
var versionArr = ClientData.ResourceVersion();
var metaArr = ClientData.MetaVersion();
var readArr = ClientData.ReadingContentIds();
if(readArr == null || readArr <= 0 || readArr == 'undefined'){
imgThumb.onload = function(){
var resizeImg = resizeResourceThumbnail(imgThumb, c.width, c.height);
ctx.drawImage(imgThumb, c.width/2 - resizeImg[0]/2, 0, resizeImg[0], resizeImg[1]);
imgIconNew.onload = function(){
ctx.drawImage(imgIconNew, c.width / 2 - resizeImg[0] / 2, 0);
$("#loadingIcon" + contId).fadeOut('slow', function () {
$('#content-thumbnail' + contId).fadeIn('slow');
});
};
imgIconNew.src = DEFAULT_IMG_CONTENT_NEW;
};
imgThumb.src = returnThumbnail(contId);
}
else{
//Check if user has read this content or not
for (var nIndex1 = 0; nIndex1 < ClientData.ReadingContentIds().length; nIndex1++) {
if(ClientData.ReadingContentIds()[nIndex1].contentid == contId){
imgThumb.onload = function(){
var resizeImg = resizeResourceThumbnail(imgThumb, c.width, c.height);
ctx.drawImage(imgThumb, c.width / 2 - resizeImg[0] / 2, 0, resizeImg[0], resizeImg[1]);
$("#loadingIcon" + contId).fadeOut('slow', function () {
$('#content-thumbnail' + contId).fadeIn('slow');
});
};
imgThumb.src = returnThumbnail(contId);
readFlg = true;
break;
}
else{
imgThumb.onload = function(){
var resizeImg = resizeResourceThumbnail(imgThumb, c.width, c.height);
ctx.drawImage(imgThumb, c.width/2 - resizeImg[0]/2, 0, resizeImg[0], resizeImg[1]);
imgIconNew.onload = function(){
ctx.drawImage(imgIconNew, c.width / 2 - resizeImg[0] / 2, 0);
$("#loadingIcon" + contId).fadeOut('slow', function () {
$('#content-thumbnail' + contId).fadeIn('slow');
});
};
imgIconNew.src = DEFAULT_IMG_CONTENT_NEW;
};
imgThumb.src = returnThumbnail(contId);
}
}
}
//Check if resource version has change
if(readFlg){
if(versionArr == null || versionArr <= 0 || versionArr == 'undefined'){
}
else{
for(var nIndex2 = 0; nIndex2 < versionArr.length; nIndex2++){
if(versionArr[nIndex2].contentid == contId){
if(versionArr[nIndex2].resourceversion != resourceVer){
imgThumb.onload = function(){
var resizeImg = resizeResourceThumbnail(imgThumb, c.width, c.height);
ctx.drawImage(imgThumb, c.width/2 - resizeImg[0]/2, 0, resizeImg[0], resizeImg[1]);
imgIconEdit.onload = function(){
ctx.drawImage(imgIconEdit, c.width / 2 - resizeImg[0] / 2, 0);
$("#loadingIcon" + contId).fadeOut('slow', function () {
$('#content-thumbnail' + contId).fadeIn('slow');
});
};
imgIconEdit.src = DEFAULT_IMG_CONTENT_EDIT;
};
imgThumb.src = returnThumbnail(contId);
break;
}
}
}
}
if(metaArr == null || metaArr <= 0 || metaArr == 'undefined'){
}
else{
for(var nIndex2 = 0; nIndex2 < metaArr.length; nIndex2++){
if(metaArr[nIndex2].contentid == contId){
if(metaArr[nIndex2].metaversion != metaVer){
imgThumb.onload = function(){
var resizeImg = resizeResourceThumbnail(imgThumb, c.width, c.height);
ctx.drawImage(imgThumb, c.width/2 - resizeImg[0]/2, 0, resizeImg[0], resizeImg[1]);
imgIconEdit.onload = function(){
ctx.drawImage(imgIconEdit, c.width / 2 - resizeImg[0] / 2, 0);
$("#loadingIcon" + contId).fadeOut('slow', function () {
$('#content-thumbnail' + contId).fadeIn('slow');
});
};
imgIconEdit.src = DEFAULT_IMG_CONTENT_EDIT;
};
imgThumb.src = returnThumbnail(contId);
break;
}
}
}
}
readFlg = false;
}
};
//draw Edit Image
function drawEditImage(id){
var img = new Image();
img.src = returnThumbnail(id);
var c = document.getElementById('content-thumbnail'+id);
//use getContext to use the canvas for drawing
var ctx = c.getContext('2d');
img.onload = function(){
var resizeImg = resizeResourceThumbnail(img, c.width, c.height);
ctx.drawImage(img, c.width / 2 - resizeImg[0] / 2, 0, resizeImg[0], resizeImg[1]);
$("#loadingIcon" + id).fadeOut('slow', function () {
$('#content-thumbnail' + id).fadeIn('slow');
});
};
};
//Search Function
function searchEventButtonFunction(){
var fromPage = DEFAULT_DISP_NUMBER_RECORD_FROM;
var toPage = returnNumberDispRecordForList();
var sortType = DEFAULT_SORT_TYPE;
var sortOrder = DEFAULT_SORT_ORDER;
var searchText = $('#txtSearch').val();
var searchDivision;
var content = $('#main-content').attr('checked');
var tag = $('#main-tag').attr('checked');
var body = $('#main-body').attr('checked');
if(content == 'checked')
{
searchDivision = $('#searchbox-content').val();
}
if(tag == 'checked')
{
searchDivision = $('#searchbox-tag').val();
}
if(body == 'checked')
{
searchDivision = $('#searchbox-body').val();
}
var genreId = ClientData.searchCond_genreId();
var groupId = ClientData.searchCond_groupId();
var sid = ClientData.userInfo_sid();
ClientData.searchCond_sortOrder(sortOrder);
ClientData.searchCond_sortType(sortType);
ClientData.searchCond_searchText(searchText);
ClientData.searchCond_searchDivision(searchDivision);
//refresh grid
refreshGrid();
//Handle display sort
handleSortDisp();
if(searchText == '' || searchText == null){
displayResultNoRecord();
chkSearchTextEmpty = true;
noRecordFlg = true;
reRenderPageNumber(0, 0);
}
else {
$('#msgSearchNotExist').hide();
$('#control-nextrecord').css('visibility','hidden');
//Render Gridview
chkSearchTextEmpty = false;
renderContent(sid, searchText, searchDivision, sortType, sortOrder, fromPage, toPage, genreId, groupId);
//$('#control-nextrecord').css('visibility','visible');
}
};
//Render User view date
function renderViewDate(id){
for(var i = 0; i < ClientData.ReadingContentIds().length; i++){
if(ClientData.ReadingContentIds()[i].contentid == id){
return ClientData.ReadingContentIds()[i].viewdate;
}
}
};
//set resource version data
function setResourceVersionData(conId){
var tempResourceArr;
var tempResource;
//check if insert new or edit
var flag = false;
if(ClientData.ResourceVersion().length <= 0 || ClientData.ResourceVersion() == null || ClientData.ResourceVersion() == 'undefined'){
tempResourceArr = [];
}
else{
tempResourceArr = ClientData.ResourceVersion();
}
for(var i = 0; i < resourceVersionArr.length; i++){
if(resourceVersionArr[i].contentid == conId){
tempResource = resourceVersionArr[i].resourceversion;
break;
}
}
if(tempResourceArr.length > 0){
for(var j = 0; j < tempResourceArr.length; j++){
if(tempResourceArr[j].contentid == conId){
tempResourceArr[j].resourceversion = tempResource;
flag = true;
break;
}
else{
flag = false;
}
}
if(!flag){
tempResourceArr.push({contentid: conId, resourceversion: tempResource});
}
}else{
tempResourceArr.push({contentid: conId, resourceversion: tempResource});
}
ClientData.ResourceVersion(tempResourceArr);
};
//set meta Version Data
function setMetaVersionData(conId){
var tempMetaArr;
var tempMeta;
//check if insert new or edit
var flag = false;
if(ClientData.MetaVersion().length <= 0 || ClientData.MetaVersion() == null || ClientData.MetaVersion() == 'undefined'){
tempMetaArr = [];
}
else{
tempMetaArr = ClientData.MetaVersion();
}
for(var i = 0; i < metaVersionArr.length; i++){
if(metaVersionArr[i].contentid == conId){
tempMeta = metaVersionArr[i].metaversion;
break;
}
}
if(tempMetaArr.length > 0){
for(var j = 0; j < tempMetaArr.length; j++){
if(tempMetaArr[j].contentid == conId){
tempMetaArr[j].metaversion = tempMeta;
flag = true;
break;
}
else{
flag = false;
}
}
if(!flag){
tempMetaArr.push({contentid: conId, metaversion: tempMeta});
}
}else{
tempMetaArr.push({contentid: conId, metaversion: tempMeta});
}
ClientData.MetaVersion(tempMetaArr);
};
//handle display sort direction
function handleSortDisp(){
$('#control-sort-title').removeClass('active_tops');
$('#control-sort-titlekana').removeClass('active_tops');
$('#control-sort-releasedate').removeClass('active_tops');
var typeSort;
var orderSort;
if(ClientData.searchCond_sortType() == null || ClientData.searchCond_sortType() == 'undefined' || ClientData.searchCond_sortType() == ''){
$('#title-sorttype').html('');
$('#title-sorttype').html('');
$('#titlekana-sorttype').html('');
$('#rDate-sorttype').html('');
}
else{
if(ClientData.searchCond_sortOrder() != null && ClientData.searchCond_sortOrder() != 'undefined' || ClientData.searchCond_sortType() != ''){
typeSort = ClientData.searchCond_sortType();
orderSort = ClientData.searchCond_sortOrder();
if(typeSort == 1){
if(orderSort == Consts.ConstOrderSetting_Asc){
$('#title-sorttype').html('');
$('#title-sorttype').html('▲');
$('#title-sorttype').css('width', '12px');
$('#titlekana-sorttype').html('');
$('#rDate-sorttype').html('');
}
else{
$('#title-sorttype').html('');
$('#title-sorttype').html('▼');
$('#title-sorttype').css('width', '12px');
$('#titlekana-sorttype').html('');
$('#rDate-sorttype').html('');
}
$('#control-sort-title').addClass('active_tops');
}
else if(typeSort == 2){
if(orderSort == Consts.ConstOrderSetting_Asc){
$('#title-sorttype').html('');
$('#titlekana-sorttype').html('');
$('#titlekana-sorttype').html('▲');
$('#titlekana-sorttype').css('width', '12px');
$('#rDate-sorttype').html('');
}
else{
$('#title-sorttype').html('');
$('#titlekana-sorttype').html('');
$('#titlekana-sorttype').html('▼');
$('#titlekana-sorttype').css('width', '12px');
$('#rDate-sorttype').html('');
}
$('#control-sort-titlekana').addClass('active_tops');
}
else if(typeSort == 3){
if(orderSort == Consts.ConstOrderSetting_Asc){
$('#title-sorttype').html('');
$('#titlekana-sorttype').html('');
$('#rDate-sorttype').html('');
$('#rDate-sorttype').html('▲');
$('#rDate-sorttype').css('width', '12px');
}
else{
$('#title-sorttype').html('');
$('#titlekana-sorttype').html('');
$('#rDate-sorttype').html('');
$('#rDate-sorttype').html('▼');
$('#rDate-sorttype').css('width', '12px');
}
$('#control-sort-releasedate').addClass('active_tops');
}
}
}
};
//convert delivery Date
function formatDeliveryDate(date){
var day = date.date;
var month = eval(date.month) + 1;
var year = eval(date.year) + 1900;
var outputDate = year + '/' + ((''+month).length<2 ? '0' : '') + month + '/' + ((''+day).length<2 ? '0' : '') + day;
return outputDate;
};
//convert view Date
function formatNormalDate(day, month, year){
var outputDate = year + '/' + ((''+month).length<2 ? '0' : '') + month + '/' + ((''+day).length<2 ? '0' : '') + day;
return outputDate;
};
//format Image string
function formatStringBase64(imgStr){
var outputString = 'data:image/jpeg;base64,'+imgStr;
return outputString;
};
//function Open SubMenu Dialog
function titleClickFunction(e){
if (e) {
e.preventDefault();
}
if (home_isMove == true) {
home_isMove = false;
return;
}
var checkflag = false;
var contentid = $(this).attr('contentid');
// Get image of selected image
var base64String = returnThumbnail(contentid);
ClientData.contentInfo_contentThumbnail(base64String);
ClientData.contentInfo_contentId(contentid);
//Store Content id that user has read
if(ClientData.ReadingContentIds().length > 0){
contentIdArray = ClientData.ReadingContentIds();
for(var nIndex = 0; nIndex < contentIdArray.length; nIndex++){
if(contentIdArray[nIndex].contentid == contentid){
checkflag = true;
break;
}
else{
checkflag = false;
}
}
if(!checkflag){
contentIdArray.push({contentid: contentid, viewdate: '', originviewdate: ''});
}
}
else{
contentIdArray.push({contentid: contentid, viewdate: '', originviewdate: ''});
}
//Renew ReadingContentID
var newArray = [];
ClientData.ReadingContentIds(newArray);
//Set data for readingcontentid
ClientData.ReadingContentIds(contentIdArray);
//Set ResouceVersion for content
setResourceVersionData(contentid);
//Set MetaVersion for content
setMetaVersionData(contentid);
//Close Submenu
$('#dlgSubMenu').hide();
//Delete 'new' icon
drawEditImage(contentid);
//Open content Detail
openContentDetail();
};
//Get Number Disp Record For List
function returnNumberDispRecordForList() {
var toPage = 0;
var sysSettings = avwSysSetting();
toPage = sysSettings.bookListCount;
return toPage;
};
//Get number record disp next for list
function getNextRecordNumForList(){
iNumberOfNextRecord = returnNumberDispRecordForList();
};
//refresh sort order
function refreshSortTypeOrder(){
$('#title-sorttype').html('');
$('#titlekana-sorttype').html('');
$('#rDate-sorttype').html('');
$('#rDate-sorttype').html('');
};
//refresh GridView
function refreshGrid(){
$('#control-nextrecord').css('visibility','hidden');
$('#content-grid').html('');
$('.pageNumControl').css('visibility','hidden');
};
//format text display more record
function formatDisplayMoreRecord(){
i18nReplaceText();
//changeLanguage(ClientData.userInfo_language());
$('#control-nextrecord').html(format(i18nText('dspViewMore'), returnNumberDispRecordForList()));
};
function changeLanguageCallBackFunction(){
handleLanguage();
formatDisplayMoreRecord();
if(chkSearchTextEmpty){
displayResultNoRecord();
} else {
$('#control-nextrecord').css('visibility','visible');
enableSort();
}
document.title = i18nText('txtSearchResult') + ' | ' + i18nText('sysAppTitle');
};
function displayResultNoRecord(){
i18nReplaceText();
//$('#content-grid').html(i18nText('msgSearchNotExist'));
//$('#content-grid').css({ 'text-align': 'left', 'margin-top': '20px', 'clear': 'both' });
$('#content-grid').html('');
$('#msgSearchNotExist').show();
$('#msgSearchNotExist').css({ 'text-align': 'left', 'margin-top': '20px', 'clear': 'both' });
$('#control-nextrecord').css('visibility','hidden');
$('.control_sort_on').hide();
$('.control_sort_off').show();
if(getCurrentLanguage() == Consts.ConstLanguage_En || getCurrentLanguage() == Consts.ConstLanguage_Ko){
$('#label-sort-titlekana').hide();
$('#separate').hide();
}
};
function enableSort(){
$('.control_sort_on').show();
$('.control_sort_off').hide();
if(getCurrentLanguage() == Consts.ConstLanguage_En || getCurrentLanguage() == Consts.ConstLanguage_Ko){
$('#control-sort-titlekana').hide();
$('#separate').hide();
}
};
function truncate(strInput, length){
if (strInput.length <= length)
{
return strInput;
}
else
{
return strInput.substring(0, length) + "...";
}
};
function resizeResourceThumbnail(mg, width, height) {
var newWidth;
var newHeight;
if(mg.width > mg.height) {
newWidth = width;
newHeight = (mg.height * width)/mg.width;
}
else {
newHeight = height;
newWidth = (mg.width * height)/mg.height;
}
var result = [newWidth, newHeight];
return result;
};
function removeHoverCss(){
if(isTouchDevice()){
$('#control-sort-title').removeClass('nottouchdevice');
$('#control-sort-titlekana').removeClass('nottouchdevice');
$('#control-sort-releasedate').removeClass('nottouchdevice');
}
};
\ No newline at end of file
This source diff could not be displayed because it is too large. You can view the blob instead.
/// コンテンツ閲覧画面_消しゴム書式オーバーレイ
/// <reference path="../common/js/avweb.js" />
/// <reference path="../common/js/screenLock.js" />
/// <reference path="../common/js/common.js" />
/// <reference path="../common/js/i18n.js" />
/// <reference path="../common/js/jquery-1.8.1.min.js" />
/// <reference path="../common/js/jquery-ui-1.8.23.custom.min.js" />
/// <reference path="../common/js/jquery.toastmessage.js" />
/// <reference path="../common/js/pageViewer.js" />
/// ===============================================================================================
/// Eraser group [start]
/// ===============================================================================================
// Show eraser
function ShowEraser(targetDiv) {
//$('#dlgGomu').dialog("open");
//$(".ui-dialog-titlebar").hide();
//lockLayout();
// $('#dlgGomu').fadeIn('medium', function(){
// $('#dlgGomu').draggable();
// });
$('#dlgGomu').show();
$('#dlgGomu').draggable();
Eraser_SetDefaultValue();
$('#dlgGomu').center();
};
// Set default value for easer.
function Eraser_SetDefaultValue() {
var typeValue = undefined;
typeValue = ClientData.erase_size();
if (typeValue == 5) {
$("#dlgGomu_rdo1").attr('checked', 'checked');
$("#dlgGomu_rdo1").focus();
}
else if (typeValue == 12.5) {
$("#dlgGomu_rdo2").attr('checked', 'checked');
$("#dlgGomu_rdo2").focus();
}
else if (typeValue == 25) {
$("#dlgGomu_rdo3").attr('checked', 'checked');
$("#dlgGomu_rdo3").focus();
}
else if (typeValue == 50) {
$("#dlgGomu_rdo4").attr('checked', 'checked');
$("#dlgGomu_rdo4").focus();
}
else {
typeValue = 5;
$("#dlgGomu_rdo1").attr('checked', 'checked');
$("#dlgGomu_rdo1").focus();
}
dlgGomu_chooseType(typeValue);
};
// Choose type of eraser, and draw to canvas
function dlgGomu_chooseType(typeValue) {
var canvas = document.getElementById('dlgGomu_cvMain');
if (canvas.getContext) {
// use getContext to use the canvas for drawing
var ctx = canvas.getContext('2d');
// Draw shapes
ctx.fillStyle = "#888888";
ctx.fillRect(0, 0, canvas.width, canvas.height);
ctx.beginPath();
//ctx.arc(60, 60, typeValue, 0, Math.PI * 2, true); // Outer circle
ctx.arc(canvas.width/2, canvas.height/2, typeValue, 0, 2 * Math.PI, true);
ctx.fillStyle = "#ffffff";
ctx.fill();
ctx.stroke();
}
};
function dlgGomu_rdo1_click() {
dlgGomu_chooseType(5);
};
function dlgGomu_rdo2_click() {
dlgGomu_chooseType(12.5);
};
function dlgGomu_rdo3_click() {
dlgGomu_chooseType(25);
};
function dlgGomu_rdo4_click() {
dlgGomu_chooseType(50);
};
// Event of button OK
function dlgGomu_dspOK_click() {
// Set selected value to local storage
var typeValue = undefined;
if ($("#dlgGomu_rdo1").attr('checked') == 'checked') {
typeValue = 5;
}
else if ($("#dlgGomu_rdo2").attr('checked') == 'checked') {
typeValue = 12.5;
}
else if ($("#dlgGomu_rdo3").attr('checked') == 'checked') {
typeValue = 25;
}
else if ($("#dlgGomu_rdo4").attr('checked') == 'checked') {
typeValue = 50;
}
// Set value to local
ClientData.erase_size(typeValue);
eraseSize = typeValue;
// Close dialog
//$("#dlgGomu").dialog('close');
/*$("#dlgGomu").fadeOut('medium', function(){
//unlockLayout();
});*/
$("#dlgGomu").hide();
/*enable button */
enableButtonMarking();
ClientData.IsAddingMarking(true);
isAddingMarking = ClientData.IsAddingMarking();
/* unlock dialog overlay */
$("#overlay").hide();
$('#dlgMarking_imgEraserOption').removeClass();
$('#dlgMarking_imgEraserOption').addClass('eraser_option_hover');
};
// Event of button cancel
function dlgGomu_dspCancel_click() {
// Close dialog
//$("#dlgGomu").dialog('close');
/*$("#dlgGomu").fadeOut('medium', function(){
//unlockLayout();
});*/
$("#dlgGomu").hide();
/*enable button */
enableButtonMarking();
ClientData.IsAddingMarking(true);
isAddingMarking = ClientData.IsAddingMarking();
/* unlock dialog overlay */
$("#overlay").hide();
$('#dlgMarking_imgEraserOption').removeClass();
$('#dlgMarking_imgEraserOption').addClass('eraser_option_hover');
};
function dlgGomu_rdo1_text_click(){
$('#dlgGomu_rdo1').attr('checked','checked');
$('#dlgGomu_rdo2').removeAttr('checked');
$('#dlgGomu_rdo3').removeAttr('checked');
$('#dlgGomu_rdo4').removeAttr('checked');
dlgGomu_rdo1_click();
};
function dlgGomu_rdo2_text_click(){
$('#dlgGomu_rdo1').removeAttr('checked');
$('#dlgGomu_rdo2').attr('checked','checked');
$('#dlgGomu_rdo3').removeAttr('checked');
$('#dlgGomu_rdo4').removeAttr('checked');
dlgGomu_rdo2_click();
};
function dlgGomu_rdo3_text_click(){
$('#dlgGomu_rdo1').removeAttr('checked');
$('#dlgGomu_rdo2').removeAttr('checked');
$('#dlgGomu_rdo3').attr('checked','checked');
$('#dlgGomu_rdo4').removeAttr('checked');
dlgGomu_rdo3_click();
};
function dlgGomu_rdo4_text_click(){
$('#dlgGomu_rdo1').removeAttr('checked');
$('#dlgGomu_rdo2').removeAttr('checked');
$('#dlgGomu_rdo3').removeAttr('checked');
$('#dlgGomu_rdo4').attr('checked','checked');
dlgGomu_rdo4_click();
};
/*
----------------------------------------------------------------------------
Event groups [start]
----------------------------------------------------------------------------
*/
/*
----------------------------------------------------------------------------
Event groups [ end ]
----------------------------------------------------------------------------
*/
function touchStart_BtnOk_Gomu(e){
e.preventDefault();
$('#dlgGomu').draggable("destroy");
dlgGomu_dspOK_click();
};
function touchStart_BtnCancel_Gomu(e){
e.preventDefault();
$('#dlgGomu').draggable("destroy");
dlgGomu_dspCancel_click();
};
// Setting dialog
$(function () {
// ---------------------------------
// Setup for easer [start]
// ---------------------------------
if(isTouchDevice() == true){
document.getElementById('dlgGomu_dspOK').addEventListener('touchstart',touchStart_BtnOk_Gomu,false);
document.getElementById('dlgGomu_dspCancel').addEventListener('touchstart',touchStart_BtnCancel_Gomu,false);
}
$("#dlgGomu_dspOK").click(dlgGomu_dspOK_click);
$("#dlgGomu_dspCancel").click(dlgGomu_dspCancel_click);
// Event for radio
$("#dlgGomu_rdo1").click(dlgGomu_rdo1_click);
$("#dlgGomu_rdo2").click(dlgGomu_rdo2_click);
$("#dlgGomu_rdo3").click(dlgGomu_rdo3_click);
$("#dlgGomu_rdo4").click(dlgGomu_rdo4_click);
// $("#dlgGomu_rdo1_text").click(dlgGomu_rdo1_text_click);
// $("#dlgGomu_rdo2_text").click(dlgGomu_rdo2_text_click);
// $("#dlgGomu_rdo3_text").click(dlgGomu_rdo3_text_click);
// $("#dlgGomu_rdo4_text").click(dlgGomu_rdo4_text_click);
//$('#dlgGomu_rdo1_text').click()
// ---------------------------------
// Setup for easer [ end ]
// ---------------------------------
/*$('#dlgGomu').dialog({
autoOpen: false,
title: i18nText('txtDltOpt'),
modal: true,
resizable: false,
width: 450,
height: 300
});*/
});
/// ===============================================================================================
/// Eraser group [ end ]
/// ===============================================================================================
\ No newline at end of file
/// ===============================================================================================
/// Maker group [start]
/// ===============================================================================================
var Maker_colorSource = [];
Maker_colorSource.push('ffffff', 'ffccc9', 'ffce93',
'fffc9e','ffffc7','9aff99','96fffb','cdffff',
'cbcefb','cfcfcf','fd6864','fe996b','fffe65',
'fcff2f','67fd9a','38fff8','68fdff','9698ed',
'c0c0c0','fe0000','f8a102','ffcc67','f8ff00',
'34ff34','68cbd0','34cdf9','6665cd','9b9b9b',
'cb0000','f56b00','ffcb2f','ffc702','32cb00',
'00d2cb','3166ff','6434fc','656565','9a0000',
'ce6301','cd9934','999903','009901','329a9d',
'3531ff','6200c9','343434','680100','963400',
'986536','646809','036400','34696d','00009b',
'303498','000000','330001','643403','663234',
'343300','013300','003532','010066','340096');
var maker_Size;
var maker_color;
var maker_targetDiv;
var maker_chooseColor;
function ShowMaker(targetId){
maker_targetDiv = targetId;
maker_targetDiv.html('');
targetId.append(
'<div id="panel-maker" class="rayermenu1">'
+' <div id="panel-maker-size">'
+' <span lang="txtMkgSize" class="lang" >太いさ</span>'
+ ' <input type="radio" id="maker-size-small" name="maker-size" /><label for="maker-size-small" id="marker-small-text" class="lang" lang="txtMkgS">S</label>'
+ ' <input type="radio" id="maker-size-medium" name="maker-size" /><label for="maker-size-medium" id="marker-medium-text" class="lang" lang="txtMkgM">M</label>'
+ ' <input type="radio" id="maker-size-large" name="maker-size" /><label for="maker-size-large" id="marker-large-text" class="lang" lang="txtMkgB">L</label>'
+ ' <input type="radio" id="maker-size-oversize" name="maker-size" /><label for="maker-size-oversize" id="marker-oversize-text" class="lang" lang="txtMkgSB">XL</label>'
+' </div>'
+' <span class="lang" lang="txtColor" style="float:left;margin-right: 10px;">Color</span>'
+' <div id="makerColorPreview"></div>'
+' <div id="makerColorwrapper"></div>'
+' <div class="canvasArea_s" style="width: 120px; height: 120px">'
+' <canvas id="Maker_cvPreviewmaker" class="preview" width="120px" height="120px"></canvas>'
+' </div>'
+' <div style="clear:both; padding-top:10px">'
+' <a id="Maker_btnCancel" class="lang cancelbtn" style="float:right;" lang="dspCancel">Cancel</a>'
+' <a id="Maker_btnOk" class="lang cancelbtn" style="float:right; clear: none; margin-right:10px" lang="dspOK">OK</a>'
+' </div>'
+'<div>'
);
var colorWrapper = $('#makerColorwrapper');
$.each(Maker_colorSource, function (i, maker_color) {
colorWrapper.append('<div class="colorpicker" colorId="' + maker_color + '" style="background-color: #' + maker_color + ';"></div>');
});
i18nReplaceText();
// maker_targetDiv.fadeIn('medium',function(){
// //lockLayout();
// maker_targetDiv.draggable();
// }); maker_targetDiv.show();
maker_targetDiv.draggable();
Maker_handleColorPickerEvent();
$('#dlgMaker').center();
};
function touchStart_BtnOk_Maker(e){
e.preventDefault();
Maker_dspOK_click();
};
function touchStart_BtnCancel_Maker(e){
e.preventDefault();
Maker_dspCancel_click();
};
function Maker_handleColorPickerEvent(){
//$('.colorpicker').live('mouseenter',Maker_colorPickerMouseEnterFunction);
//$('.colorpicker').live('mouseleave', Maker_colorPickerMouseLeaveFunction);
//$('#makerColorwrapper').live('mouseleave', Maker_colorWrapperMouseLeaveFunction);
if(avwUserEnvObj.os == "ipad" || avwUserEnvObj.os == "android"){
$('.colorpicker').unbind('mouseenter');
$('.colorpicker').unbind('mouseleave');
$('#makerColorwrapper').unbind('mouseleave');
document.getElementById('Maker_btnOk').addEventListener('touchstart',touchStart_BtnOk_Maker,false);
document.getElementById('Maker_btnCancel').addEventListener('touchstart',touchStart_BtnCancel_Maker,false);
}
else{
//alert('here');
$('.colorpicker').unbind('mouseenter');
$('.colorpicker').unbind('mouseleave');
$('#makerColorwrapper').unbind('mouseleave');
$('.colorpicker').bind('mouseenter', Maker_colorPickerMouseEnterFunction);
$('.colorpicker').bind('mouseleave', Maker_colorPickerMouseLeaveFunction);
$('#makerColorwrapper').bind('mouseleave', Maker_colorWrapperMouseLeaveFunction);
}
$('#Maker_btnOk').live('click', Maker_dspOK_click);
$('#Maker_btnCancel').live('click', Maker_dspCancel_click);
Maker_SetDefaultValue();
$('#maker-size-small').live('click', Maker_rdo1_click);
$('#maker-size-medium').live('click', Maker_rdo2_click);
$('#maker-size-large').live('click', Maker_rdo3_click);
$('#maker-size-oversize').live('click', Maker_rdo4_click);
$('#marker-small-text').live('click', markerSmallTextClick);
$('#marker-medium-text').live('click', markerMediumTextClick);
$('#marker-large-text').live('click', markerLargeTextClick);
$('#marker-oversize-text').live('click', markerOversizeTextClick);
$('.colorpicker').live('click', Maker_colorPickerClickFunction);
$("#avw-sys-modal").click (function () {
maker_targetDiv.fadeOut('medium',function(){
//unlockLayout();
});
});
};
function markerSmallTextClick(){
$('#maker-size-small').attr('checked','checked');
$('#maker-size-medium').removeAttr('checked');
$('#maker-size-large').removeAttr('checked');
$('#maker-size-oversize').removeAttr('checked');
Maker_rdo1_click();
};
function markerMediumTextClick(){
$('#maker-size-small').removeAttr('checked');
$('#maker-size-medium').attr('checked','checked');
$('#maker-size-large').removeAttr('checked');
$('#maker-size-oversize').removeAttr('checked');
Maker_rdo2_click();
};
function markerLargeTextClick(){
$('#maker-size-small').removeAttr('checked');
$('#maker-size-medium').removeAttr('checked');
$('#maker-size-large').attr('checked','checked');
$('#maker-size-oversize').removeAttr('checked');
Maker_rdo3_click();
};
function markerOversizeTextClick(){
$('#maker-size-small').removeAttr('checked');
$('#maker-size-medium').removeAttr('checked');
$('#maker-size-large').removeAttr('checked');
$('#maker-size-oversize').attr('checked','checked');
Maker_rdo4_click();
};
// Choose type of eraser, and draw to canvas
function Maker_chooseType(typeValue, color) {
var fillColor;
maker_Size = typeValue;
var canvas = document.getElementById('Maker_cvPreviewmaker');
if(color == null || color == 'undefined'){
fillColor = "f8ff00";
}
else{
fillColor = '#'+ color;
}
if (canvas.getContext) {
// use getContext to use the canvas for drawing
var ctx = canvas.getContext('2d');
// Draw shapes
//ctx.fillStyle = "#888888";
ctx.clearRect(0, 0, canvas.width, canvas.height);
ctx.fillStyle = fillColor;
ctx.strokeStyle = fillColor;
ctx.fillRect((eval(canvas.width)/2) - (eval(typeValue)/2), (eval(canvas.height)/2) - (eval(typeValue)/2), typeValue, typeValue);
}
};
// Set default value for maker.
function Maker_SetDefaultValue() {
var typeValue = undefined;
var makerColor = ClientData.maker_color();
typeValue = ClientData.maker_size();
maker_Size = typeValue;
if(makerColor != null || makerColor != undefined){
maker_chooseColor = makerColor;
}
else{
maker_chooseColor = 'f8ff00';
makerColor = 'f8ff00';
}
if (typeValue == 5) {
$("#maker-size-small").attr('checked', 'checked');
$("#maker-size-small").focus();
}
else if (typeValue == 12.5) {
$("#maker-size-medium").attr('checked', 'checked');
$("#maker-size-medium").focus();
}
else if (typeValue == 25) {
$("#maker-size-large").attr('checked', 'checked');
$("#maker-size-large").focus();
}
else if (typeValue == 50) {
$("#maker-size-oversize").attr('checked', 'checked');
$("#maker-size-oversize").focus();
}
else {
maker_Size = 10;
$("#maker-size-small").attr('checked', 'checked');
$("#maker-size-small").focus();
}
$('.colorpicker[colorId="'+makerColor+'"]').css('border','1px solid black');
$('#makerColorPreview').css('background-color', '#'+makerColor);
$('#makerColorPreview').css('border-color', '#'+makerColor);
Maker_chooseType(maker_Size, makerColor);
};
function Maker_colorPickerMouseLeaveFunction() {
$(this).css('border','1px solid white');
$('.colorpicker[colorId="' + maker_chooseColor + '"]').css('border', '1px solid black');
};
function Maker_colorPickerMouseEnterFunction() {
$(this).css('border','1px solid black');
var color = $(this).attr('colorId');
Maker_chooseType(maker_Size, color);
$('#makerColorPreview').css('background-color','#'+color);
$('#makerColorPreview').css('border-color','#'+color);
};
function Maker_colorPickerClickFunction() {
$('.colorpicker[colorId="' + maker_chooseColor + '"]').css('border', '1px solid white');
$(this).css('border','1px solid black');
maker_chooseColor = $(this).attr('colorId');
Maker_chooseType(maker_Size, maker_chooseColor);
$('#makerColorPreview').css('background-color','#'+maker_chooseColor);
$('#makerColorPreview').css('border-color','#'+maker_chooseColor);
};
function Maker_rdo1_click() {
Maker_chooseType(5, maker_chooseColor);
};
function Maker_rdo2_click() {
Maker_chooseType(12.5, maker_chooseColor);
};
function Maker_rdo3_click() {
Maker_chooseType(25, maker_chooseColor);
};
function Maker_rdo4_click() {
Maker_chooseType(50, maker_chooseColor);
};
// Event of button OK
function Maker_dspOK_click() {
// Set selected value to local storage
var typeValue = undefined;
if ($("#maker-size-small").attr('checked') == 'checked') {
typeValue = 5;
}
else if ($("#maker-size-medium").attr('checked') == 'checked') {
typeValue = 12.5;
}
else if ($("#maker-size-large").attr('checked') == 'checked') {
typeValue = 25;
}
else if ($("#maker-size-oversize").attr('checked') == 'checked') {
typeValue = 50;
}
if(ClientData.maker_color() != maker_chooseColor){
imgMarkerTemp = canvas_marker.toDataURL("image/png;");
var img = new Image();
img.onload = function () {
context_draw.drawImage(img, 0, 0, canvas_draw.width, canvas_draw.height);
};
img.src = imgMarkerTemp;
context_marker.clearRect(0, 0, canvas_marker.width, canvas_marker.height);
ClientData.maker_color();
}
// Set value to local
ClientData.maker_size(typeValue);
ClientData.maker_color(maker_chooseColor);
maker_Size = typeValue;
makerColor = maker_chooseColor;
// Close dialog
/*maker_targetDiv.fadeOut('medium',function(){
$("#avw-sys-modal").hide();
});*/
maker_targetDiv.hide();
/*enable button */
enableButtonMarking();
ClientData.IsAddingMarking(true);
isAddingMarking = ClientData.IsAddingMarking();
makerSize = ClientData.maker_size();
makerColor = ClientData.maker_color();
/* unlock dialog overlay */
$("#overlay").hide();
$('#dlgMarking_imgMakerOption').removeClass();
$('#dlgMarking_imgMakerOption').addClass('maker_option_hover');
};
// Event of button cancel
function Maker_dspCancel_click() {
// Close dialog
/*maker_targetDiv.fadeOut('medium',function(){
$("#avw-sys-modal").hide();
});*/
maker_targetDiv.hide();
/*enable button */
enableButtonMarking();
ClientData.IsAddingMarking(true);
isAddingMarking = ClientData.IsAddingMarking();
/* unlock dialog overlay */
$("#overlay").hide();
$('#dlgMarking_imgMakerOption').removeClass();
$('#dlgMarking_imgMakerOption').addClass('maker_option_hover');
};
function Maker_colorWrapperMouseLeaveFunction() {
Maker_chooseType(maker_Size, maker_chooseColor);
$('#makerColorPreview').css('background-color', '#' + maker_chooseColor);
$('#makerColorPreview').css('border-color', '#' + maker_chooseColor);
$('.colorpicker[colorId="' + maker_chooseColor + '"]').css('border', '1px solid black');
};
/// ===============================================================================================
/// Maker group [ end ]
/// ===============================================================================================
\ No newline at end of file
/// コンテンツ閲覧画面_マーキングツールバーオーバーレイ
/// <reference path="../common/js/avweb.js" />
/// <reference path="../common/js/screenLock.js" />
/// <reference path="../common/js/common.js" />
/// <reference path="../common/js/i18n.js" />
/// <reference path="../common/js/jquery-1.8.1.min.js" />
/// <reference path="../common/js/jquery-ui-1.8.23.custom.min.js" />
/// <reference path="../common/js/jquery.toastmessage.js" />
/// <reference path="../common/js/pageViewer.js" />
/// ===============================================================================================
/// Marking group [start]
/// ===============================================================================================
// Set default value for easer.
function Marking_SetDefaultValue() {
};
/*
----------------------------------------------------------------------------
Event groups [start]
----------------------------------------------------------------------------
*/
function dlgMarking_dspSave_click() {
imgMarkerTemp = canvas_marker.toDataURL("image/png;");
var img = new Image();
img.onload = function () {
context_draw.drawImage(img, 0, 0, canvas_draw.width, canvas_draw.height);
/*create new entity marking */
var marking = new MarkingEntity();
marking.contentid = contentID;
marking.pageNo = changePageIndex(getPageIndex());
marking.content = canvas_draw.toDataURL("image/png");
/* insert marking */
var arr = ClientData.MarkingData();
var nIndexMarking = -1;
for (var nIndex = 0; nIndex < arr.length; nIndex++) {
if (arr[nIndex].contentid == contentID
&& arr[nIndex].pageNo == changePageIndex(getPageIndex())) {
nIndexMarking = nIndex;
break;
}
}
if (isDrawing == true) {/* if has draw image */
if (isClearDrawing == true) {
arr.splice(nIndexMarking, 1);
} else {
/* case not exist marking */
if (nIndexMarking == -1) {
arr.push(marking);
} else {
/* case exist marking */
arr[nIndexMarking] = marking;
}
}
}
/*add marking to local storage */
ClientData.MarkingData(arr);
// Close dialog
//$("#dlgMarking").dialog('close');
$("#dlgMarking").hide();
ClientData.IsAddingMarking(false);
$('#draw_canvas').css('display', 'none');
/* $('#imgmarkingtoolbar').removeClass('markingToolbar');
$('#imgmarkingtoolbar').addClass('markingToolbar_off');
$("#imgmarkingtoolbar").removeAttr("style")
$('#imgmarking').removeClass('marking_off');
$('#imgmarking').addClass('marking');*/
/*set flag change marking */
ClientData.isChangedMemo(true);
ClientData.IsHideToolbar(false);
/* draw again*/
//drawCanvas();
//disableAllControl();
handleDisplayToolbar();
/* visible button fullscreen */
$('#control_screen_2').show();
/* init clear drawing canvas */
isClearDrawing = false;
};
img.src = imgMarkerTemp;
context_marker.clearRect(0, 0, canvas_marker.width, canvas_marker.height);
$('#marker_canvas').css('display','none');
};
function dlgMarking_dspCancel_click() {
// Close dialog
$("#dlgMarking").hide();
/* init clear drawing canvas */
isClearDrawing = false;
ClientData.IsAddingMarking(false);
$('#draw_canvas').css('display','none');
/*$('#imgmarkingtoolbar').removeClass('markingToolbar');
$('#imgmarkingtoolbar').addClass('markingToolbar_off');
$("#imgmarkingtoolbar").removeAttr("style")*/
ClientData.IsHideToolbar(false);
context_draw.clearRect(0, 0, canvas_draw.width, canvas_draw.height);
/* draw again*/
//drawCanvas();
//disableAllControl();
handleDisplayToolbar();
/* visible button fullscreen */
$('#control_screen_2').show();
$('#marker_canvas').css('display','none');
};
function dlgMarking_dspPgClear_click() {
// Close dialog
context_draw.clearRect(0, 0, canvas_draw.width, canvas_draw.height);
context_marker.clearRect(0, 0, canvas_marker.width, canvas_marker.height);
isClearDrawing = true;
/* clear on local */
var arr = ClientData.MarkingData();
};
/* draw marker canvas to draw canvas */
function canvasMarkerToCanvasDraw(){
imgMarkerTemp = canvas_marker.toDataURL("image/png;");
var img = new Image();
img.onload = function () {
context_draw.drawImage(img, 0, 0, canvas_draw.width, canvas_draw.height);
};
img.src = imgMarkerTemp;
context_marker.clearRect(0, 0, canvas_marker.width, canvas_marker.height);
$('#marker_canvas').css('display','none');
};
function dlgMarking_imgPen_click() {
// Choose pen
$("#dlgMarking_imgMaker").removeClass();
$("#dlgMarking_imgPen").addClass('toolbar_icon_on');
$("#dlgMarking_imgEraser").removeClass();
ClientData.MarkingType("pen");
markingType = "pen";
canvasMarkerToCanvasDraw();
setDefaultImageForMarking();
};
function dlgMarking_imgPenOption_click() {
/*disable button */
disableButtonMarking();
//ClientData.IsAddingMarking(false);
/* display dialog overlay */
$("#overlay").show();
isAddingMarking = ClientData.IsAddingMarking();
// Show option of pen
ShowPen($('#dlgPen'));
/* draw maker canvas */
if(markingType == "maker"){
canvasMarkerToCanvasDraw();
}
ClientData.MarkingType("pen");
markingType = "pen";
$('#dlgMarking_imgPenOption').removeClass();
$('#dlgMarking_imgPenOption').addClass('pen_option_selected');
setDefaultImageForMarking();
};
function dlgMarking_imgMaker_click() {
// Choose maker
$("#dlgMarking_imgMaker").addClass('toolbar_icon_on');
$("#dlgMarking_imgPen").removeClass();
$("#dlgMarking_imgEraser").removeClass();
ClientData.MarkingType("maker");
markingType = "maker";
$('#marker_canvas').css('display','block');
setDefaultImageForMarking();
};
function dlgMarking_imgMakerOption_click() {
/*disable button */
disableButtonMarking();
//ClientData.IsAddingMarking(false);
/* display dialog overlay */
$("#overlay").show();
isAddingMarking = ClientData.IsAddingMarking();
// Show option of maker
ShowMaker($('#dlgMaker'));
ClientData.MarkingType("maker");
markingType = "maker";
$('#marker_canvas').css('display','block');
$('#dlgMarking_imgMakerOption').removeClass();
$('#dlgMarking_imgMakerOption').addClass('maker_option_selected');
setDefaultImageForMarking();
};
function dlgMarking_imgEraser_click() {
// Choose eraser
$("#dlgMarking_imgMaker").removeClass();
$("#dlgMarking_imgPen").removeClass();
$("#dlgMarking_imgEraser").addClass('toolbar_icon_on');
ClientData.MarkingType("eraser");
markingType = "eraser";
canvasMarkerToCanvasDraw();
setDefaultImageForMarking();
};
function dlgMarking_imgEraserOption_click() {
/*disable button */
disableButtonMarking();
//ClientData.IsAddingMarking(false);
/* display dialog overlay */
$("#overlay").show();
isAddingMarking = ClientData.IsAddingMarking();
// Show option of maker
ShowEraser();
/* draw maker canvas */
if(markingType == "maker"){
canvasMarkerToCanvasDraw();
}
ClientData.MarkingType("eraser");
markingType = "eraser";
$('#dlgMarking_imgEraserOption').removeClass();
$('#dlgMarking_imgEraserOption').addClass('eraser_option_selected');
setDefaultImageForMarking();
};
function dlgMarking_imgMin_click() {
//$("#dlgMarking_body").slideToggle('fast');
$("#dlgMarking_imgMin").hide();
$("#dlgMarking_imgMax").show();
$("#dlgMarking_body").removeClass('markingBoxBody_on');
$("#dlgMarking_body").addClass('markingBoxBody_off');
//$('#dlgMarking').dialog({ height: 80});
//$('#dlgMarking').css('height', '29px');
};
function dlgMarking_imgMax_click() {
//$("#dlgMarking_imgMin").slideToggle('fast');
$("#dlgMarking_imgMax").hide();
$("#dlgMarking_imgMin").show();
$("#dlgMarking_body").addClass('markingBoxBody_on');
$("#dlgMarking_body").removeClass('markingBoxBody_off');
//$('#dlgMarking').dialog({height: 350});
//$('#dlgMarking').css('height', '300px');
};
function dlgMarking_imgClose_click() {
$("#dlgMarking").hide();
ClientData.IsHideToolbar(true);
disableAllControl();
};
/*
----------------------------------------------------------------------------
Event groups [ end ]
----------------------------------------------------------------------------
*/
function setDefaultImageForMarking(){
/* pen */
if(markingType == "pen"){
$('#dlgMarking_imgPen').removeClass();
$('#dlgMarking_imgPen').addClass('pen_selected');
}else{
$('#dlgMarking_imgPen').removeClass();
$('#dlgMarking_imgPen').addClass('pen_hover');
}
/* maker */
if(markingType == "maker"){
$('#dlgMarking_imgMaker').removeClass();
$('#dlgMarking_imgMaker').addClass('maker_selected');
}else{
$('#dlgMarking_imgMaker').removeClass();
$('#dlgMarking_imgMaker').addClass('maker_hover');
}
/* maker */
if(markingType == "eraser"){
$('#dlgMarking_imgEraser').removeClass();
$('#dlgMarking_imgEraser').addClass('eraser_selected');
}else{
$('#dlgMarking_imgEraser').removeClass();
$('#dlgMarking_imgEraser').addClass('eraser_hover');
}
};
/* disable all button on dialog marking */
function disableButtonMarking(){
$('#dlgMarking_dspSave').unbind('click');
$('#dlgMarking_dspCancel').unbind('click');
$('#dlgMarking_dspPgClear').unbind('click');
$('#dlgMarking_imgMin').unbind('click');
$('#dlgMarking_imgMax').unbind('click');
$('#dlgMarking_imgClose').unbind('click');
$('#dlgMarking_imgPen').unbind('click');
$('#dlgMarking_imgPenOption').unbind('click');
$('#dlgMarking_imgMaker').unbind('click');
$('#dlgMarking_imgMakerOption').unbind('click');
$('#dlgMarking_imgEraser').unbind('click');
$('#dlgMarking_imgEraserOption').unbind('click');
/* set cursor default*/
$("#dlgMarking_dspSave").css('cursor', 'default');
$("#dlgMarking_dspCancel").css('cursor', 'default');
$("#dlgMarking_dspPgClear").css('cursor', 'default');
$("#dlgMarking_imgMin").css('cursor', 'default');
$("#dlgMarking_imgMax").css('cursor', 'default');
$("#dlgMarking_imgClose").css('cursor', 'default');
$("#dlgMarking_imgPen").css('cursor', 'default');
$("#dlgMarking_imgPenOption").css('cursor', 'default');
$("#dlgMarking_imgMaker").css('cursor', 'default');
$("#dlgMarking_imgMakerOption").css('cursor', 'default');
$("#dlgMarking_imgEraser").css('cursor', 'default');
$("#dlgMarking_imgEraserOption").css('cursor', 'default');
};
/* enable all button con dialog marking */
function enableButtonMarking(){
disableButtonMarking();
$('#dlgMarking_dspSave').bind('click',dlgMarking_dspSave_click);
$('#dlgMarking_dspCancel').bind('click',dlgMarking_dspCancel_click);
$('#dlgMarking_dspPgClear').bind('click',dlgMarking_dspPgClear_click);
$('#dlgMarking_imgMin').bind('click',dlgMarking_imgMin_click);
$('#dlgMarking_imgMax').bind('click',dlgMarking_imgMax_click);
$('#dlgMarking_imgClose').bind('click',dlgMarking_imgClose_click);
$('#dlgMarking_imgPen').bind('click',dlgMarking_imgPen_click);
$('#dlgMarking_imgPenOption').bind('click',dlgMarking_imgPenOption_click);
$('#dlgMarking_imgMaker').bind('click',dlgMarking_imgMaker_click);
$('#dlgMarking_imgMakerOption').bind('click',dlgMarking_imgMakerOption_click);
$('#dlgMarking_imgEraser').bind('click',dlgMarking_imgEraser_click);
$('#dlgMarking_imgEraserOption').bind('click',dlgMarking_imgEraserOption_click);
/* set cursor pointer*/
$("#dlgMarking_dspSave").css('cursor', 'pointer');
$("#dlgMarking_dspCancel").css('cursor', 'pointer');
$("#dlgMarking_dspPgClear").css('cursor', 'pointer');
$("#dlgMarking_imgMin").css('cursor', 'pointer');
$("#dlgMarking_imgMax").css('cursor', 'pointer');
$("#dlgMarking_imgClose").css('cursor', 'pointer');
$("#dlgMarking_imgPen").css('cursor', 'pointer');
$("#dlgMarking_imgPenOption").css('cursor', 'pointer');
$("#dlgMarking_imgMaker").css('cursor', 'pointer');
$("#dlgMarking_imgMakerOption").css('cursor', 'pointer');
$("#dlgMarking_imgEraser").css('cursor', 'pointer');
$("#dlgMarking_imgEraserOption").css('cursor', 'pointer');
};
function ShowMarking() {
//$("#dlgMarking_body").show();
//$("#dlgMarking_body").addClass('markingBoxBody_on');
//$("#dlgMarking_body").removeClass('markingBoxBody_on');
//$('#dlgMarking').dialog({ height: 350 });
//$('#dlgMarking').css('height', '300px');
//$('#dlgMarking').dialog("open");
$('#dlgMarking').css('top', '40px');
$('#dlgMarking').css('left', '10px');
$('#dlgMarking').show();
//$('#dlgMarking').fadeIn('fast');
// $('#dlgMarking').center();
// $('#dlgMarking').top();
// $('#dlgMarking').bottom();
//$(".ui-dialog-titlebar").hide();
Marking_SetDefaultValue();
//$("#dlgMarking_imgMin").show();
// $("#dlgMarking_imgMax").hide();
dlgMarking_imgPen_click();
setDefaultImageForMarking();
$('#dlgMarking_imgPenOption').removeClass();
$('#dlgMarking_imgPenOption').addClass('pen_option_hover');
$('#dlgMarking_imgMakerOption').removeClass();
$('#dlgMarking_imgMakerOption').addClass('maker_option_hover');
$('#dlgMarking_imgEraserOption').removeClass();
$('#dlgMarking_imgEraserOption').addClass('eraser_option_hover');
};
// Setting dialog
$(function () {
$("#dlgMarking_dspSave").click(dlgMarking_dspSave_click);
$("#dlgMarking_dspCancel").click(dlgMarking_dspCancel_click);
$("#dlgMarking_dspPgClear").click(dlgMarking_dspPgClear_click);
// Icons
$("#dlgMarking_imgMin").click(dlgMarking_imgMin_click);
$("#dlgMarking_imgMax").click(dlgMarking_imgMax_click);
$("#dlgMarking_imgClose").click(dlgMarking_imgClose_click);
$("#dlgMarking_imgPen").click(dlgMarking_imgPen_click);
$("#dlgMarking_imgPenOption").click(dlgMarking_imgPenOption_click);
$("#dlgMarking_imgMaker").click(dlgMarking_imgMaker_click);
$("#dlgMarking_imgMakerOption").click(dlgMarking_imgMakerOption_click);
$("#dlgMarking_imgEraser").click(dlgMarking_imgEraser_click);
$("#dlgMarking_imgEraserOption").click(dlgMarking_imgEraserOption_click);
/*
$('#dlgMarking').dialog({
autoOpen: false,
title: '',
modal: false,
resizable: false,
width: 300,
height: 350
});
*/
$('#dlgMarking').draggable({
revert: false
});
});
/// ===============================================================================================
/// Marking group [ end ]
/// ===============================================================================================
var targetDiv;
var targetX;
var targetY;
var targetMemoId;
var EditIndex;
var saveMode;
var memoCallbackFunc;
var conid;
var pageid;
function createMemoDialog(){
targetDiv.show();
targetDiv.html('');
targetDiv.append(
'<aside id="memoWrapper" class="MemoIndexBox">'
+ ' <h1 class="indexBoxHd">' + i18nText('txtMemo')
+' <a class="delete"></a>'
+' </h1>'
+' <div id="memoArea" class="indexBoxBody_on">'
+' <textarea id="txaMemoContent" style="resize: none; height: 302px; width: 452px; margin-bottom: 10px"></textarea>'
+' <div style="width: 450px;">'
+ ' <a id="Memo_btnCancel" style="float:right" class="lang cancelbtn" lang="dspCancel">' + i18nText('dspCancel') + '</a>'
+ ' <a id="Memo_btnDel" style="float:right" class="lang cancelbtn" lang="dspDelete">' + i18nText('dspDelete') + '</a>'
+ ' <a id="Memo_btnSave" style="float:right" class="lang cancelbtn" lang="dspSave">' + i18nText('dspSave') + '</a>'
+' </div>'
+' </div>'
+'</aside>');
$('#txaMemoContent').focus();
handleMemoEventFunction();
};
function handleMemoEventFunction(){
$('#Memo_btnSave').click(buttonSaveFunction);
$('#Memo_btnDel').click(MemoDelFunction);
$('#Memo_btnCancel').click(MemoCancelFunction);
$('.delete').click(MemoCancelFunction);
};
function memoSaveFunction(){
var tempArr = [];
var memoObj = new MemoEntity();
memoObj.pageNo = pageid;
memoObj.contentid = conid;
memoObj.Text = $('#txaMemoContent').val();
var imagePt = screenToImage(targetX, targetY);
memoObj.posX = imagePt.x;
memoObj.posY = imagePt.y;
tempArr = ClientData.MemoData();
tempArr.push(memoObj);
ClientData.MemoData(tempArr);
if(memoCallbackFunc){
memoCallbackFunc();
}
};
function MemoDelFunction(){
if(saveMode == 'Copy'){
//targetDiv.dialog('close');
targetDiv.fadeOut('medium', function(){
});
isCopyMemo = false;
}
else{
var resultArr = ClientData.MemoData();
resultArr.splice(EditIndex, 1);
ClientData.MemoData(resultArr);
//targetDiv.dialog('close');
if(memoCallbackFunc){
memoCallbackFunc();
}
}
$("#overlay").hide();
targetDiv.children().remove();
targetDiv.hide();
$("#pop_up_memo").hide();
/* draw again */
drawCanvas();
/* enable controls after finish copy */
enableControlsCopyMemo();
};
function MemoCancelFunction(){
//targetDiv.dialog('close');
$("#overlay").hide();
targetDiv.children().remove();
targetDiv.hide();
isCopyMemo = false;
$("#pop_up_memo").hide();
/* enable controls after finish copy */
enableControlsCopyMemo();
if(ClientData.IsAddingMemo() == true){
ClientData.IsAddingMemo(false);
//change class
$('#imgaddmemo').removeClass();
$('#imgaddmemo').addClass('memoAdd');
}
};
function AddMemo(contentId,pageNo,targetId, posX, posY, callback) {
conid = contentId;
pageid = pageNo;
targetDiv = targetId;
targetX = posX;
targetY = posY;
memoCallbackFunc = callback;
createMemoDialog();
saveMode = 'New';
$('#Memo_btnDel').css('display','none');
//targetDiv.dialog({width: 466, height: 390, modal: true, position: [targetX, targetY], resizable: false});
//targetDiv.parent().removeClass('ui-draggable');
$("#overlay").show();
disableControlsCopyMemo();
targetDiv.css('z-index','1005');
targetDiv.css('top',targetY);
targetDiv.css('left',targetX - ($('#memoWrapper').width() /2 ));
targetDiv.draggable({ handle: "h1" });
//editJqueryUIDialog();
};
function EditMemo(index, posXPlus, posYPlus, targetId, callback){
targetDiv = targetId;
targetX = ClientData.MemoData()[index].posX + posXPlus;
targetY = ClientData.MemoData()[index].posY + posYPlus;
EditIndex = index;
memoCallbackFunc = callback;
createMemoDialog();
getMemoForEdit();
saveMode = 'Edit';
$('#Memo_btnDel').css('display','block');
//targetDiv.dialog({width: 466, height: 390, modal: true, position: [targetX, targetY], resizable: false});
//targetDiv.parent().removeClass('ui-draggable');
$("#overlay").show();
disableControlsCopyMemo();
targetDiv.css('z-index','1005');
var pt = imageToScreen(targetX, targetY);
targetDiv.css('top',pt.y);
targetDiv.css('left',pt.x - ($('#memoWrapper').width() /2 ));
targetDiv.draggable({ handle: "h1" });
//editJqueryUIDialog();
};
function CopyMemo(index,contentId,pageNo,targetId, posX, posY, callback){
conid = contentId;
pageid = pageNo;
targetDiv = targetId;
targetX = posX;
targetY = posY;
EditIndex = index;
memoCallbackFunc = callback;
createMemoDialog();
//getMemoForEdit();
$('#txaMemoContent').val(index);
saveMode = 'Copy';
$('#Memo_btnDel').css('display','none');
//targetDiv.dialog({width: 466, height: 390, modal: true, position: [targetX, targetY], resizable: false});
//targetDiv.parent().removeClass('ui-draggable');
$("#overlay").show();
disableControlsCopyMemo();
targetDiv.css('z-index','1005');
targetDiv.css('top',targetY);
targetDiv.css('left',targetX - ($('#memoWrapper').width() /2 ));
targetDiv.draggable({ handle: "h1" });
//editJqueryUIDialog();
};
function getMemoForEdit(){
var arrTemp = ClientData.MemoData();
var tempEntity = arrTemp[EditIndex];
$('#txaMemoContent').val(tempEntity.Text);
};
function editMemoFunction(){
var arrTemp = ClientData.MemoData();
var tempEntity = arrTemp[EditIndex];
var editContent = $('#txaMemoContent').val();
tempEntity.Text = editContent;
arrTemp[EditIndex] = tempEntity;
ClientData.MemoData(arrTemp);
if(memoCallbackFunc){
memoCallbackFunc();
}
/*refresh memo*/
//drawCanvas();
};
function buttonSaveFunction(){
if(saveMode == 'Edit'){
editMemoFunction();
}
else if(saveMode == 'New'){
memoSaveFunction();
}else if(saveMode == 'Copy'){
memoSaveFunction();
}
//targetDiv.dialog('close');
$("#overlay").hide();
targetDiv.children().remove();
targetDiv.hide();
isCopyMemo = false;
$("#pop_up_memo").hide();
/* enable controls after finish copy */
enableControlsCopyMemo();
};
function editJqueryUIDialog(){
$('.ui-dialog-titlebar').hide();
targetDiv.addClass('memoDialogImportantCss');
targetDiv.parent().addClass('parentMemoDialogImportantCss');
};
/// コンテンツ閲覧画面_消しゴム書式オーバーレイ
/// <reference path="../common/js/avweb.js" />
/// <reference path="../common/js/screenLock.js" />
/// <reference path="../common/js/common.js" />
/// <reference path="../common/js/i18n.js" />
/// <reference path="../common/js/jquery-1.8.1.min.js" />
/// <reference path="../common/js/jquery-ui-1.8.23.custom.min.js" />
/// <reference path="../common/js/jquery.toastmessage.js" />
/// <reference path="../common/js/pageViewer.js" />
// works out the X, Y position of the click inside the canvas from the X, Y position on the page
function getPosition(mouseEvent, sigCanvas) {
var x, y;
if (mouseEvent.pageX != undefined && mouseEvent.pageY != undefined) {
x = mouseEvent.pageX;
y = mouseEvent.pageY;
} else {
x = mouseEvent.clientX + document.body.scrollLeft + document.documentElement.scrollLeft;
y = mouseEvent.clientY + document.body.scrollTop + document.documentElement.scrollTop;
}
return { X: x - sigCanvas.offsetLeft, Y: y - sigCanvas.offsetTop };
};
function initializeCanvas(targetCanvas) {
// get references to the canvas element as well as the 2D drawing context
var sigCanvas = targetCanvas;
var context = sigCanvas.getContext("2d");
context.strokeStyle = 'Black';
// This will be defined on a TOUCH device such as iPad or Android, etc.
var is_touch_device = 'ontouchstart' in document.documentElement;
if (is_touch_device) {
// create a drawer which tracks touch movements
var drawer = {
isDrawing: false,
// touchstart: function (coors) {
// context.beginPath();
// context.moveTo(coors.x, coors.y);
// this.isDrawing = true;
// },
// touchmove: function (coors) {
// if (this.isDrawing) {
// context.lineTo(coors.x, coors.y);
// context.stroke();
// }
// },
// touchend: function (coors) {
// if (this.isDrawing) {
// this.touchmove(coors);
// this.isDrawing = false;
// }
// }
touchstart: function (coors) {
context.beginPath();
context.moveTo(coors.x, coors.y);
this.isDrawing = true;
drawPoint(coors, context);
},
touchmove: function (coors) {
if (this.isDrawing) {
drawMove(coors, context);
}
},
touchend: function (coors) {
if (this.isDrawing) {
//this.touchmove(coors);
this.isDrawing = false;
context.closePath();
}
}
};
// create a function to pass touch events and coordinates to drawer
function draw(event) {
if (event.type == "touchend") {
drawer[event.type](null);
}
else {
// get the touch coordinates. Using the first touch in case of multi-touch
var coors = {
x: event.targetTouches[0].pageX,
y: event.targetTouches[0].pageY
};
// Now we need to get the offset of the canvas location
var obj = sigCanvas;
if (obj.offsetParent) {
// Every time we find a new object, we add its offsetLeft and offsetTop to curleft and curtop.
do {
coors.x -= obj.offsetLeft;
coors.y -= obj.offsetTop;
}
// The while loop can be "while (obj = obj.offsetParent)" only, which does return null
// when null is passed back, but that creates a warning in some editors (i.e. VS2010).
while ((obj = obj.offsetParent) != null);
}
// pass the coordinates to the appropriate handler
drawer[event.type](coors);
}
};
// attach the touchstart, touchmove, touchend event listeners.
sigCanvas.addEventListener('touchstart', draw, false);
sigCanvas.addEventListener('touchmove', draw, false);
sigCanvas.addEventListener('touchend', draw, false);
// prevent elastic scrolling
sigCanvas.addEventListener('touchmove', function (event) {
event.preventDefault();
}, false);
}
};
function drawMove(coors, context_draw) {
if (isAddingMarking == true) {
if (markingType == 'eraser') {
//context.clearRect(coors.x, coors.y, ClientData.erase_size(), ClientData.erase_size());
context_draw.globalCompositeOperation = 'destination-out';
context_draw.lineWidth = eraseSize;
context_draw.lineJoin = 'round';
context_draw.lineCap = 'round';
context_draw.lineTo(sx, sy);
context_draw.stroke();
context_draw.globalCompositeOperation = 'source-over';
}
else if (markingType == 'pen') {
context_draw.lineCap = "round";
context_draw.lineJoin = "bevel";
context_draw.lineWidth = penSize;
context_draw.strokeStyle = "#" + penColor;
//context_draw.globalAlpha = 1;
context_draw.lineTo(coors.x, coors.y);
context_draw.stroke();
}
else if (markingType == 'maker') {
/*context_draw.clearRect(coors.x , coors.y,makerSize, coors.y - sy);*/
/*context_draw.globalCompositeOperation = 'destination-out';
context_draw.lineWidth = makerSize/10;
context_draw.lineHeight = makerSize/10;
context_draw.lineJoin = 'bevel';
context_draw.lineCap = 'butt';
context_draw.lineTo(coors.x, coors.y);
context_draw.stroke();
context_draw.globalCompositeOperation = 'source-over';*/
//context_draw.globalCompositeOperation = 'destination-out'
context_draw.beginPath();
var halfSize = makerSize / 2;
var quotSize = makerSize / 4;
var ptStart = [
{ x: sx - quotSize, y: sy - halfSize },
{ x: sx + quotSize, y: sy - halfSize },
{ x: sx + quotSize, y: sy + halfSize },
{ x: sx - quotSize, y: sy + halfSize }
];
var ptEnd = [
{ x: coors.x - quotSize, y: coors.y - halfSize },
{ x: coors.x + quotSize, y: coors.y - halfSize },
{ x: coors.x + quotSize, y: coors.y + halfSize },
{ x: coors.x - quotSize, y: coors.y + halfSize }
];
if (sx > coors.x) {
if (sy > coors.y) {
context_draw.globalCompositeOperation = 'destination-out';
context_draw.moveTo(ptStart[1].x, ptStart[1].y);
context_draw.lineTo(ptStart[2].x, ptStart[2].y);
context_draw.lineTo(ptStart[3].x, ptStart[3].y);
context_draw.lineTo(ptEnd[3].x, ptEnd[3].y);
context_draw.lineTo(ptEnd[0].x, ptEnd[0].y);
context_draw.lineTo(ptEnd[1].x, ptEnd[1].y);
context_draw.lineJoin = 'bevel';
context_draw.lineCap = 'butt';
context_draw.fillStyle = "#" + makerColor;
context_draw.fill();
context_draw.globalCompositeOperation = 'lighter';
context_draw.closePath();
context_draw.beginPath();
// 左上に描画する場合
context_draw.moveTo(ptStart[1].x, ptStart[1].y);
context_draw.lineTo(ptStart[2].x, ptStart[2].y);
context_draw.lineTo(ptStart[3].x, ptStart[3].y);
context_draw.lineTo(ptEnd[3].x, ptEnd[3].y);
context_draw.lineTo(ptEnd[0].x, ptEnd[0].y);
context_draw.lineTo(ptEnd[1].x, ptEnd[1].y);
context_draw.closePath();
} else if (sy < coors.y) {
context_draw.globalCompositeOperation = 'destination-out';
context_draw.moveTo(ptStart[0].x, ptStart[0].y);
context_draw.lineTo(ptStart[1].x, ptStart[1].y);
context_draw.lineTo(ptStart[2].x, ptStart[2].y);
context_draw.lineTo(ptEnd[2].x, ptEnd[2].y);
context_draw.lineTo(ptEnd[3].x, ptEnd[3].y);
context_draw.lineTo(ptEnd[0].x, ptEnd[0].y);
context_draw.lineJoin = 'bevel';
context_draw.lineCap = 'butt';
context_draw.fillStyle = "#" + makerColor;
context_draw.fill();
context_draw.globalCompositeOperation = 'lighter';
context_draw.closePath();
context_draw.beginPath();
// 左下に描画する場合
context_draw.moveTo(ptStart[0].x, ptStart[0].y);
context_draw.lineTo(ptStart[1].x, ptStart[1].y);
context_draw.lineTo(ptStart[2].x, ptStart[2].y);
context_draw.lineTo(ptEnd[2].x, ptEnd[2].y);
context_draw.lineTo(ptEnd[3].x, ptEnd[3].y);
context_draw.lineTo(ptEnd[0].x, ptEnd[0].y);
context_draw.closePath();
} else {
context_draw.globalCompositeOperation = 'destination-out';
context_draw.moveTo(ptStart[1].x, ptStart[1].y);
context_draw.lineTo(ptStart[2].x, ptStart[2].y);
context_draw.lineTo(ptEnd[3].x, ptEnd[3].y);
context_draw.lineTo(ptEnd[0].x, ptEnd[0].y);
context_draw.lineJoin = 'bevel';
context_draw.lineCap = 'butt';
context_draw.fillStyle = "#" + makerColor;
context_draw.fill();
context_draw.globalCompositeOperation = 'lighter';
context_draw.closePath();
context_draw.beginPath();
// 左に描画する場合
context_draw.moveTo(ptStart[1].x, ptStart[1].y);
context_draw.lineTo(ptStart[2].x, ptStart[2].y);
context_draw.lineTo(ptEnd[3].x, ptEnd[3].y);
context_draw.lineTo(ptEnd[0].x, ptEnd[0].y);
context_draw.closePath();
}
} else if (sx < coors.x) {
if (sy > coors.y) {
context_draw.globalCompositeOperation = 'destination-out';
context_draw.moveTo(ptStart[2].x, ptStart[2].y);
context_draw.lineTo(ptStart[3].x, ptStart[3].y);
context_draw.lineTo(ptStart[0].x, ptStart[0].y);
context_draw.lineTo(ptEnd[0].x, ptEnd[0].y);
context_draw.lineTo(ptEnd[1].x, ptEnd[1].y);
context_draw.lineTo(ptEnd[2].x, ptEnd[2].y);
context_draw.lineJoin = 'bevel';
context_draw.lineCap = 'butt';
context_draw.fillStyle = "#" + makerColor;
context_draw.fill();
context_draw.globalCompositeOperation = 'lighter';
context_draw.closePath();
context_draw.beginPath();
// 右上に描画する場合
context_draw.moveTo(ptStart[2].x, ptStart[2].y);
context_draw.lineTo(ptStart[3].x, ptStart[3].y);
context_draw.lineTo(ptStart[0].x, ptStart[0].y);
context_draw.lineTo(ptEnd[0].x, ptEnd[0].y);
context_draw.lineTo(ptEnd[1].x, ptEnd[1].y);
context_draw.lineTo(ptEnd[2].x, ptEnd[2].y);
context_draw.closePath();
} else if (sy < coors.y) {
context_draw.globalCompositeOperation = 'destination-out';
context_draw.moveTo(ptStart[3].x, ptStart[3].y);
context_draw.lineTo(ptStart[0].x, ptStart[0].y);
context_draw.lineTo(ptStart[1].x, ptStart[1].y);
context_draw.lineTo(ptEnd[1].x, ptEnd[1].y);
context_draw.lineTo(ptEnd[2].x, ptEnd[2].y);
context_draw.lineTo(ptEnd[3].x, ptEnd[3].y);
context_draw.lineJoin = 'bevel';
context_draw.lineCap = 'butt';
context_draw.fillStyle = "#" + makerColor;
context_draw.fill();
context_draw.globalCompositeOperation = 'lighter';
context_draw.closePath();
context_draw.beginPath();
// 右下に描画する場合
context_draw.moveTo(ptStart[3].x, ptStart[3].y);
context_draw.lineTo(ptStart[0].x, ptStart[0].y);
context_draw.lineTo(ptStart[1].x, ptStart[1].y);
context_draw.lineTo(ptEnd[1].x, ptEnd[1].y);
context_draw.lineTo(ptEnd[2].x, ptEnd[2].y);
context_draw.lineTo(ptEnd[3].x, ptEnd[3].y);
context_draw.closePath();
} else {
context_draw.globalCompositeOperation = 'destination-out';
context_draw.moveTo(ptStart[3].x, ptStart[3].y);
context_draw.lineTo(ptStart[0].x, ptStart[0].y);
context_draw.lineTo(ptEnd[1].x, ptEnd[1].y);
context_draw.lineTo(ptEnd[2].x, ptEnd[2].y);
context_draw.lineJoin = 'bevel';
context_draw.lineCap = 'butt';
context_draw.fillStyle = "#" + makerColor;
context_draw.fill();
context_draw.globalCompositeOperation = 'lighter';
context_draw.closePath();
context_draw.beginPath();
// 右に描画する場合
context_draw.moveTo(ptStart[3].x, ptStart[3].y);
context_draw.lineTo(ptStart[0].x, ptStart[0].y);
context_draw.lineTo(ptEnd[1].x, ptEnd[1].y);
context_draw.lineTo(ptEnd[2].x, ptEnd[2].y);
context_draw.closePath();
}
} else {
if (sy > coors.y) {
context_draw.globalCompositeOperation = 'destination-out';
context_draw.moveTo(ptStart[2].x, ptStart[2].y);
context_draw.lineTo(ptStart[3].x, ptStart[3].y);
context_draw.lineTo(ptEnd[0].x, ptEnd[0].y);
context_draw.lineTo(ptEnd[1].x, ptEnd[1].y);
context_draw.lineJoin = 'bevel';
context_draw.lineCap = 'butt';
context_draw.fillStyle = "#" + makerColor;
context_draw.fill();
context_draw.globalCompositeOperation = 'lighter';
context_draw.closePath();
context_draw.beginPath();
// 上に描画する場合
context_draw.moveTo(ptStart[2].x, ptStart[2].y);
context_draw.lineTo(ptStart[3].x, ptStart[3].y);
context_draw.lineTo(ptEnd[0].x, ptEnd[0].y);
context_draw.lineTo(ptEnd[1].x, ptEnd[1].y);
context_draw.closePath();
} else if (sy < coors.y) {
context_draw.globalCompositeOperation = 'destination-out';
context_draw.moveTo(ptStart[0].x, ptStart[0].y);
context_draw.lineTo(ptStart[1].x, ptStart[1].y);
context_draw.lineTo(ptEnd[2].x, ptEnd[2].y);
context_draw.lineTo(ptEnd[3].x, ptEnd[3].y);
context_draw.lineJoin = 'bevel';
context_draw.lineCap = 'butt';
context_draw.fillStyle = "#" + makerColor;
context_draw.fill();
context_draw.globalCompositeOperation = 'lighter';
context_draw.closePath();
context_draw.beginPath();
// 下に描画する場合
context_draw.moveTo(ptStart[0].x, ptStart[0].y);
context_draw.lineTo(ptStart[1].x, ptStart[1].y);
context_draw.lineTo(ptEnd[2].x, ptEnd[2].y);
context_draw.lineTo(ptEnd[3].x, ptEnd[3].y);
context_draw.closePath();
} else {
context_draw.globalCompositeOperation = 'destination-out';
context_draw.moveTo(ptStart[0].x, ptStart[0].y);
context_draw.lineTo(ptStart[1].x, ptStart[1].y);
context_draw.lineTo(ptStart[2].x, ptStart[2].y);
context_draw.lineTo(ptStart[3].x, ptStart[3].y);
context_draw.lineJoin = 'bevel';
context_draw.lineCap = 'butt';
context_draw.fillStyle = "#" + makerColor;
context_draw.fill();
context_draw.globalCompositeOperation = 'lighter';
context_draw.closePath();
context_draw.beginPath();
// 移動なしの場合
context_draw.moveTo(ptStart[0].x, ptStart[0].y);
context_draw.lineTo(ptStart[1].x, ptStart[1].y);
context_draw.lineTo(ptStart[2].x, ptStart[2].y);
context_draw.lineTo(ptStart[3].x, ptStart[3].y);
context_draw.closePath();
}
}
context_draw.lineJoin = 'bevel';
context_draw.lineCap = 'butt';
context_draw.globalAlpha = 0.4; // Opacity 20%
context_draw.fillStyle = "#" + makerColor;
context_draw.fill();
context_draw.globalAlpha = 1; // Opacity 100%
}
/*
* 描画モードを戻す
*/
context_draw.globalCompositeOperation = 'source-over';
// 終点を保存
sx = coors.x;
sy = coors.y;
}
};
function drawPoint(coors, context_draw) {
/* set value sx,sy */
sx = coors.x;
sy = coors.y;
if (isAddingMarking == true) {
/* begin draw*/
isClearDrawing = false;
if (markingType == 'eraser') {
context_draw.globalCompositeOperation = 'destination-out';
context_draw.lineWidth = eraseSize;
context_draw.lineJoin = 'round';
context_draw.lineCap = 'round';
context_draw.lineTo(coors.x + 0.001, coors.y + 0.001);
context_draw.stroke();
context_draw.globalCompositeOperation = 'source-over';
}
else if (markingType == 'pen') {
/* set flag */
isDrawing = true;
context_draw.lineCap = "round";
context_draw.lineWidth = penSize;
context_draw.strokeStyle = "#" + penColor;
context_draw.lineTo(coors.x + 0.001, coors.y + 0.001);
context_draw.stroke();
}
else if (markingType == 'maker') {
/* set flag */
isDrawing = true;
context_draw.globalCompositeOperation = 'destination-out';
context_draw.lineWidth = makerSize ;
context_draw.lineHeight = makerSize;
context_draw.lineTo(coors.x , coors.y + 0.001);
context_draw.lineCap = 'square';
context_draw.strokeStyle = "#" + makerColor;
context_draw.stroke();
context_draw.globalCompositeOperation = 'lighter';
context_draw.lineCap = "square";
context_draw.lineWidth = makerSize;
context_draw.lineHeight = makerSize;
context_draw.globalAlpha = 0.4;
context_draw.strokeStyle = "#" + makerColor;
context_draw.lineTo(coors.x, coors.y + 0.001);
context_draw.stroke();
context_draw.globalAlpha = 1;
}
}
};
\ No newline at end of file
/// ===============================================================================================
/// Pen group [start]
/// ===============================================================================================
var Pen_colorSource = [];
Pen_colorSource.push('ffffff', 'ffccc9', 'ffce93',
'fffc9e','ffffc7','9aff99','96fffb','cdffff',
'cbcefb','cfcfcf','fd6864','fe996b','fffe65',
'fcff2f','67fd9a','38fff8','68fdff','9698ed',
'c0c0c0','fe0000','f8a102','ffcc67','f8ff00',
'34ff34','68cbd0','34cdf9','6665cd','9b9b9b',
'cb0000','f56b00','ffcb2f','ffc702','32cb00',
'00d2cb','3166ff','6434fc','656565','9a0000',
'ce6301','cd9934','999903','009901','329a9d',
'3531ff','6200c9','343434','680100','963400',
'986536','646809','036400','34696d','00009b',
'303498','000000','330001','643403','663234',
'343300','013300','003532','010066','340096');
var pen_Size;
var pen_Color;
var pen_targetDiv;
var pen_chooseColor;
function ShowPen(targetId) {
pen_targetDiv = targetId;
pen_targetDiv.children().remove();
targetId.append(
'<div id="panel-pen" class="rayermenu1">'
+' <div id="panel-pen-size">'
+' <span lang="txtMkgSize" class="lang" >太いさ</span>'
+ ' <input type="radio" id="pen-size-small" name="pen-size" /><label for="pen-size-small" id="pen-small-text" class="lang" lang="txtMkgS">S</label>'
+ ' <input type="radio" id="pen-size-medium" name="pen-size" /><label for="pen-size-medium" id="pen-medium-text" class="lang" lang="txtMkgM">M</label>'
+ ' <input type="radio" id="pen-size-large" name="pen-size" /><label for="pen-size-large" id="pen-large-text" class="lang" lang="txtMkgB">L</label>'
+ ' <input type="radio" id="pen-size-oversize" name="pen-size" /><label for="pen-size-oversize" id="pen-oversize-text" class="lang" lang="txtMkgSB">XL</label>'
+' </div>'
+' <span class="lang" lang="txtColor" style="float:left;margin-right: 10px;">Color</span>'
+' <div id="penColorPreview"></div>'
+' <div id="penColorwrapper"></div>'
+' <div class="canvasArea_s" style="width: 120px; height: 120px">'
+' <canvas id="Pen_cvPreviewPen" class="preview" width="120px" height="120px"></canvas>'
+' </div>'
+' <div style="clear:both; padding-top:10px">'
+' <a id="Pen_btnCancel" class="lang cancelbtn" style="float:right;" lang="dspCancel">Cancel</a>'
+' <a id="Pen_btnOk" class="lang cancelbtn" style="float:right; clear: none; margin-right:10px" lang="dspOK">OK</a>'
+' </div>'
+'<div>'
);
var colorWrapper = $('#penColorwrapper');
$.each(Pen_colorSource, function (i, pen_Color) {
colorWrapper.append('<div class="colorpicker" colorId="' + pen_Color + '" style="background-color: #' + pen_Color + ';"></div>');
});
//changeLanguage(ClientData.userInfo_language());
i18nReplaceText();
// pen_targetDiv.dialog({ width: 510, height: 390, modal: true });
// pen_targetDiv.fadeIn('medium',function(){
// //lockLayout();
// pen_targetDiv.draggable({ containment: "#containment-wrapper", scroll: false });
// }); pen_targetDiv.show();
//pen_targetDiv.draggable({ containment: "#Pen_btnOk", scroll: false });
pen_targetDiv.draggable({ revert: false});
Pen_handleColorPickerEvent();
$('#dlgPen').center();
};
function touchStart_BtnOk_Pen(e){
e.preventDefault();
pen_targetDiv.draggable("destroy");
Pen_dspOK_click();
};
function touchStart_BtnCancel_Pen(e){
e.preventDefault();
pen_targetDiv.draggable("destroy");
Pen_dspCancel_click();
};
function Pen_handleColorPickerEvent() {
//$('.colorpicker').live('mouseenter', Pen_colorPickerMouseEnterFunction);
// $('.colorpicker').live('mouseleave', Pen_colorPickerMouseLeaveFunction);
// $('#penColorwrapper').live('mouseleave', Pen_colorWrapperMouseLeaveFunction);
if(avwUserEnvObj.os == "ipad" || avwUserEnvObj.os == "android"){
$('.colorpicker').unbind('mouseenter');
$('.colorpicker').unbind('mouseleave');
$('#penColorwrapper').unbind('mouseleave');
document.getElementById('Pen_btnOk').addEventListener('touchstart',touchStart_BtnOk_Pen,false);
document.getElementById('Pen_btnCancel').addEventListener('touchstart',touchStart_BtnCancel_Pen,false);
}
else{
$('.colorpicker').unbind('mouseenter');
$('.colorpicker').unbind('mouseleave');
$('#penColorwrapper').unbind('mouseleave');
$('.colorpicker').bind('mouseenter', Pen_colorPickerMouseEnterFunction);
$('.colorpicker').bind('mouseleave', Pen_colorPickerMouseLeaveFunction);
$('#penColorwrapper').bind('mouseleave', Pen_colorWrapperMouseLeaveFunction);
}
$('#Pen_btnOk').live('click', Pen_dspOK_click);
$('#Pen_btnCancel').live('click', Pen_dspCancel_click);
Pen_SetDefaultValue();
$('#pen-size-small').live('click', Pen_rdo1_click);
$('#pen-size-medium').live('click', Pen_rdo2_click);
$('#pen-size-large').live('click', Pen_rdo3_click);
$('#pen-size-oversize').live('click', Pen_rdo4_click);
$('#pen-small-text').live('click', penSmallTextClick);
$('#pen-medium-text').live('click', penMediumTextClick);
$('#pen-large-text').live('click', penLargeTextClick);
$('#pen-oversize-text').live('click', penOversizeTextClick);
$('.colorpicker').live('click', Pen_colorPickerClickFunction);
//$('#penColorwrapper').live('mouseleave', Pen_colorWrapperMouseLeaveFunction);
$("#avw-sys-modal").click (function () {
// pen_targetDiv.fadeOut('medium',function(){
// //unlockLayout();
// }); pen_targetDiv.show();
});
};
function penSmallTextClick(){
$('#pen-size-small').attr('checked','checked');
$('#pen-size-medium').removeAttr('checked');
$('#pen-size-large').removeAttr('checked');
$('#pen-size-oversize').removeAttr('checked');
Pen_rdo1_click();
};
function penMediumTextClick(){
$('#pen-size-small').removeAttr('checked');
$('#pen-size-medium').attr('checked','checked');
$('#pen-size-large').removeAttr('checked');
$('#pen-size-oversize').removeAttr('checked');
Pen_rdo2_click();
};
function penLargeTextClick(){
$('#pen-size-small').removeAttr('checked');
$('#pen-size-medium').removeAttr('checked');
$('#pen-size-large').attr('checked','checked');
$('#pen-size-oversize').removeAttr('checked');
Pen_rdo3_click();
};
function penOversizeTextClick(){
$('#pen-size-small').removeAttr('checked');
$('#pen-size-medium').removeAttr('checked');
$('#pen-size-large').removeAttr('checked');
$('#pen-size-oversize').attr('checked','checked');
Pen_rdo4_click();
};
// Choose type of eraser, and draw to canvas
function Pen_chooseType(typeValue, color) {
var fillColor;
pen_Size = typeValue;
var canvas = document.getElementById('Pen_cvPreviewPen');
if (color == null || color == 'undefined') {
fillColor="#fe0000";
}
else{
fillColor = '#' + color;
}
if (canvas.getContext) {
// use getContext to use the canvas for drawing
var ctx = canvas.getContext('2d');
// Draw shapes
//ctx.fillStyle = "#888888";
//ctx.fillRect(0, 0, canvas.width, canvas.height);
ctx.clearRect(0, 0, canvas.width, canvas.height);
ctx.beginPath();
//ctx.arc(60, 60, typeValue, 0, Math.PI * 2, true); // Outer circle
ctx.arc(canvas.width/2, canvas.height/2, typeValue, 0, 2 * Math.PI, true);
ctx.fillStyle = fillColor;
ctx.strokeStyle = fillColor;
ctx.fill();
ctx.stroke();
}
};
// Set default value for Pen.
function Pen_SetDefaultValue() {
var typeValue = undefined;
var penColor = ClientData.penOpt_color();
typeValue = ClientData.penOpt_size();
pen_Size = typeValue;
if(penColor != null || penColor != undefined){
pen_chooseColor = penColor;
}
else{
pen_chooseColor = 'fe0000';
penColor = 'fe0000';
}
if (typeValue == 5) {
$("#pen-size-small").attr('checked', 'checked');
$("#pen-size-small").focus();
}
else if (typeValue == 12.5) {
$("#pen-size-medium").attr('checked', 'checked');
$("#pen-size-medium").focus();
}
else if (typeValue == 25) {
$("#pen-size-large").attr('checked', 'checked');
$("#pen-size-large").focus();
}
else if (typeValue == 50) {
$("#pen-size-oversize").attr('checked', 'checked');
$("#pen-size-oversize").focus();
}
else {
typeValue = 5;
$("#pen-size-small").attr('checked', 'checked');
$("#pen-size-small").focus();
}
Pen_chooseType(typeValue, penColor);
$('.colorpicker[colorId="'+penColor+'"]').css('border','1px solid black');
$('#penColorPreview').css('background-color', '#'+penColor);
$('#penColorPreview').css('border-color', '#'+penColor);
};
function Pen_colorPickerMouseLeaveFunction() {
$(this).css('border','1px solid white');
$('.colorpicker[colorId="' + pen_chooseColor + '"]').css('border', '1px solid black');
};
function Pen_colorPickerMouseEnterFunction() {
$(this).css('border','1px solid black');
var color = $(this).attr('colorId');
Pen_chooseType(pen_Size, color);
$('#penColorPreview').css('background-color','#'+color);
$('#penColorPreview').css('border-color','#'+color);
};
function Pen_colorPickerClickFunction() {
$('.colorpicker[colorId="' + pen_chooseColor + '"]').css('border', '1px solid white');
$(this).css('border','1px solid black');
pen_chooseColor = $(this).attr('colorId');
Pen_chooseType(pen_Size, pen_chooseColor);
$('#penColorPreview').css('background-color','#'+pen_chooseColor);
$('#penColorPreview').css('border-color','#'+pen_chooseColor);
};
function Pen_rdo1_click() {
Pen_chooseType(5, pen_chooseColor);
};
function Pen_rdo2_click() {
Pen_chooseType(12.5, pen_chooseColor);
};
function Pen_rdo3_click() {
Pen_chooseType(25, pen_chooseColor);
};
function Pen_rdo4_click() {
Pen_chooseType(50, pen_chooseColor);
};
// Event of button OK
function Pen_dspOK_click() {
// Set selected value to local storage
var typeValue = undefined;
if ($("#pen-size-small").attr('checked') == 'checked') {
typeValue = 5;
}
else if ($("#pen-size-medium").attr('checked') == 'checked') {
typeValue = 12.5;
}
else if ($("#pen-size-large").attr('checked') == 'checked') {
typeValue = 25;
}
else if ($("#pen-size-oversize").attr('checked') == 'checked') {
typeValue = 50;
}
// Set value to local
ClientData.penOpt_size(typeValue);
ClientData.penOpt_color(pen_chooseColor);
pen_Size = typeValue;
//c = pen_chooseColor;
/*enable button */
enableButtonMarking();
ClientData.IsAddingMarking(true);
isAddingMarking = ClientData.IsAddingMarking();
penSize = ClientData.penOpt_size();
penColor = ClientData.penOpt_color();
// Close dialog
//pen_targetDiv.dialog('close');
/*pen_targetDiv.fadeOut('medium',function(){
$("#avw-sys-modal").hide();
});*/
pen_targetDiv.hide();
/* unlock dialog overlay */
$("#overlay").hide();
$('#dlgMarking_imgPenOption').removeClass();
$('#dlgMarking_imgPenOption').addClass('pen_option_hover');
};
// Event of button cancel
function Pen_dspCancel_click() {
/*enable button */
enableButtonMarking();
ClientData.IsAddingMarking(true);
isAddingMarking = ClientData.IsAddingMarking();
// Close dialog
/*pen_targetDiv.fadeOut('slow',function(){
//unlockLayout();
});*/
pen_targetDiv.hide();
/* unlock dialog overlay */
$("#overlay").hide();
$('#dlgMarking_imgPenOption').removeClass();
$('#dlgMarking_imgPenOption').addClass('pen_option_hover');
};
function Pen_colorWrapperMouseLeaveFunction() {
Pen_chooseType(pen_Size, pen_chooseColor);
$('#penColorPreview').css('background-color', '#' + pen_chooseColor);
$('#penColorPreview').css('border-color', '#' + pen_chooseColor);
$('.colorpicker[colorId="' + pen_chooseColor + '"]').css('border', '1px solid black');
};
var popuptext_dialogDiv;
var popuptext_arrowDiv;
///ShowDialog
///direction: arrow value: 0: top right
/// 1: bottom right
/// 2: top left
/// 3: bottom left
function OpenPopupText(posX, posY, content, dialogDiv, arrowDiv) {
popuptext_dialogDiv = dialogDiv;
popuptext_arrowDiv = arrowDiv;
var direction = 2;
var left_arrow; // left of arrow div (px)
var top_arrow; // topof arrow div (px)
var left_dialog; // left of dialog div (px)
var top_dialog; // topof dialog div (px)
dialogDiv.fadeIn(300);
arrowDiv.fadeIn(300);
arrowDiv.css("left", (posX - 14) + "px");
arrowDiv.css("top", (posY - 14) + "px");
dialogDiv.html(content);
left_arrow = arrowDiv.position().left;
top_arrow = arrowDiv.position().top;
// Ajust direction [start]
var w = dialogDiv.outerWidth() + 20;
var h = dialogDiv.height();
if ((posX - $(window).scrollLeft()) < w) {
if (($(window).scrollTop() + $(window).height() - posY) < h) {
direction = 3;
}
else {
direction = 2;
}
}
else {
//$("#txtSubject").val($(window).scrollTop()+$(window).height() - posY);
$("#txtSubject").val(h);
if (($(window).scrollTop() + $(window).height() - posY) < h) {
direction = 1;
}
else {
direction = 0;
}
}
// Ajust direction [ end ]
switch (direction) {
case 0: left_dialog = left_arrow - dialogDiv.outerWidth();
top_dialog = top_arrow - 20;
arrowDiv.css("border-color", "transparent transparent transparent #ccd");
dialogDiv.css("-moz-box-shadow", "-3px 3px 3px #777");
dialogDiv.css("-webkit-box-shadow", "-3px 3px 3px #777");
dialogDiv.css("box-shadow", "-3px 3px 3px #777");
break;
case 1: left_dialog = left_arrow - dialogDiv.outerWidth();
top_dialog = top_arrow - dialogDiv.height() + 30;
arrowDiv.css("border-color", "transparent transparent transparent #ccd");
dialogDiv.css("-moz-box-shadow", "-3px 3px 3px #777");
dialogDiv.css("-webkit-box-shadow", "-3px 3px 3px #777");
dialogDiv.css("box-shadow", "-3px 3px 3px #777");
break;
case 2: left_dialog = left_arrow + 24;
top_dialog = top_arrow - 20;
arrowDiv.css("border-color", "transparent #ccd transparent transparent");
dialogDiv.css("-moz-box-shadow", "3px 3px 3px #777");
dialogDiv.css("-webkit-box-shadow", "3px 3px 3px #777");
dialogDiv.css("box-shadow", "3px 3px 3px #777");
break;
case 3: left_dialog = left_arrow + 24;
top_dialog = top_arrow - dialogDiv.height() + 30;
arrowDiv.css("border-color", "transparent #ccd transparent transparent");
dialogDiv.css("-moz-box-shadow", "3px 3px 3px #777");
dialogDiv.css("-webkit-box-shadow", "3px 3px 3px #777");
dialogDiv.css("box-shadow", "3px 3px 3px #777");
break;
}
dialogDiv.css("left", left_dialog + "px");
dialogDiv.css("top", (top_dialog + 10) + "px");
};
/*
Close popup text
*/
function ClosePopupText() {
if (popuptext_dialogDiv) {
$(popuptext_dialogDiv).fadeOut(300);
}
if (popuptext_arrowDiv) {
$(popuptext_arrowDiv).fadeOut(300);
}
};
/*
Open default system email to send
*/
function MailTo(email, subject) {
window.open("mailto:" + email + "?subject=" + subject, '_self');
};
\ No newline at end of file
/// コンテンツ詳細画面
/// <reference path="../common/js/avweb.js" />
/// <reference path="../common/js/screenLock.js" />
/// <reference path="../common/js/common.js" />
/// <reference path="../common/js/i18n.js" />
/// <reference path="../common/js/jquery-1.8.1.min.js" />
/// <reference path="../common/js/jquery-ui-1.8.23.custom.min.js" />
/// <reference path="../common/js/jquery.toastmessage.js" />
/// <reference path="../common/js/pageViewer.js" />
/// <reference path="init.js" />
/// <reference path="home.js" />
var displayData = {
contentID: "",
contentTitle: "",
contentDetail: "",
contentThumbnail: "",
deliveryDate: (new Date()),
pages: []
};
// Init function of page
$(document).ready(function () {
//alert(ClientData.contentInfo_contentId());
//if (!avwCheckLogin(ScreenIds.Login)) return;
//openContentDetail();
});
// Show content detail
function openContentDetail() {
displayData = {
contentID: "",
contentTitle: "",
contentDetail: "",
contentThumbnail: "",
deliveryDate: (new Date()),
pages: []
};
// Clear childs
$('#book_list').html('');
// Clear display info
$("#imgContentThumbnail").css('padding-top', "60px");
$("#imgContentThumbnail").attr('src', "img/data_loading.gif");
resetLoadingImageSize();
$("#txtContentTitle").text('');
$("#txtPubDt2_Dsp").text('');
$("#txtContentDetail").text('');
$("#contentDetailClose").click(contentDetailClose_Click);
//$("#contentdetail_dspBack").click(contentdetail_dspBack_Click);
$("#contentdetail_dspRead").click(contentdetail_dspRead_Click);
lockLayout();
$("#contentDetail").css('z-index', 101);
$("#sectionContentDetail").show();
$("#contentDetail").show();
$("#contentDetail").center();
if ($("#contentDetail").height() > $(window).height()){
$("#contentDetail").css('top', '0');
}
// Get contentid, thumbnail from list screen
displayData.contentID = ClientData.contentInfo_contentId();
displayData.contentThumbnail = ClientData.contentInfo_contentThumbnail();
// Get content detail
avwCmsApi(ClientData.userInfo_accountPath(), "webGetContent", "GET", { contentId: displayData.contentID, sid: ClientData.userInfo_sid(), getType: 1 },
function (data) {
// Get content detail
displayData.contentTitle = data.contentData.contentName;
displayData.contentDetail = data.contentData.contentDetail;
displayData.deliveryDate = convertToDate(data.contentData.deliveryStartDate);
// Get pages
avwCmsApiSync(ClientData.userInfo_accountPath(), "webContentPage", "GET", { contentId: ClientData.contentInfo_contentId(), sid: ClientData.userInfo_sid(), thumbnailFlg: 1, pageNos: '1,2,3,4,5,6'},
function (data) {
// Get pages
for (var nIndex = 0; nIndex < data.pages.length; nIndex++) {
if (nIndex < 6) {
displayData.pages.push({ pageNo: data.pages[nIndex].pageNo, pageText: data.pages[nIndex].pageText, pageThumbnail: ("data:image/jpeg;base64," + data.pages[nIndex].pageThumbnail) });
}
}
// Show to screen
ShowContent(displayData.contentID, truncate(displayData.contentTitle, 20), displayData.contentDetail, ClientData.contentInfo_contentThumbnail(), displayData.deliveryDate, displayData.pages);
},
null
);
},
null
);
};
// Close content detail
function contentDetailClose_Click(e) {
e.preventDefault();
unlockLayout();
$("#contentDetail").hide();
$("#sectionContentDetail").hide();
};
/*
----------------------------------------------------------------------------
Event groups [start]
----------------------------------------------------------------------------
*/
function contentdetail_dspRead_Click(e) {
e.preventDefault();
var outputId = ClientData.contentInfo_contentId();
var date = new Date();
var month = date.getMonth()+1;
var day = date.getDate();
var outputDate = formatNormalDate(day, month, date.getFullYear());
var contentIdArray = [];
var checkflag = false;
//Store Content id that user has read
if(ClientData.ReadingContentIds().length > 0){
contentIdArray = ClientData.ReadingContentIds();
for(var nIndex = 0; nIndex < contentIdArray.length; nIndex++){
if(contentIdArray[nIndex].contentid == outputId){
checkflag = true;
if(contentIdArray[nIndex].viewdate == '' || contentIdArray[nIndex].viewdate == null || contentIdArray[nIndex].viewdate == 'undefined'){
contentIdArray[nIndex].viewdate = outputDate;
contentIdArray[nIndex].originviewdate = date;
}
break;
}
else{
checkflag = false;
}
}
if(!checkflag){
contentIdArray.push({contentid: outputId, viewdate: outputDate, originviewdate: date});
}
}
else{
contentIdArray.push({contentid: outputId, viewdate: outputDate, originviewdate: date});
}
//Renew ReadingContentID
var newArray = [];
ClientData.ReadingContentIds(newArray);
//Set data for readingcontentid
ClientData.ReadingContentIds(contentIdArray);
//Set ResouceVersion for content
setResourceVersionData(outputId);
//Set MetaVersion for content
setMetaVersionData(outputId);
// Redirect to screen: contentview
//$('body,html').animate({ scrollTop: 0 }, 0);
ClientData.IsRefresh(false);
avwScreenMove(ScreenIds.ContentView);
};
// Show detail content
function ShowContent(contentID, contentTitle, contentDetail, contentThumbnail, deliveryDate, pages) {
$("#txtPubDt2_Dsp").text(deliveryDate.jpDateString() + " " + deliveryDate.jpShortTimeString());
$("#txtContentDetail").text(contentDetail);
$("#txtContentTitle").text(contentTitle);
$("#imgContentThumbnail").attr("src", contentThumbnail);
var imgTemp = new Image();
imgTemp.onload = function () {
//resize Image
if (imgTemp.width > imgTemp.height) {
$("#imgContentThumbnail").attr('height', '');
$("#imgContentThumbnail").removeAttr('height');
$("#imgContentThumbnail").attr('width', '120');
var realHeight = (120 * imgTemp.height) / imgTemp.width;
$("#imgContentThumbnail").css('padding-top', (145 - realHeight)/2 + "px");
}
else {
$("#imgContentThumbnail").attr('width', '');
$("#imgContentThumbnail").removeAttr('width');
$("#imgContentThumbnail").attr('height', '120');
$("#imgContentThumbnail").css('padding-top', "12px");
}
};
imgTemp.src = contentThumbnail;
//resizeThumbnailContentDetail(contentThumbnail, 120, 160);
// Show pages
for (var nIndex = 0; nIndex < pages.length; nIndex++) {
//insertRow(imgSample, pages[nIndex].pageText, pages[nIndex].pageNo);
insertRow(pages[nIndex].pageThumbnail, truncate(getLines(pages[nIndex].pageText, 3), 55), pages[nIndex].pageNo);
}
};
function insertRow(pageThumbnail, pageText, pageNo) {
var newRow = "";
newRow += "<ul>";
newRow += '<li class="list_img"><img src="' + pageThumbnail + '" alt="" width="90" /></li>';
newRow += '<li class="list_title"><label>' + htmlEncode(pageText) + '</label></li>';
newRow += '<li class="page"><label id="Label2" class="lang" lang="txtPage">' + i18nText('txtPage') + '</label>' + pageNo + '</li>';
newRow += "</ul>";
$('#book_list').append(newRow);
i18nReplaceText();
//Resize Image
var imgTemp = new Image();
imgTemp.onload = function(){
if(imgTemp.width > imgTemp.height) {
$("li.list_img img").attr('height', '');
$("li.list_img img").removeAttr('height');
$("li.list_img img").attr('width', '90');
}
else {
$("li.list_img img").attr('width', '');
$("li.list_img img").removeAttr('width');
$("li.list_img img").attr('height', '90');
}
};
imgTemp.src = pageThumbnail;
};
function insertRow1(pageThumbnail, pageText, pageNo) {
var newRow = "";
newRow += "<tr>";
newRow += "<td id='left'>";
newRow += '<img src="' + pageThumbnail;
newRow += '" id="imgPageThumbnail" alt="" width="50" height="50"/>';
newRow += "</td>";
newRow += "<td>";
newRow += '<div><label id="Label1">' + pageText + '</label></div>';
newRow += '<div><label id="Label2" class="lang" lang="txtPage">ページ:</label><label id="Label3">' + pageNo + '</label></div>';
newRow += "</td>";
newRow += "</tr>";
$('#contentdetail_grid tr:last').after(newRow);
//changeLanguage(ClientData.userInfo_language());
i18nReplaceText();
};
//set resource version data
function setResourceVersionData(conId){
var tempResourceArr;
var tempResource;
//check if insert new or edit
var flag = false;
if(ClientData.ResourceVersion().length <= 0 || ClientData.ResourceVersion() == null || ClientData.ResourceVersion() == 'undefined'){
tempResourceArr = [];
}
else{
tempResourceArr = ClientData.ResourceVersion();
}
for(var i = 0; i < resourceVersionArr.length; i++){
if(resourceVersionArr[i].contentid == conId){
tempResource = resourceVersionArr[i].resourceversion;
break;
}
}
if(tempResourceArr.length > 0){
for(var j = 0; j < tempResourceArr.length; j++){
if(tempResourceArr[j].contentid == conId){
tempResourceArr[j].resourceversion = tempResource;
flag = true;
break;
}
else{
flag = false;
}
}
if(!flag){
tempResourceArr.push({contentid: conId, resourceversion: tempResource});
}
}else{
tempResourceArr.push({contentid: conId, resourceversion: tempResource});
}
ClientData.ResourceVersion(tempResourceArr);
};
//set meta Version Data
function setMetaVersionData(conId){
var tempMetaArr;
var tempMeta;
//check if insert new or edit
var flag = false;
if(ClientData.MetaVersion().length <= 0 || ClientData.MetaVersion() == null || ClientData.MetaVersion() == 'undefined'){
tempMetaArr = [];
}
else{
tempMetaArr = ClientData.MetaVersion();
}
for(var i = 0; i < metaVersionArr.length; i++){
if(metaVersionArr[i].contentid == conId){
tempMeta = metaVersionArr[i].metaversion;
break;
}
}
if(tempMetaArr.length > 0){
for(var j = 0; j < tempMetaArr.length; j++){
if(tempMetaArr[j].contentid == conId){
tempMetaArr[j].metaversion = tempMeta;
flag = true;
break;
}
else{
flag = false;
}
}
if(!flag){
tempMetaArr.push({contentid: conId, metaversion: tempMeta});
}
}else{
tempMetaArr.push({contentid: conId, metaversion: tempMeta});
}
ClientData.MetaVersion(tempMetaArr);
};
function formatNormalDate(day, month, year) {
var outputDate = year + '/' + (('' + month).length < 2 ? '0' : '') + month + '/' + (('' + day).length < 2 ? '0' : '') + day;
return outputDate;
};
//function contentdetail_dspBack_Click() {
//parent.history.back();
//$(this).parent().parent().parent().parent().parent().parent().parent().hide();
//$(this).parent().parent().parent().parent().parent().parent().parent().dialog('close');
//}
/*
----------------------------------------------------------------------------
Event groups [ end ]
----------------------------------------------------------------------------
*/
/*
----------------------------------------------------------------------------
Setting dialog [start]
----------------------------------------------------------------------------
*/
$(function () {
});
/*
----------------------------------------------------------------------------
Setting dialog [ end ]
----------------------------------------------------------------------------
*/
function truncate(strInput, length){
if (strInput.length <= length)
{
return strInput;
}
else
{
return strInput.substring(0, length) + "...";
}
};
function resetLoadingImageSize(){
$("#imgContentThumbnail").attr('height','25px');
$("#imgContentThumbnail").attr('width','25px');
};
/// <reference path="../common/js/avweb.js" />
/// <reference path="../common/js/common.js" />
/// <reference path="../common/js/i18n.js" />
/// <reference path="../common/js/jquery-1.8.1.min.js" />
/// <reference path="../common/js/jquery-ui-1.8.23.custom.min.js" />
/// <reference path="../common/js/jquery.toastmessage.js" />
var isHoverOn = false;
$(document).ready(function () {
if (!avwCheckLogin(ScreenIds.Login)) return;
// Set event to prevent leave
//avwSetLogoutNortice();
if(ClientData.requirePasswordChange() != 1 ) {
ToogleLogoutNortice();
}
//Toggle Searchbox
$('input#searchbox-key').click(toggleSearchPanel);
$("#searchbox-key").attr('placeholder', i18nText('msgPlaceHolder'));
//Go to Search Page
$('#searchbox-search').click(searchHeaderButtonFunction);
//Change Language JP
$('#language-jp').click(changeLanguageJa);
//Change Language KR
$('#language-kr').click(changeLanguageKo);
//Change Language EN
$('#language-en').click(changeLanguageEn);
//Go To Bookmark Page
$('#dspShiori').click(bookmarkFunction);
//Go To update configuration
$('#dspSetting').click(updateConfigFunction);
//Go To Login Page
$('#dspLogout').click(logoutFunction);
$('#dspViewHistory').click(historyClickFunction);
$('#dspHome').click(homeClickFunction);
//Hide search panel until click on text field
$('div#header-searchbox').css('display', 'none');
//Display user name
$('#login-username').text(ClientData.userInfo_userName());
$('#dlgConfirmBackup-backup').click(confirmWithBackupFunction);
$('#dlgConfirmBackup-withoutbackup').click(confirmWithoutBackupFunction);
$('#dlgConfirmBackup1').hide();
$('#searchbox-key').keydown(headerSearchKeyDownEventFunction);
$('#searchbox-content-header').click(headerSearchContentClickFunction);
$('#searchbox-tag-header').click(headerSearchTagClickFunction);
$('#searchbox-body-header').click(headerSearchBodyClickFunction);
//$('*').click(handleHeaderSearchBoxEvent);
if (isTouchDevice() == false) {
$('#searchbox-key').hover(searchBoxHoverFunction, searchBoxHoverOffFunction);
$('#header-searchbox').hover(searchBoxHoverFunction, searchBoxHoverOffFunction);
}
if (isTouchDevice() == true) {
var bodyTag = document.getElementsByTagName('body')[0];
bodyTag.addEventListener('touchstart', bodyClickFunction, false);
}
else {
$('body').click(bodyClickFunction);
}
});
function searchBoxHoverFunction(){
isHoverOn = true;
};
function searchBoxHoverOffFunction() {
isHoverOn = false;
};
function bodyClickFunction(event) {
if (isTouchDevice()) {
// Check mouse is in rectangle of searching panel
if ($('#header-searchbox').css('display') != "none") {
var currPosX, currPosY;
var avwUserEnvObj = new UserEnvironment();
if (avwUserEnvObj.os == 'android') {
//$("#searchbox-key").val(event.targetTouches[0].pageX + "_" + $('#header-searchbox').position().left + ":" + ($('#header-searchbox').position().left + $('#header-searchbox').width()));
currPosX = event.targetTouches[0].pageX;
currPosY = event.targetTouches[0].pageY;
}
else {
currPosX = event.targetTouches[0].clientX;
currPosY = event.targetTouches[0].clientY;
}
if (currPosX >= $('#header-searchbox').position().left
&& currPosX <= ($('#header-searchbox').position().left + $('#header-searchbox').width())
&& currPosY >= $('#header-searchbox').position().top
&& currPosY <= ($('#header-searchbox').position().top + $('#header-searchbox').height())) {
isHoverOn = true;
}
else {
isHoverOn = false;
$('#header-searchbox').hide();
}
}
}
else {
if (!isHoverOn) {
$('#header-searchbox').hide();
}
}
};
function headerSearchBodyClickFunction() {
$('#searchbox-body').attr('checked','checked');
$('#searchbox-tag').removeAttr('checked');
$('#searchbox-content').removeAttr('checked');
isHoverOn = true;
};
function headerSearchTagClickFunction() {
$('#searchbox-tag').attr('checked','checked');
$('#searchbox-body').removeAttr('checked');
$('#searchbox-content').removeAttr('checked');
isHoverOn = true;
};
function headerSearchContentClickFunction() {
$('#searchbox-content').attr('checked','checked');
$('#searchbox-tag').removeAttr('checked');
$('#searchbox-body').removeAttr('checked');
isHoverOn = true;
};
//function header search box key down function
function headerSearchKeyDownEventFunction(e){
var code = (e.keyCode ? e.keyCode : e.which);
if(code == 13) { //Enter keycode
$('#searchbox-search').click();
}
isHoverOn = true;
};
//Toggle Search Panel Click function
function toggleSearchPanel(){
if ($("div#header-searchbox").is(":hidden")) {
$('div#header-searchbox').slideDown('slow');
} else {
$('div#header-searchbox').hide();
}
};
//Button Search Event function
function searchHeaderButtonFunction(){
var content = $('#searchbox-content').attr('checked');
var tag = $('#searchbox-tag').attr('checked');
var body = $('#searchbox-body').attr('checked');
var searchDivision;
var searchText = $('#searchbox-key').val();
if(content == 'checked')
{
searchDivision = $('#searchbox-content').val();
}
if(tag == 'checked')
{
searchDivision = $('#searchbox-tag').val();
}
if(body == 'checked')
{
searchDivision = $('#searchbox-body').val();
}
ClientData.searchCond_searchText(searchText);
ClientData.searchCond_searchDivision(searchDivision);
//window.location = ScreenIds.ContentSearch;
avwScreenMove(ScreenIds.ContentSearch);
};
function homeClickFunction(){
//window.location = ScreenIds.Home;
avwScreenMove(ScreenIds.Home);
};
//Change Language Japanese function
function changeLanguageJa(){
changeLanguage(Consts.ConstLanguage_Ja);
//ClientData.userInfo_language(Consts.ConstLanguage_Ja);
//$('#control-sort-titlekana').css('display','inline-block');
//$('#separate').css('display','inline-block');
//formatDisplayMoreRecord();
if(window.changeLanguageCallBackFunction){
changeLanguageCallBackFunction();
}
$("#searchbox-key").attr('placeholder', i18nText('msgPlaceHolder'));
};
//Change Language English functions
function changeLanguageEn(){
changeLanguage(Consts.ConstLanguage_En);
//ClientData.userInfo_language(Consts.ConstLanguage_En);
//$('#control-sort-titlekana').css('display','none');
//$('#separate').css('display','none');
//formatDisplayMoreRecord();
if(window.changeLanguageCallBackFunction){
changeLanguageCallBackFunction();
}
$("#searchbox-key").attr('placeholder', i18nText('msgPlaceHolder'));
};
//Change Language English function
function changeLanguageKo(){
changeLanguage(Consts.ConstLanguage_Ko);
//ClientData.userInfo_language(Consts.ConstLanguage_Ko);
//$('#control-sort-titlekana').css('display','none');
//$('#separate').css('display','none');
//formatDisplayMoreRecord();
if(window.changeLanguageCallBackFunction){
changeLanguageCallBackFunction();
}
$("#searchbox-key").attr('placeholder', i18nText('msgPlaceHolder'));
};
//Shiori function
function bookmarkFunction(){
//window.location = ScreenIds.BookmarkList;
avwScreenMove(ScreenIds.BookmarkList);
};
//Update Config function
function updateConfigFunction(){
//window.location = ScreenIds.Setting;
avwScreenMove(ScreenIds.Setting);
};
//Logout function
function logoutFunction() {
if (ClientData.isChangedBookmark() == true || ClientData.isChangedMarkingData() == true || ClientData.isChangedMemo() == true) {
// In case: user_data_backup = "Y" -> backup
if (ClientData.serviceOpt_user_data_backup() == "Y") {
if (ClientData.userOpt_bkConfirmFlg() == 1) { // Show confirming dialog
//$('#dlgConfirmBackup1').dialog({ width: 600, height: 200, modal: true });
lockLayout();
$('#dlgConfirmBackup1').show();
$('#dlgConfirmBackup1').center();
}
else { // Do not show confirming dialog
if (ClientData.userOpt_logoutMode() == null || ClientData.userOpt_logoutMode() == undefined) {
//$('#dlgConfirmBackup1').dialog({ width: 600, height: 200, modal: true });
lockLayout();
$('#dlgConfirmBackup1').show();
$('#dlgConfirmBackup1').center();
}
else {
if (ClientData.userOpt_logoutMode() == 0) { // Logout with backup
lockLayout();
DoBackup();
}
else if (ClientData.userOpt_logoutMode() == 1) { // Logout without backup
// Do nothing
}
// Logout
//webLogoutEvent();
}
}
}
// In case: user_data_backup != "Y" -> No backup, logout
else {
webLogoutEvent();
}
}
else{
webLogoutEvent();
}
};
function historyClickFunction(){
//window.location = ScreenIds.History;
avwScreenMove(ScreenIds.History);
};
//Web Logout Event
function webLogoutEvent(){
var params = {
sid: ClientData.userInfo_sid()
};
avwCmsApiSync(ClientData.userInfo_accountPath(), "webLogout", "GET", params,
function (data) {
SessionStorageUtils.clear();
avwUserSetting().remove(Keys.userInfo_sid);
// Move to login screen
//window.location = ScreenIds.Login;
avwScreenMove(ScreenIds.Login);
},
null);
};
//Logout Without Backup function
function confirmWithoutBackupFunction(e) {
e.preventDefault();
var remember = $('#chkRememberBackup').attr('checked');
if(remember == 'checked'){
ClientData.userOpt_bkConfirmFlg(0); // Do not show dialog in next time
}
else{
ClientData.userOpt_bkConfirmFlg(1); // Show dialog in next time
}
ClientData.userOpt_logoutMode(1); // In next time, if choose: [do not show dialog], will not backup and logout
//window.location = ScreenIds.Login;
webLogoutEvent();
};
//Logout With Backup function
function confirmWithBackupFunction(e) {
e.preventDefault();
var remember = $('#chkRememberBackup').attr('checked');
unlockLayout();
$('#dlgConfirmBackup1').css('z-index', '99');
lockLayout();
if(remember == 'checked'){
ClientData.userOpt_bkConfirmFlg(0); // Do not show dialog in next time
DoBackup();
}
else{
ClientData.userOpt_bkConfirmFlg(1); // Show dialog in next time
DoBackup();
}
ClientData.userOpt_logoutMode(0); // In next time, if choose: [do not show dialog], will backup and logout
//webLogoutEvent();
};
//Confirm Back Up Ok
function DoBackup() {
// ----------------------------
// Process backup here
// ----------------------------
// Bakup memo/marking/bookmark
var params = [
{ name: 'sid', content: ClientData.userInfo_sid() },
{ name: 'deviceType', content: '4' },
{ name: 'formFile', content: JSON.stringify(buildBackupData()), fileName: 'webBackupData.json', contentType: 'text-plain' }
];
avwUploadBackupFile(ClientData.userInfo_accountPath(), params, false,
function (data) {
if (JSON.parse(data).result == "success") {
ClientData.isChangedBookmark(false);
ClientData.isChangedMarkingData(false);
ClientData.isChangedMemo(false);
//alert(i18nText('msgBackupSuccess'));
// Show message: msgBackupSuccess
$().toastmessage({ position: 'middle-center' });
$().toastmessage('showToast', {
type: 'success',
sticky: true,
text: i18nText('msgBackupSuccess'),
});
$('.toast-position-middle-center').css('width', '500px');
$('.toast-position-middle-center').css('margin-left', '-250px');
$('.toast-item-close').live('click', webLogoutEvent);
}
else {
//alert(i18nText('msgBackupFailed'));
// Show error message: msgBackupFailed
$().toastmessage({ position: 'middle-center' });
$().toastmessage('showToast', {
type: 'error',
sticky: true,
text: i18nText('msgBackupFailed')
});
$('.toast-position-middle-center').css('width', '500px');
$('.toast-position-middle-center').css('margin-left', '-250px');
$('.toast-item-close').live('click', webLogoutEvent);
}
},
function (a, b, c) {
//alert(i18nText('msgBackupFailed'));
// Show error message: msgBackupFailed
$().toastmessage({ position: 'middle-center' });
$().toastmessage('showToast', {
type: 'error',
sticky: true,
text: i18nText('msgBackupFailed')
});
$('.toast-position-middle-center').css('width', '500px');
$('.toast-position-middle-center').css('margin-left', '-250px');
$('.toast-item-close').live('click', webLogoutEvent);
});
};
function checkForceChangePassword(){
if(ClientData.BookmarkScreen() != ScreenIds.Setting){
if(ClientData.requirePasswordChange() == 1){
//alert(i18nText('msgPWDNeedChange'));
showErrorScreenForceChangePassword();
}
}
};
function showErrorScreenForceChangePassword(){
var tags = '<div id="avw-auth-error">' +
'<div style="display:table; width:100%; height:100%;">' +
'<div style="display:table-cell; text-align:center; vertical-align:middle;">' +
'<p>'+i18nText('msgPWDNeedChange')+'</p>' +
'<div><button id="avw-unauth-ok">OK</button></div>' +
'</div></div></div>';
$('body').prepend(tags);
$('#avw-auth-error').css( {
'color': '#fff',
'opacity': 1,
'position': 'fixed',
'top': '0',
'left': '0',
'width': $(window).width(),
'height': $(window).height(),
'background': '#ccc',
'zIndex': '10000'
});
// resize error page
$(window).resize(function() {
$('#avw-auth-error').css( {
'width': $(window).width(),
'height': $(window).height()
});
});
$('#avw-unauth-ok').click(function() {
ClientData.BookmarkScreen(ScreenIds.Setting);
avwScreenMove(ScreenIds.Setting);
});
};
/// <reference path="../common/js/avweb.js" />
/// <reference path="../common/js/screenLock.js" />
/// <reference path="../common/js/common.js" />
/// <reference path="../common/js/i18n.js" />
/// <reference path="../common/js/jquery-1.8.1.min.js" />
/// <reference path="../common/js/jquery-ui-1.8.23.custom.min.js" />
/// <reference path="../common/js/jquery.toastmessage.js" />
/// <reference path="../common/js/pageViewer.js" />
/// <reference path="header.js" />
//Start Declare Variables
//----Constant-----------//
var DEFAULT_DISP_NUMBER_RECORD_FROM = 1;
var DEFAULT_DISP_NUMBER_RECORD_TO = 15;
var DEFAULT_SORT_TYPE = '4';
var DEFAULT_SORT_ORDER = '2';
var DEFAULT_SEARCH_DIVISION = 0;
var DEFAULT_IMG_OPTION_MEMO = 'img/list/pic_1.png';
var DEFAULT_IMG_OPTION_MARKING = 'img/list/pic_2.png';
var DEFAULT_IMG_CONTENT_EDIT = 'img/list/updatebook.png';
var DEFAULT_IMG_CONTENT_NEW = 'img/list/newbook.png';
var iNumberOfNextRecord = 15;
var arrayTemp = [];
var contentIdArray = [];
var resourceVersionArr = [];
var metaVersionArr = [];
var totalPage;
var contentViewData = [];
var noRecordFlg = false;
var home_isMove = false;
var history_contentTitleKana = [];
$(document).ready(function(){
if (!avwCheckLogin(ScreenIds.Login)){
return;
}
LockScreen();
document.title = i18nText('dspViewHistory') + ' | ' + i18nText('sysAppTitle');
ClientData.BookmarkScreen(ScreenIds.History);
if(ClientData.requirePasswordChange() != 1){
if(ClientData.ReadingContentIds() == null || ClientData.ReadingContentIds() == 'undefined' || ClientData.ReadingContentIds().length == 0){
}else{
syncReadingContent();
}
//remove hover effect when is touch device
removeHoverCss();
//Render Grid
renderGridView();
//Go To Details Page
$('canvas').live('click', canvasClickFunction);
//$('canvas').live('touchstart', canvasClickFunction);
$('canvas').live('touchend', canvasClickFunction);
$('canvas').live('touchmove', function () { home_isMove = true; });
//Open dialog
$('.dialog').live('click', titleClickFunction);
//$('.dialog').live('touchstart', titleClickFunction);
$('.dialog').live('touchend', titleClickFunction);
$('.dialog').live('touchmove', function () { home_isMove = true; });
//Sort Title
$('#control-sort-title').click(sortByTitleFunction);
//Sort by title kana
$('#control-sort-titlekana').click(sortByTitleKanaFunction);
//sort by release date
$('#control-sort-releasedate').click(sortByReleaseDateFunction);
$('#control-sort-viewdate').click(sortByViewDateFunction);
//Go To Details Page
$('.button-details').live('click', readSubmenuFunction);
//$('.button-details').live('touchstart', readSubmenuFunction);
$('.button-details').live('touchend', readSubmenuFunction);
$('.button-details').live('touchmove', function () { home_isMove = true; });
$(window).resize(function () {
if ($("#contentDetail").css("display") != "none") {
// Refresh panel of detail to center.
$("#contentDetail").center();
if ($("#contentDetail").height() > $(window).height()){
$("#contentDetail").css('top', '0');
}
}
});
}
else{
//Check if Force Change password
checkForceChangePassword();
}
});
//Call API
function abapi(name, param, method, callback){
avwCmsApiSync(ClientData.userInfo_accountPath(), name, method, param, callback, null);
};
///Render Content
function renderContent(id, text, division, type, order, from, to, cateid, grpid) {
var params = {
sid: id,
searchText: text,
searchDivision: division,
sortType: type,
sortOrder: order,
//recordFrom: from,
//recordTo: to,
categoryId: cateid,
groupId: grpid
};
avwCmsApiSync(ClientData.userInfo_accountPath(), 'webContentList', 'POST', params,
function (data) {
$('#content-grid').html('');
var htmlTemp = "";
for (var i = 0; i < data.contentList.length; i++) {
post = data.contentList[i];
//$.each(data.contentList, function (i, post) {
var outputDate = formatDeliveryDate(post.contentDeliveryDate);
//renderViewDate
var viewdate = renderViewDate(post.contentId);
if (viewdate != null && viewdate != 'undefined' && viewdate != '') {
htmlTemp += '<section>'
//$('#content-grid').append(
// '<section>'
+ ' <div class="cnt_section">'
+ ' <a class="img">'
+ ' <canvas style="display:none" height="105px" width="150px" class="home_canvas" id="content-thumbnail' + post.contentId + '" contentid="' + post.contentId + '">'
+ ' </canvas>'
+ ' <img id="imgloading'+ post.contentId +'" class="home_canvas" src="./img/data_loading.gif" height="25px" width="25px" style=""/>'
+ ' </a>'
+ ' <div class="text">'
+ ' <a id="title' + post.contentId + '" class="dialog name" contentid="' + post.contentId + '">' + truncate(htmlEncode(post.contentTitle), 25) + '</a>'
+ ' <div class="info">'
+ ' <ul class="date">'
+ ' <li><span class="lang" lang="txtPubDt">' + i18nText("txtPubDt") + '</span> : ' + outputDate + '</li>'
+ ' <li><span class="lang" lang="txtViewDt">' + i18nText("txtViewDt") + '</span>:<span id="lblVdate' + post.contentId + '"> </span></li>'
+ ' </ul>'
+ ' <ul class="pic">'
+ ' <li><img src="' + DEFAULT_IMG_OPTION_MEMO + '" id="imgMemo' + post.contentId + '" class="sticker" /></li>'
+ ' <li><img src="' + DEFAULT_IMG_OPTION_MARKING + '" id="imgBookMark' + post.contentId + '" class="pen" /></li>'
+ ' <li><a class="read lang button-details" contentid="' + post.contentId + '" lang="txtRead">' + i18nText("txtRead") + '</a></li>'
+ ' </ul>'
+ ' </div>'
+ ' </div>'
+ ' </div>'
+ '</section>'
//);
//$('canvas.home_canvas').hide();
//$('img.home_canvas').show();
/*
//assign thumbnail to array
arrayTemp.push({ contentId: post.contentId, thumbnail: formatStringBase64(post.contentThumbnail) });
//Check if user has read this content or not.
checkUserHasReadContent(post.contentId, post.resourceVersion, post.metaVersion);
//assign version to array
resourceVersionArr.push({ contentid: post.contentId, resourceversion: post.resourceVersion });
//assign meta version to array
metaVersionArr.push({ contentid: post.contentId, metaversion: post.metaVersion });
//Check if content has marking or memo
checkContentMarkingMemoOption(post.contentId);
$('#lblVdate' + post.contentId).html(viewdate);
addReadContentToArray(post.contentId, post.resourceVersion, post.metaVersion, post.contentThumbnail, post.contentTitle, returnContentTitleKana(post.contentId), post.contentDeliveryDate);
showContentThumbnail();
*/
}
//});
}
$('#content-grid').append(htmlTemp);
for (var i = 0; i < data.contentList.length; i++) {
post = data.contentList[i];
var viewdate = renderViewDate(post.contentId);
if (viewdate != null && viewdate != 'undefined' && viewdate != '') {
//assign thumbnail to array
arrayTemp.push({ contentId: post.contentId, thumbnail: formatStringBase64(post.contentThumbnail) });
//Check if user has read this content or not.
checkUserHasReadContent(post.contentId, post.resourceVersion, post.metaVersion);
//assign version to array
resourceVersionArr.push({ contentid: post.contentId, resourceversion: post.resourceVersion });
//assign meta version to array
metaVersionArr.push({ contentid: post.contentId, metaversion: post.metaVersion });
//Check if content has marking or memo
checkContentMarkingMemoOption(post.contentId);
$('#lblVdate' + post.contentId).html(viewdate);
addReadContentToArray(post.contentId, post.resourceVersion, post.metaVersion, post.contentThumbnail, post.contentTitle, returnContentTitleKana(post.contentId), post.contentDeliveryDate);
//showContentThumbnail();
}
}
if (data.recordFrom) {
ClientData.searchCond_recordFrom(data.recordFrom);
}
if (data.recordTo) {
ClientData.searchCond_recordTo(data.recordTo);
}
totalPage = data.totalRecord;
//Render Page number
reRenderPageNumber(totalPage, totalPage);
//changeLanguage(ClientData.userInfo_language());
}, null);
//i18nReplaceText();
};
//Handle language
function handleLanguage(){
//if(ClientData.userInfo_language() == Consts.ConstLanguage_En || ClientData.userInfo_language() == Consts.ConstLanguage_Ko)
if (getCurrentLanguage() == Consts.ConstLanguage_En || getCurrentLanguage() == Consts.ConstLanguage_Ko)
{
$('#control-sort-titlekana').css('display','none');
$('#label-sort-titlekana').css('display','none');
$('#separate').css('display','none');
$("#titlekana-sorttype").html('');
}
else {
if (ClientData.searchCond_sortOrder() != null && ClientData.searchCond_sortOrder() != 'undefined' || ClientData.searchCond_sortType() != '') {
var typeSort = ClientData.searchCond_sortType();
var orderSort = ClientData.searchCond_sortOrder();
if (typeSort == 2) {
if (orderSort == Consts.ConstOrderSetting_Asc) {
$('#titlekana-sorttype').html('');
$('#titlekana-sorttype').html('▲');
$('#titlekana-sorttype').css('width', '12px');
}
else {
$('#titlekana-sorttype').html('');
$('#titlekana-sorttype').html('▼');
$('#titlekana-sorttype').css('width', '12px');
}
}
}
if(noRecordFlg){
$('#label-sort-titlekana').css('display','block');
$('#separate').css('display','block');
}else{
$('#control-sort-titlekana').css('display','block');
$('#separate').css('display','block');
}
}
};
//Initial Screen
function renderGridView(){
var fromPage = '';
var toPage = '';
var sortType = DEFAULT_SORT_TYPE;
var sortOrder = DEFAULT_SORT_ORDER;
var searchText = '';
var searchDivision = DEFAULT_SEARCH_DIVISION;
var genreId = '';
var groupId = '';
var sid = ClientData.userInfo_sid();
ClientData.searchCond_recordFrom(fromPage);
ClientData.searchCond_recordTo(toPage);
ClientData.searchCond_sortType(sortType);
ClientData.searchCond_sortOrder(sortOrder);
ClientData.searchCond_searchDivision(searchDivision);
//Handle display sort
handleSortDisp();
//Display user name
$('#login-username').html(ClientData.userInfo_loginId_session());
//Refresh GridView
refreshGrid();
if(ClientData.ReadingContentIds() == null || ClientData.ReadingContentIds() == 'undefined' || ClientData.ReadingContentIds().length == 0){
displayResultNoRecord();
noRecordFlg = true;
reRenderPageNumber(0,0);
}
else{
//Render Gridview
renderContent(sid, searchText, searchDivision, 3, sortOrder, fromPage, toPage, genreId, groupId);
sortByViewDateDesc();
}
//Language Handle
handleLanguage();
};
//Canvas Click function
function canvasClickFunction(e){
if (e) {
e.preventDefault();
}
if (home_isMove == true) {
home_isMove = false;
return;
}
var contentId = $(this).attr('id');
var outputId = contentId.substring(17);
// Set content id for screen: content detail
ClientData.contentInfo_contentId(outputId);
// Get image of selected image
var base64String = returnThumbnail(outputId);
ClientData.contentInfo_contentThumbnail(base64String);
//Store Content id that user has read
if(ClientData.ReadingContentIds().length > 0){
contentIdArray = ClientData.ReadingContentIds();
for(var nIndex = 0; nIndex < contentIdArray.length; nIndex++){
if(contentIdArray[nIndex].contentid == outputId){
checkflag = true;
break;
}
else{
checkflag = false;
}
}
if(!checkflag){
contentIdArray.push({contentid: outputId, viewdate: '', originviewdate: ''});
}
}
else{
contentIdArray.push({contentid: outputId, viewdate: '', originviewdate: ''});
}
//Renew ReadingContentID
var newArray = [];
ClientData.ReadingContentIds(newArray);
//Set data for readingcontentid
ClientData.ReadingContentIds(contentIdArray);
//Set ResouceVersion for content
setResourceVersionData(outputId);
//Set MetaVersion for content
setMetaVersionData(outputId);
//Delete 'new' icon
drawEditImage(outputId);
//Open content Detail
openContentDetail();
};
//Re-render page from and total record
function reRenderPageNumber(dispRecord, dispTotal){
$('#dispPage').html(contentViewData.length);
$('#totalPage').html(contentViewData.length);
$('.pageNumControl').css('visibility','visible');
};
//Sort By Title Function
function sortByTitleFunction(){
$(this).addClass('active_tops');
$('#control-sort-titlekana').removeClass('active_tops');
$('#control-sort-releasedate').removeClass('active_tops');
$('#control-sort-viewdate').removeClass('active_tops');
var sortOrder = ClientData.searchCond_sortOrder();
var sortType = ClientData.searchCond_sortType();
var sid = ClientData.userInfo_sid();
var recordFrom = null;
var recordTo = null;
var genreId = ClientData.searchCond_genreId();
var groupId = ClientData.searchCond_groupId();
if(sortOrder == Consts.ConstOrderSetting_Asc)
{
if(sortType == '1'){
sortOrder = Consts.ConstOrderSetting_Desc;
$('#title-sorttype').html('');
$('#title-sorttype').html('▼');
$('#title-sorttype').css('width', '12px');
$('#titlekana-sorttype').html('');
$('#rDate-sorttype').html('');
$('#vDate-sorttype').html('');
sortByTitleDesc();
}
else{
sortOrder = Consts.ConstOrderSetting_Asc;
$('#title-sorttype').html('');
$('#title-sorttype').html('▲');
$('#title-sorttype').css('width', '12px');
$('#titlekana-sorttype').html('');
$('#rDate-sorttype').html('');
$('#vDate-sorttype').html('');
sortByTitleAsc();
}
ClientData.searchCond_sortOrder(sortOrder);
}
else
{
sortOrder = Consts.ConstOrderSetting_Asc;
$('#title-sorttype').html('');
$('#title-sorttype').html('▲');
$('#title-sorttype').css('width', '12px');
$('#titlekana-sorttype').html('');
$('#rDate-sorttype').html('');
$('#vDate-sorttype').html('');
ClientData.searchCond_sortOrder(sortOrder);
sortByTitleAsc();
}
sortType = '1';
ClientData.searchCond_sortType(sortType);
//refresh Gridview
//refreshGrid();
//renderContent(sid, '', ClientData.searchCond_searchDivision(), sortType, sortOrder, recordFrom, recordTo, genreId, groupId);
};
//Sort By Title Kana function
function sortByTitleKanaFunction(){
$(this).addClass('active_tops');
$('#control-sort-title').removeClass('active_tops');
$('#control-sort-releasedate').removeClass('active_tops');
$('#control-sort-viewdate').removeClass('active_tops');
var sortOrder = ClientData.searchCond_sortOrder();
var sortType = ClientData.searchCond_sortType();
var sid = ClientData.userInfo_sid();
var recordFrom = null;
var recordTo = null;
var genreId = ClientData.searchCond_genreId();
var groupId = ClientData.searchCond_groupId();
if(sortOrder == Consts.ConstOrderSetting_Asc)
{
if(sortType == '2'){
sortOrder = Consts.ConstOrderSetting_Desc;
$('#title-sorttype').html('');
$('#titlekana-sorttype').html('');
$('#titlekana-sorttype').html('▼');
$('#titlekana-sorttype').css('width', '12px');
$('#rDate-sorttype').html('');
$('#vDate-sorttype').html('');
sortByTitleKanaDesc();
}
else{
sortOrder = Consts.ConstOrderSetting_Asc;
$('#title-sorttype').html('');
$('#titlekana-sorttype').html('');
$('#titlekana-sorttype').html('▲');
$('#titlekana-sorttype').css('width', '12px');
$('#rDate-sorttype').html('');
$('#vDate-sorttype').html('');
sortByTitleKanaAsc();
}
ClientData.searchCond_sortOrder(sortOrder);
}
else
{
sortOrder = Consts.ConstOrderSetting_Asc;
$('#title-sorttype').html('');
$('#titlekana-sorttype').html('');
$('#titlekana-sorttype').html('▲');
$('#titlekana-sorttype').css('width', '12px');
$('#rDate-sorttype').html('');
$('#vDate-sorttype').html('');
ClientData.searchCond_sortOrder(sortOrder);
sortByTitleKanaAsc();
}
sortType = '2';
//refresh gridview
//refreshGrid();
ClientData.searchCond_sortType(sortType);
//renderContent(sid, '', ClientData.searchCond_searchDivision(), sortType, sortOrder, null, null, genreId, groupId);
};
//Sort By Release Date
function sortByReleaseDateFunction(){
$(this).addClass('active_tops');
$('#control-sort-titlekana').removeClass('active_tops');
$('#control-sort-title').removeClass('active_tops');
$('#control-sort-viewdate').removeClass('active_tops');
var sortOrder = ClientData.searchCond_sortOrder();
var sortType = ClientData.searchCond_sortType();
var sid = ClientData.userInfo_sid();
var recordFrom = null;
var recordTo = null;
var genreId = ClientData.searchCond_genreId();
var groupId = ClientData.searchCond_groupId();
if(sortOrder == Consts.ConstOrderSetting_Asc)
{
if(sortType == '3'){
sortOrder = Consts.ConstOrderSetting_Desc;
$('#title-sorttype').html('');
$('#titlekana-sorttype').html('');
$('#rDate-sorttype').html('');
$('#rDate-sorttype').html('▼');
$('#rDate-sorttype').css('width', '12px');
$('#vDate-sorttype').html('');
sortByPublishDateDesc();
}
else{
sortOrder = Consts.ConstOrderSetting_Asc;
$('#title-sorttype').html('');
$('#titlekana-sorttype').html('');
$('#rDate-sorttype').html('');
$('#rDate-sorttype').html('▲');
$('#rDate-sorttype').css('width', '12px');
$('#vDate-sorttype').html('');
sortByPublishDateAsc();
}
ClientData.searchCond_sortOrder(sortOrder);
}
else
{
sortOrder = Consts.ConstOrderSetting_Asc;
$('#title-sorttype').html('');
$('#titlekana-sorttype').html('');
$('#rDate-sorttype').html('');
$('#rDate-sorttype').html('▲');
$('#rDate-sorttype').css('width', '12px');
$('#vDate-sorttype').html('');
ClientData.searchCond_sortOrder(sortOrder);
sortByPublishDateAsc();
}
sortType = '3';
ClientData.searchCond_sortType(sortType);
//renderContent(sid, '', ClientData.searchCond_searchDivision(), sortType, sortOrder, recordFrom, recordTo, genreId, groupId);
};
//Sort By View Date
function sortByViewDateFunction(){
$(this).addClass('active_tops');
$('#control-sort-titlekana').removeClass('active_tops');
$('#control-sort-title').removeClass('active_tops');
$('#control-sort-releasedate').removeClass('active_tops');
var sortOrder = ClientData.searchCond_sortOrder();
var sortType = ClientData.searchCond_sortType();
if(sortOrder == Consts.ConstOrderSetting_Asc)
{
if(sortType == '4'){
sortOrder = Consts.ConstOrderSetting_Desc;
$('#title-sorttype').html('');
$('#titlekana-sorttype').html('');
$('#rDate-sorttype').html('');
$('#rDate-sorttype').html('');
$('#vDate-sorttype').html('');
$('#vDate-sorttype').html('▼');
$('#vDate-sorttype').css('width', '12px');
sortByViewDateDesc();
}
else{
sortOrder = Consts.ConstOrderSetting_Asc;
$('#title-sorttype').html('');
$('#titlekana-sorttype').html('');
$('#rDate-sorttype').html('');
$('#rDate-sorttype').html('');
$('#vDate-sorttype').html('');
$('#vDate-sorttype').html('▲');
$('#vDate-sorttype').css('width', '12px');
sortByViewDateAsc();
}
ClientData.searchCond_sortOrder(sortOrder);
}
else
{
sortOrder = Consts.ConstOrderSetting_Asc;
$('#title-sorttype').html('');
$('#titlekana-sorttype').html('');
$('#rDate-sorttype').html('');
$('#rDate-sorttype').html('');
$('#vDate-sorttype').html('');
$('#vDate-sorttype').html('▲');
$('#vDate-sorttype').css('width', '12px');
sortByViewDateAsc();
ClientData.searchCond_sortOrder(sortOrder);
}
sortType = '4';
ClientData.searchCond_sortType(sortType);
};
//Get Thumnail base on contentid
function returnThumbnail(contentid){
for(var i = 0; i < arrayTemp.length; i++){
if(arrayTemp[i].contentId == contentid){
return arrayTemp[i].thumbnail;
}
}
};
//Dialog Read Button CLick
function readSubmenuFunction(e){
if (e) {
e.preventDefault();
}
if (home_isMove == true) {
home_isMove = false;
return;
}
var contentId = $(this).attr('contentid');
var contentThumbnail = returnThumbnail(contentId);
var date = new Date();
var month = date.getMonth()+1;
var day = date.getDate();
var outputDate = formatNormalDate(day, month, date.getFullYear());
ClientData.contentInfo_contentId(contentId);
ClientData.contentInfo_contentThumbnail(contentThumbnail);
var checkflag = false;
//Store Content id that user has read
if(ClientData.ReadingContentIds().length > 0){
contentIdArray = ClientData.ReadingContentIds();
for(var nIndex = 0; nIndex < contentIdArray.length; nIndex++){
if(contentIdArray[nIndex].contentid == contentId){
checkflag = true;
if(contentIdArray[nIndex].viewdate == null || contentIdArray[nIndex].viewdate == 'undefined' || contentIdArray[nIndex].viewdate == ''){
contentIdArray[nIndex].viewdate = outputDate;
contentIdArray[nIndex].originviewdate = date;
}
break;
}
else{
checkflag = false;
}
}
if(!checkflag){
contentIdArray.push({contentid: contentId, viewdate: outputDate, originviewdate: date});
}
}
else{
contentIdArray.push({contentid: contentId, viewdate: outputDate, originviewdate: date});
}
//Renew ReadingContentID
var newArray = [];
ClientData.ReadingContentIds(newArray);
//Set ResouceVersion for content
setResourceVersionData(contentId);
//Set MetaVersion for content
setMetaVersionData(contentId);
//Set data for readingcontentid
ClientData.ReadingContentIds(contentIdArray);
ClientData.IsRefresh(false);
avwScreenMove(ScreenIds.ContentView);
};
//Check if Content Has marking or memo
function checkContentMarkingMemoOption(contentId){
//Check if contentid has marking
if(ClientData.MarkingData().length == 0){
$('#imgBookMark'+contentId).css('visibility','hidden');
}
else{
for (var nIndex1 = 0; nIndex1 < ClientData.MarkingData().length; nIndex1++) {
if (ClientData.MarkingData()[nIndex1].contentid == contentId) {
$('#imgBookMark'+contentId).css('visibility','visible');
break;
}
else{
$('#imgBookMark'+contentId).css('visibility','hidden');
}
}
}
if(ClientData.MemoData().length == 0){
$('#imgMemo'+contentId).css('visibility','hidden');
}
else{
// Check if contentid has memo
for (var nIndex1 = 0; nIndex1 < ClientData.MemoData().length; nIndex1++) {
if (ClientData.MemoData()[nIndex1].contentid == contentId) {
$('#imgMemo'+contentId).css('visibility','visible');
break;
}
else
{
$('#imgMemo'+contentId).css('visibility','hidden');
}
}
}
};
//Check if User has read content
function checkUserHasReadContent(contId, resourceVer, metaVer){
var imgThumb = new Image();
//imgThumb.src = returnThumbnail(contId);
var imgIconNew = new Image();
//imgIconNew.src = DEFAULT_IMG_CONTENT_NEW;
var imgIconEdit = new Image();
//imgIconEdit.src = DEFAULT_IMG_CONTENT_EDIT;
var c = document.getElementById('content-thumbnail'+contId);
var ctx = c.getContext('2d');
var readFlg = false;
var versionArr = ClientData.ResourceVersion();
var metaArr = ClientData.MetaVersion();
var readArr = ClientData.ReadingContentIds();
if(readArr == null || readArr <= 0 || readArr == 'undefined'){
imgThumb.onload = function(){
var resizeImg = resizeResourceThumbnail(imgThumb, c.width, c.height);
ctx.drawImage(imgThumb, c.width/2 - resizeImg[0]/2, 0, resizeImg[0], resizeImg[1]);
imgIconNew.onload = function(){
ctx.drawImage(imgIconNew, c.width/2 - resizeImg[0]/2, 0);
showContentThumbnail(contId);
};
imgIconNew.src = DEFAULT_IMG_CONTENT_NEW;
};
imgThumb.src = returnThumbnail(contId);
}
else{
//Check if user has read this content or not
for (var nIndex1 = 0; nIndex1 < ClientData.ReadingContentIds().length; nIndex1++) {
if(ClientData.ReadingContentIds()[nIndex1].contentid == contId){
imgThumb.onload = function(){
var resizeImg = resizeResourceThumbnail(imgThumb, c.width, c.height);
ctx.drawImage(imgThumb, c.width/2 - resizeImg[0]/2, 0, resizeImg[0], resizeImg[1]);
showContentThumbnail(contId);
};
imgThumb.src = returnThumbnail(contId);
readFlg = true;
break;
}
else{
imgThumb.onload = function(){
var resizeImg = resizeResourceThumbnail(imgThumb, c.width, c.height);
ctx.drawImage(imgThumb, c.width/2 - resizeImg[0]/2, 0, resizeImg[0], resizeImg[1]);
showContentThumbnail(contId);
imgIconNew.onload = function(){
ctx.drawImage(imgIconNew, c.width/2 - resizeImg[0]/2, 0);
};
imgIconNew.src = DEFAULT_IMG_CONTENT_NEW;
};
imgThumb.src = returnThumbnail(contId);
}
}
}
//Check if resource version has change
if(readFlg){
if(versionArr == null || versionArr <= 0 || versionArr == 'undefined'){
}
else{
for(var nIndex2 = 0; nIndex2 < versionArr.length; nIndex2++){
if(versionArr[nIndex2].contentid == contId){
if(versionArr[nIndex2].resourceversion != resourceVer){
imgThumb.onload = function(){
var resizeImg = resizeResourceThumbnail(imgThumb, c.width, c.height);
ctx.drawImage(imgThumb, c.width/2 - resizeImg[0]/2, 0, resizeImg[0], resizeImg[1]);
showContentThumbnail(contId);
imgIconEdit.onload = function(){
ctx.drawImage(imgIconEdit, c.width/2 - resizeImg[0]/2, 0);
};
imgIconEdit.src = DEFAULT_IMG_CONTENT_EDIT;
};
imgThumb.src = returnThumbnail(contId);
break;
}
}
}
}
if(metaArr == null || metaArr <= 0 || metaArr == 'undefined'){
}
else{
for(var nIndex2 = 0; nIndex2 < metaArr.length; nIndex2++){
if(metaArr[nIndex2].contentid == contId){
if(metaArr[nIndex2].metaversion != metaVer){
imgThumb.onload = function(){
var resizeImg = resizeResourceThumbnail(imgThumb, c.width, c.height);
ctx.drawImage(imgThumb, c.width/2 - resizeImg[0]/2, 0, resizeImg[0], resizeImg[1]);
showContentThumbnail(contId);
imgIconEdit.onload = function(){
ctx.drawImage(imgIconEdit, c.width/2 - resizeImg[0]/2, 0);
};
imgIconEdit.src = DEFAULT_IMG_CONTENT_EDIT;
};
imgThumb.src = returnThumbnail(contId);
break;
}
}
}
}
readFlg = false;
}
};
//draw Edit Image
function drawEditImage(id){
var img = new Image();
img.src = returnThumbnail(id);
var c = document.getElementById('content-thumbnail'+id);
//use getContext to use the canvas for drawing
var ctx = c.getContext('2d');
img.onload = function(){
var resizeImg = resizeResourceThumbnail(img, c.width, c.height);
ctx.drawImage(img, c.width/2 - resizeImg[0]/2, 0, resizeImg[0], resizeImg[1]);
showContentThumbnail(id);
};
};
//Render User view date
function renderViewDate(id){
for(var i = 0; i < ClientData.ReadingContentIds().length; i++){
if(ClientData.ReadingContentIds()[i].contentid == id){
return ClientData.ReadingContentIds()[i].viewdate;
}
}
};
function returnOriginalViewDate(id){
for(var i = 0; i < ClientData.ReadingContentIds().length; i++){
if(ClientData.ReadingContentIds()[i].contentid == id){
return ClientData.ReadingContentIds()[i].originviewdate;
}
}
};
//handle display sort direction
function handleSortDisp(){
$('#control-sort-title').removeClass('active_tops');
$('#control-sort-titlekana').removeClass('active_tops');
$('#control-sort-releasedate').removeClass('active_tops');
$('#control-sort-viewdate').removeClass('active_tops');
var typeSort;
var orderSort;
if(ClientData.searchCond_sortType() == null || ClientData.searchCond_sortType() == 'undefined' || ClientData.searchCond_sortType() == ''){
$('#title-sorttype').html('');
$('#title-sorttype').html('');
$('#titlekana-sorttype').html('');
$('#rDate-sorttype').html('');
$('#vDate-sorttype').html('');
}
else{
if(ClientData.searchCond_sortOrder() != null && ClientData.searchCond_sortOrder() != 'undefined' && ClientData.searchCond_sortType() != ''){
typeSort = ClientData.searchCond_sortType();
orderSort = ClientData.searchCond_sortOrder();
if(typeSort == 1){
if(orderSort == Consts.ConstOrderSetting_Asc){
$('#title-sorttype').html('');
$('#title-sorttype').html('▲');
$('#title-sorttype').css('width', '12px');
$('#titlekana-sorttype').html('');
$('#rDate-sorttype').html('');
$('#vDate-sorttype').html('');
}
else{
$('#title-sorttype').html('');
$('#title-sorttype').html('▼');
$('#title-sorttype').css('width', '12px');
$('#titlekana-sorttype').html('');
$('#rDate-sorttype').html('');
$('#vDate-sorttype').html('');
}
$('#control-sort-title').addClass('active_tops');
}
else if(typeSort == 2){
if(orderSort == Consts.ConstOrderSetting_Asc){
$('#title-sorttype').html('');
$('#titlekana-sorttype').html('');
$('#titlekana-sorttype').html('▲');
$('#titlekana-sorttype').css('width', '12px');
$('#rDate-sorttype').html('');
$('#vDate-sorttype').html('');
}
else{
$('#title-sorttype').html('');
$('#titlekana-sorttype').html('');
$('#titlekana-sorttype').html('▼');
$('#titlekana-sorttype').css('width', '12px');
$('#rDate-sorttype').html('');
$('#vDate-sorttype').html('');
}
$('#control-sort-titlekana').addClass('active_tops');
}
else if(typeSort == 3){
if(orderSort == Consts.ConstOrderSetting_Asc){
$('#title-sorttype').html('');
$('#titlekana-sorttype').html('');
$('#rDate-sorttype').html('');
$('#rDate-sorttype').html('▲');
$('#rDate-sorttype').css('width', '12px');
$('#vDate-sorttype').html('');
}
else{
$('#title-sorttype').html('');
$('#titlekana-sorttype').html('');
$('#rDate-sorttype').html('');
$('#rDate-sorttype').html('▼');
$('#rDate-sorttype').css('width', '12px');
$('#vDate-sorttype').html('');
}
$('#control-sort-releasedate').addClass('active_tops');
}
else{
if(orderSort == Consts.ConstOrderSetting_Asc){
$('#title-sorttype').html('');
$('#titlekana-sorttype').html('');
$('#rDate-sorttype').html('');
$('#rDate-sorttype').html('');
$('#vDate-sorttype').html('▲');
$('#vDate-sorttype').css('width', '12px');
}
else{
$('#title-sorttype').html('');
$('#titlekana-sorttype').html('');
$('#rDate-sorttype').html('');
$('#rDate-sorttype').html('');
$('#vDate-sorttype').html('▼');
$('#vDate-sorttype').css('width', '12px');
}
$('#control-sort-viewdate').addClass('active_tops');
}
}
}
};
//convert delivery Date
function formatDeliveryDate(date){
var day = date.date;
var month = eval(date.month) + 1;
var year = eval(date.year) + 1900;
var outputDate = year + '/' + ((''+month).length<2 ? '0' : '') + month + '/' + ((''+day).length<2 ? '0' : '') + day;
return outputDate;
};
//convert view Date
function formatNormalDate(day, month, year){
var outputDate = year + '/' + ((''+month).length<2 ? '0' : '') + month + '/' + ((''+day).length<2 ? '0' : '') + day;
return outputDate;
};
//format Image string
function formatStringBase64(imgStr){
var outputString = 'data:image/jpeg;base64,'+imgStr;
return outputString;
};
//function Open SubMenu Dialog
function titleClickFunction(e){
if (e) {
e.preventDefault();
}
if (home_isMove == true) {
home_isMove = false;
return;
}
var contentid = $(this).attr('contentid');
// Get image of selected image
var base64String = returnThumbnail(contentid);
ClientData.contentInfo_contentThumbnail(base64String);
ClientData.contentInfo_contentId(contentid);
//Store Content id that user has read
if(ClientData.ReadingContentIds().length > 0){
contentIdArray = ClientData.ReadingContentIds();
for(var nIndex = 0; nIndex < contentIdArray.length; nIndex++){
if(contentIdArray[nIndex].contentid == contentid){
checkflag = true;
break;
}
else{
checkflag = false;
}
}
if(!checkflag){
contentIdArray.push({contentid: contentid, viewdate: '', originviewdate: ''});
}
}
else{
contentIdArray.push({contentid: contentid, viewdate: '', originviewdate: ''});
}
//Renew ReadingContentID
var newArray = [];
ClientData.ReadingContentIds(newArray);
//Set data for readingcontentid
ClientData.ReadingContentIds(contentIdArray);
//Set ResouceVersion for content
setResourceVersionData(contentid);
//Set MetaVersion for content
setMetaVersionData(contentid);
//Delete 'new' icon
drawEditImage(contentid);
//Open content Detail
openContentDetail();
};
//refresh sort order
function refreshSortTypeOrder(){
$('#title-sorttype').html('');
$('#titlekana-sorttype').html('');
$('#rDate-sorttype').html('');
$('#rDate-sorttype').html('');
$('#vDate-sorttype').html('');
};
//refresh GridView
function refreshGrid(){
//$('#content-grid').html('');
$('#content-grid').empty();
$('.pageNumControl').css('visibility','hidden');
};
function sortByViewDateAsc(){
var sortArr = contentViewData;
var t;
for(var i = 0; i < sortArr.length; i++){
for(var j = 1; j < sortArr.length - i; j++){
if(sortArr[j-1].originviewdate > sortArr[j].originviewdate){
t = sortArr[j-1];
sortArr[j-1] = sortArr[j];
sortArr[j] = t;
}
}
}
var resultArr = sortArr;
renderContentAfterSort(resultArr);
};
function formatDate(originDate){
var sourceDate = new Date(originDate);
var year = sourceDate.getFullYear() + 1;
var month = sourceDate.getMonth();
var day = sourceDate.getDate();
var hour = sourceDate.getHours();
var minute = sourceDate.getMinutes();
var second = sourceDate.getSeconds();
var milisecond = sourceDate.getMilliseconds();
var newDate = new Date(year, month, day, hour, minute, second, milisecond);
return newDate;
};
function sortByViewDateDesc(){
var sortArr = contentViewData;
var temp;
for(var i = 0; i < sortArr.length; i++){
for(var j = sortArr.length - 1; j > i; j--){
if(sortArr[j].originviewdate > sortArr[j - 1].originviewdate){
temp = sortArr[j];
sortArr[j] = sortArr[j - 1];
sortArr[j - 1] = temp;
}
}
}
var resultArr = sortArr;
renderContentAfterSort(resultArr);
};
function addReadContentToArray(strContentId, strResourceVersion, strMetaVersion, strThumbnail, strTitle, strTitleKana, strDelivDate){
if (contentViewData.length > 0) {
var flag;
for(var j = 0; j < contentViewData.length; j++){
if(contentViewData[j].contentid == strContentId){
flag = true;
break;
}
else{
flag = false;
}
}
if(!flag){
contentViewData.push({contentid: strContentId, originviewdate: formatDate(returnOriginalViewDate(strContentId)), contenttitle: strTitle, contenttitlekana: strTitleKana, deliverydate: strDelivDate, resourceversion: strResourceVersion, metaversion: strMetaVersion, thumbnail: formatStringBase64(strThumbnail) });
}
}else{
contentViewData.push({contentid: strContentId, originviewdate: formatDate(returnOriginalViewDate(strContentId)), contenttitle: strTitle, contenttitlekana: strTitleKana, deliverydate: strDelivDate, resourceversion: strResourceVersion, metaversion: strMetaVersion, thumbnail: formatStringBase64(strThumbnail) });
}
};
function showContentThumbnail(conid) {
$('img#imgloading'+conid).fadeOut('slow',function(){
$('canvas#content-thumbnail'+conid).fadeIn('slow');
});
};
function syncReadingContent(){
var readArr = ClientData.ReadingContentIds();
var metaArr = ClientData.MetaVersion();
var resourceArr = ClientData.ResourceVersion();
for (var i = readArr.length - 1; i >= 0; i--) {
var readContent = readArr[i];
if (!IsExistContent(readContent.contentid)) {
readArr.splice(i, 1);
metaArr.splice(i, 1);
resourceArr.splice(i, 1);
}
// Do not process next
if (avwHasError()) {
return;
}
}
ClientData.ReadingContentIds(readArr);
ClientData.MetaVersion(metaArr);
ClientData.ResourceVersion(resourceArr);
};
/*
Get content title kana if it existed
*/
function getContentNameKana(strContentId) {
var strContentNameKana = null;
for (var nIndex = 0; nIndex < history_contentTitleKana.length; nIndex++) {
if (history_contentTitleKana[nIndex].contentId == strContentId) {
strContentNameKana = history_contentTitleKana[nIndex].contentNameKana;
break;
}
}
return strContentNameKana;
};
/*
Check content whether existed or not
*/
function IsExistContent(strContentId) {
var isExisted = true;
var params = {
sid: ClientData.userInfo_sid(),
getType: '1',
contentId: strContentId
};
avwCmsApiSync(ClientData.userInfo_accountPath(), "webGetContent", 'GET', params,
function (data) {
isExisted = true;
history_contentTitleKana.push({ contentId: strContentId, contentNameKana: data.contentData.contentNameKana });
},
function (xmlHttpRequest, txtStatus, errorThrown) {
if (xmlHttpRequest.status == 404) {
isExisted = false;
}
else {
// Show system error
isExisted = true; // Mark this flag to prevent bookmarks from deleting
showSystemError();
}
});
return isExisted;
};
function changeLanguageCallBackFunction(){
handleLanguage();
document.title = i18nText('dspViewHistory') + ' | ' + i18nText('sysAppTitle');
};
function displayResultNoRecord(){
i18nReplaceText();
$('#content-grid').html(i18nText('msgHistoryNotExist'));
$('#content-grid').css({'text-align':'left','margin-top':'20px','clear':'both','font-size':'16px','color':'red'});
$('#control-nextrecord').css('visibility','hidden');
$('.control_sort_on').hide();
$('.control_sort_off').show();
};
function enableSort(){
$('.control_sort_on').show();
$('.control_sort_off').hide();
};
function truncate(strInput, length){
if (strInput.length <= length)
{
return strInput;
}
else
{
return strInput.substring(0, length) + "...";
}
};
function sortByTitleAsc(){
var sortArr = contentViewData;
var t;
for(var i = 0; i < sortArr.length; i++){
for(var j = 1; j < sortArr.length - i; j++){
if(sortArr[j-1].contenttitle.toUpperCase() > sortArr[j].contenttitle.toUpperCase()){
t = sortArr[j-1];
sortArr[j-1] = sortArr[j];
sortArr[j] = t;
}
}
}
var resultArr = sortArr;
renderContentAfterSort(resultArr);
};
function sortByTitleDesc(){
var sortArr = contentViewData;
var temp;
for(var i = 0; i < sortArr.length; i++){
for(var j = sortArr.length - 1; j > i; j--){
if(sortArr[j].contenttitle.toUpperCase() > sortArr[j - 1].contenttitle.toUpperCase()){
temp = sortArr[j];
sortArr[j] = sortArr[j - 1];
sortArr[j - 1] = temp;
}
}
}
var resultArr = contentViewData;
renderContentAfterSort(resultArr);
};
function sortByPublishDateAsc(){
var sortArr = contentViewData;
var t;
for(var i = 0; i < sortArr.length; i++){
for(var j = 1; j < sortArr.length - i; j++){
if(formatOriginalPublishDate(sortArr[j-1].deliverydate) > formatOriginalPublishDate(sortArr[j].deliverydate)){
t = sortArr[j-1];
sortArr[j-1] = sortArr[j];
sortArr[j] = t;
}
}
}
var resultArr = sortArr;
renderContentAfterSort(resultArr);
};
function sortByPublishDateDesc(){
var sortArr = contentViewData;
var temp;
for(var i = 0; i < sortArr.length; i++){
for(var j = sortArr.length - 1; j > i; j--){
if(formatOriginalPublishDate(sortArr[j].deliverydate) > formatOriginalPublishDate(sortArr[j - 1].deliverydate)){
temp = sortArr[j];
sortArr[j] = sortArr[j - 1];
sortArr[j - 1] = temp;
}
}
}
var resultArr = sortArr;
renderContentAfterSort(resultArr);
};
function sortByTitleKanaAsc(){
var sortArr = contentViewData;
var t;
for(var i = 0; i < sortArr.length; i++){
for(var j = 1; j < sortArr.length - i; j++){
if(sortArr[j-1].contenttitlekana > sortArr[j].contenttitlekana){
t = sortArr[j-1];
sortArr[j-1] = sortArr[j];
sortArr[j] = t;
}
}
}
var resultArr = sortArr;
renderContentAfterSort(resultArr);
};
function sortByTitleKanaDesc(){
var sortArr = contentViewData;
var temp;
for(var i = 0; i < sortArr.length; i++){
for(var j = sortArr.length - 1; j > i; j--){
if(sortArr[j].contenttitlekana > sortArr[j - 1].contenttitlekana){
temp = sortArr[j];
sortArr[j] = sortArr[j - 1];
sortArr[j - 1] = temp;
}
}
}
var resultArr = sortArr;
renderContentAfterSort(resultArr);
};
function renderContentAfterSort(contentSortArr){
refreshGrid();
var htmlTemp = "";
for(var i = 0; i < contentSortArr.length; i++) {
post = contentSortArr[i];
//$.each(contentSortArr, function(i, post){
var outputDeliveryDate = formatDeliveryDate(post.deliverydate);
//$('#content-grid').append(
htmlTemp += '<section>'
+ ' <div class="cnt_section">'
+ ' <a class="img">'
+ ' <canvas style="display:none" height="105px" width="150px" class="home_canvas" id="content-thumbnail' + post.contentid + '" contentid="' + post.contentid + '">'
+ ' </canvas>'
+ ' <img id="imgloading'+ post.contentid +'" src="./img/data_loading.gif" height="25px" class="home_canvas" width="25px"/>'
+ ' </a>'
+ ' <div class="text">'
+ ' <a id="title' + post.contentid + '" class="dialog name" contentid="' + post.contentid + '">' + truncate(htmlEncode(post.contenttitle), 25) + '</a>'
+ ' <div class="info">'
+ ' <ul class="date">'
+ ' <li><span class="lang" lang="txtPubDt">' + i18nText("txtPubDt") + '</span> : ' + outputDeliveryDate + '</li>'
+ ' <li><span class="lang" lang="txtViewDt">' + i18nText("txtViewDt") + '</span>:<span id="lblVdate' + post.contentid + '"> </span></li>'
+ ' </ul>'
+ ' <ul class="pic">'
+ ' <li><img src="' + DEFAULT_IMG_OPTION_MEMO + '" id="imgMemo' + post.contentid + '" class="sticker" /></li>'
+ ' <li><img src="' + DEFAULT_IMG_OPTION_MARKING + '" id="imgBookMark' + post.contentid + '" class="pen" /></li>'
+ ' <li><a class="read lang button-details" contentid="' + post.contentid + '" lang="txtRead">' + i18nText("txtRead") + '</a></li>'
+ ' </ul>'
+ ' </div>'
+ ' </div>'
+ ' </div>'
+ '</section>'
//);
;
/*
$('canvas.home_canvas').hide();
$('img.home_canvas').show();
var viewdate = renderViewDate(post.contentid);
reRenderPageNumber(totalPage, totalPage);
//Check if user has read this content or not.
checkUserHasReadContent(post.contentid, post.resourceversion, post.metaversion);
//Check if content has marking or memo
checkContentMarkingMemoOption(post.contentid);
$('#lblVdate' + post.contentid).html(viewdate);
//showContentThumbnail();
i18nReplaceText();
*/
//});
}
$('#content-grid').append(htmlTemp);
for (var i = 0; i < contentSortArr.length; i++) {
post = contentSortArr[i];
//$('canvas.home_canvas').hide();
//$('img.home_canvas').show();
var viewdate = renderViewDate(post.contentid);
reRenderPageNumber(totalPage, totalPage);
//Check if user has read this content or not.
checkUserHasReadContent(post.contentid, post.resourceversion, post.metaversion);
//Check if content has marking or memo
checkContentMarkingMemoOption(post.contentid);
$('#lblVdate' + post.contentid).html(viewdate);
showContentThumbnail();
//i18nReplaceText();
}
};
function formatOriginalPublishDate(date){
var day = date.date;
var month = date.month + 1;
var year = date.year + 1900;
var hour = date.hours;
var minute = date.minutes;
var second = date.seconds;
var resultDate = new Date(year, month, day, hour, minute, second);
return resultDate;
};
function returnContentTitleKana(id) {
var titleKana;
// Get title kana from existed contents
titleKana = getContentNameKana(id);
if (titleKana != null) {
// Skip this case
}
else {
var params = {
contentId: id,
sid: ClientData.userInfo_sid(),
getType: 1
};
// Get all pages of content
avwCmsApiSync(ClientData.userInfo_accountPath(), "webGetContent", 'GET', params,
function (data) {
// Success
titleKana = data.contentData.contentNameKana;
}, null);
}
return titleKana;
};
function resizeResourceThumbnail(mg, width, height) {
var newWidth;
var newHeight;
if(mg.width > mg.height) {
newWidth = width;
newHeight = (mg.height * width)/mg.width;
}
else {
newHeight = height;
newWidth = (mg.width * height)/mg.height;
}
var result = [newWidth, newHeight];
return result;
};
function removeHoverCss(){
if(isTouchDevice()){
$('#control-sort-title').removeClass('nottouchdevice');
$('#control-sort-titlekana').removeClass('nottouchdevice');
$('#control-sort-releasedate').removeClass('nottouchdevice');
$('#control-sort-viewdate').removeClass('nottouchdevice');
}
};
/// <reference path="../common/js/avweb.js" />
/// <reference path="../common/js/screenLock.js" />
/// <reference path="../common/js/common.js" />
/// <reference path="../common/js/i18n.js" />
/// <reference path="../common/js/jquery-1.8.1.min.js" />
/// <reference path="../common/js/jquery-ui-1.8.23.custom.min.js" />
/// <reference path="../common/js/jquery.toastmessage.js" />
/// <reference path="../common/js/pageViewer.js" />
/// <reference path="header.js" />
//Start Declare Variables
//----Constant-----------//
var DEFAULT_DISP_NUMBER_RECORD_FROM = 1;
var DEFAULT_DISP_NUMBER_RECORD_TO = 15;
var DEFAULT_SORT_TYPE = 3;
var DEFAULT_SORT_ORDER = 2;
var DEFAULT_SEARCH_DIVISION = 0;
var DEFAULT_IMG_OPTION_MEMO = 'img/list/pic_1.png';
var DEFAULT_IMG_OPTION_MARKING = 'img/list/pic_2.png';
var DEFAULT_IMG_CONTENT_EDIT = 'img/list/updatebook.png';
var DEFAULT_IMG_CONTENT_NEW = 'img/list/newbook.png';
var home_realTotalRecord = 0;
var iNumberOfNextRecord = 15;
var arrayTemp = [];
var contentIdArray = [];
var resourceVersionArr = [];
var metaVersionArr = [];
var errorPage = [];
var errorContent = [];
var dataGroup;
var dataGenre;
var totalPage;
var existContent = [];
var isSubMenuHoverOn = false;
var home_isMove = false;
var isShowBookShelf = null;
var showNextRecordClickNumber = 1;
//==========================================================
$(document).ready(function () {
if (!avwCheckLogin(ScreenIds.Login)) {
return;
}
document.title = i18nText('dspHome') + ' | ' + i18nText('sysAppTitle');
// Set bookmark screen
ClientData.BookmarkScreen(ScreenIds.Home);
//Check if Force Change password
if(ClientData.requirePasswordChange() != 1){
// Register log
RegisterLog();
//Sync Data
if (ClientData.ReadingContentIds() == null || ClientData.ReadingContentIds() == 'undefined' || ClientData.ReadingContentIds().length == 0) {
ClientData.common_contentDataChkFlg(false);
} else {
syncContentData();
}
//remove hover css if is touch device
removeHoverCss();
//Get default view mode for rendergrid view
setDefaultViewMode();
//Toggle TreeView Disp
handleTreeViewDisp();
//Format text display more record
formatDisplayMoreRecord();
//Render Grid
renderGridView();
//Render Genre
getDataJsonFileGenre();
getDataJsonFileGroup();
// Lock screen is here, because of in getDataJsonFileGroup() called click to expand speified nodes of treeview
LockScreen();
//Change display type to bookshelf type
$('#control-bookshelf-type').click(changeDispBookShelfFunction);
//Change display type to list type
$('#control-list-type').click(changeDispListFunction);
//Go To Details Page
$('canvas').live('click', canvasClickFunction);
//$('canvas').live('touchstart', canvasClickFunction);
$('canvas').live('touchend', canvasClickFunction);
$('canvas').live('touchmove', function () { home_isMove = true; });
//Open dialog
$('.dialog').live('click', openSubMenuDialogFunction);
//$('.dialog').live('touchstart', openSubMenuDialogFunction);
$('.dialog').live('touchend', openSubMenuDialogFunction);
$('.dialog').live('touchmove', function () { home_isMove = true; });
//Render Genre TreeView
$('#lnkbtnGenre').click(genreSelectFunction);
//Render Group TreeView
$('#lnkbtnGroup').click(groupSelectFunction);
//Button details on dialog click event
$('#dialog-detail').click(detailsSubmenuFunction);
//Button Read on dialog click event
$('#dialog-read').click(readSubmenuFunction);
//Show Next Record
$('a#control-nextrecord').click(showNextRecordFunction);
//Sort Title
$('#control-sort-title').click(sortByTitleFunction);
//Sort by title kana
$('#control-sort-titlekana').click(sortByTitleKanaFunction);
//sort by release date
$('#control-sort-releasedate').click(sortByReleaseDateFunction);
//Go To Details Page
$('.button-details').live('click', readSubmenuFunction);
//$('.button-details').live('touchstart', readSubmenuFunction);
$('.button-details').live('touchend', readSubmenuFunction);
$('.button-details').live('touchmove', function () { home_isMove = true; });
$('#dlgSubMenu').hover(subMenuHoverFunction, subMenuHoverOffFunction);
$('body').click(bodyHomeClickFunction);
$('body').bind('touchstart', bodyHomeClickFunction);
$(window).resize(function () {
if ($("#contentDetail").css("display") != "none") {
// Refresh panel of detail to center.
$("#contentDetail").center();
if ($("#contentDetail").height() > $(window).height()){
$("#contentDetail").css('top', '0');
}
}
});
}else{
checkForceChangePassword();
}
});
function subMenuHoverFunction(){
isSubMenuHoverOn = true;
};
function subMenuHoverOffFunction() {
isSubMenuHoverOn = false;
};
function bodyHomeClickFunction(){
if(!isSubMenuHoverOn){
$('#dlgSubMenu').hide();
}
};
//Toggle Genre/Group Tab
function handleTreeViewDisp(){
$('#lblGenre').css('display','block');
$('#lnkGenre').css('display','none');
$('#lnkGroup').css('display','block');
$('#lblGroup').css('display','none');
};
//Change Display BookShelf Function
function changeDispBookShelfFunction(){
if(isShowBookShelf == false){
//ClientData.sortOpt_viewMode(Consts.ConstDisplayMode_BookShelf);
isShowBookShelf = true;
var recordFrom = 0;
var recordTo = 0;
// if(ClientData.sortOpt_viewMode() == Consts.ConstDisplayMode_BookShelf){ if(isShowBookShelf) {
recordFrom = DEFAULT_DISP_NUMBER_RECORD_FROM;
recordTo = returnNumberDispRecordForBookShelf() * showNextRecordClickNumber;
}
//refresh sort order
refreshSortTypeOrder();
var id = ClientData.userInfo_sid();
var searchText = ClientData.searchCond_searchText();
var searchDivision = ClientData.searchCond_searchDivision();
var sortType = ClientData.searchCond_sortType();
var sortOrder = ClientData.searchCond_sortOrder();
var groupId = ClientData.searchCond_groupId();
var genreId = ClientData.searchCond_genreId();
//handle sort display
handleSortDisp();
//refresh Grid view
refreshGrid();
renderContent(id, searchText, searchDivision, sortType, sortOrder, recordFrom, recordTo, genreId , groupId);
//format text disp more record
formatDisplayMoreRecord();
//Get next record will be displayed
getNextRecordNumForBookShelf();
}
};
//Change Display List Function
function changeDispListFunction(){
if(isShowBookShelf == true){
//ClientData.sortOpt_viewMode(Consts.ConstDisplayMode_List);
isShowBookShelf = false;
var recordFrom = 0;
var recordTo = 0;
//Check VIewmode
// if(ClientData.sortOpt_viewMode() == Consts.ConstDisplayMode_List){ if (!isShowBookShelf) {
recordFrom = DEFAULT_DISP_NUMBER_RECORD_FROM;
recordTo = returnNumberDispRecordForList() * showNextRecordClickNumber;
}
//refresh sort order
refreshSortTypeOrder();
var id = ClientData.userInfo_sid();
var searchText = ClientData.searchCond_searchText();
var searchDivision = ClientData.searchCond_searchDivision();
var sortType = ClientData.searchCond_sortType();
var sortOrder = ClientData.searchCond_sortOrder();
var groupId = ClientData.searchCond_groupId();
var genreId = ClientData.searchCond_genreId();
//Handle Sort disp
handleSortDisp();
//refresh Grid view
refreshGrid();
renderContent(id, searchText, searchDivision, sortType, sortOrder, recordFrom, recordTo, genreId , groupId);
}
//format text disp more record
formatDisplayMoreRecord();
//Get next record will be displayed
getNextRecordNumForList();
};
//Canvas Click function
function canvasClickFunction(e) {
if (e) {
e.preventDefault();
}
if (home_isMove == true) {
home_isMove = false;
return;
}
var contentId = $(this).attr('id');
var outputId = contentId.substring(17);
var date = new Date();
var month = date.getMonth()+1;
var day = date.getDate();
var outputDate = formatNormalDate(day, month, date.getFullYear());
var checkflag = false;
var base64String = returnThumbnail(outputId);
// Set content id for next screen
ClientData.contentInfo_contentThumbnail(base64String);
// Get image of selected image
ClientData.contentInfo_contentId(outputId);
//Check Display mode to handle action
if (isShowBookShelf != null){
if(!isShowBookShelf){
//Store Content id that user has read
if(ClientData.ReadingContentIds().length > 0){
contentIdArray = ClientData.ReadingContentIds();
for(var nIndex = 0; nIndex < contentIdArray.length; nIndex++){
if(contentIdArray[nIndex].contentid == outputId){
checkflag = true;
break;
}
else{
checkflag = false;
}
}
if(!checkflag){
contentIdArray.push({contentid: outputId, viewdate: '', originviewdate: ''});
}
}
else{
contentIdArray.push({contentid: outputId, viewdate: '', originviewdate: ''});
}
//Renew ReadingContentID
var newArray = [];
ClientData.ReadingContentIds(newArray);
//Set data for readingcontentid
ClientData.ReadingContentIds(contentIdArray);
//Set ResouceVersion for content
setResourceVersionData(outputId);
//Set MetaVersion for content
setMetaVersionData(outputId);
//Close Submenu
$('#dlgSubMenu').hide();
//Delete 'new' icon
drawEditImage(outputId);
//Open content Detail
openContentDetail();
}
else{
//Store Content id that user has read
if(ClientData.ReadingContentIds().length > 0){
contentIdArray = ClientData.ReadingContentIds();
for(var nIndex = 0; nIndex < contentIdArray.length; nIndex++){
if(contentIdArray[nIndex].contentid == outputId){
checkflag = true;
if(contentIdArray[nIndex].viewdate == null || contentIdArray[nIndex].viewdate == 'undefined' || contentIdArray[nIndex].viewdate == ''){
contentIdArray[nIndex].viewdate = outputDate;
contentIdArray[nIndex].originviewdate = date;
}
break;
}
else{
checkflag = false;
}
}
if(!checkflag){
contentIdArray.push({contentid: outputId, viewdate: outputDate, originviewdate: date});
}
}
else{
contentIdArray.push({contentid: outputId, viewdate: outputDate, originviewdate: date});
}
//Renew ReadingContentID
var newArray = [];
ClientData.ReadingContentIds(newArray);
//Set data for readingcontentid
ClientData.ReadingContentIds(contentIdArray);
//Set ResouceVersion for content
setResourceVersionData(outputId);
//Set MetaVersion for content
setMetaVersionData(outputId);
//$('body,html').animate({ scrollTop: 0 }, 0);
ClientData.IsRefresh(false);
//Go to Conten view page
avwScreenMove(ScreenIds.ContentView);
}
}else{
if(!isShowBookShelf){
//Store Content id that user has read
if(ClientData.ReadingContentIds().length > 0){
contentIdArray = ClientData.ReadingContentIds();
for(var nIndex = 0; nIndex < contentIdArray.length; nIndex++){
if(contentIdArray[nIndex].contentid == outputId){
checkflag = true;
break;
}
else{
checkflag = false;
}
}
if(!checkflag){
contentIdArray.push({contentid: outputId, viewdate: '', originviewdate: ''});
}
}
else{
contentIdArray.push({contentid: outputId, viewdate: '', originviewdate: ''});
}
//Renew ReadingContentID
var newArray = [];
ClientData.ReadingContentIds(newArray);
//Set data for readingcontentid
ClientData.ReadingContentIds(contentIdArray);
//Set ResouceVersion for content
setResourceVersionData(outputId);
//Set MetaVersion for content
setMetaVersionData(outputId);
//Close Submenu
$('#dlgSubMenu').hide();
//Delete 'new' icon
drawEditImage(outputId);
//Open content Detail
openContentDetail();
}
else{
//Store Content id that user has read
if(ClientData.ReadingContentIds().length > 0){
contentIdArray = ClientData.ReadingContentIds();
for(var nIndex = 0; nIndex < contentIdArray.length; nIndex++){
if(contentIdArray[nIndex].contentid == outputId){
checkflag = true;
if(contentIdArray[nIndex].viewdate == null || contentIdArray[nIndex].viewdate == 'undefined' || contentIdArray[nIndex].viewdate == ''){
contentIdArray[nIndex].viewdate = outputDate;
contentIdArray[nIndex].originviewdate = date;
}
break;
}
else{
checkflag = false;
}
}
if(!checkflag){
contentIdArray.push({contentid: outputId, viewdate: outputDate, originviewdate: date});
}
}
else{
contentIdArray.push({contentid: outputId, viewdate: outputDate, originviewdate: date});
}
//Renew ReadingContentID
var newArray = [];
ClientData.ReadingContentIds(newArray);
//Set data for readingcontentid
ClientData.ReadingContentIds(contentIdArray);
//Set ResouceVersion for content
setResourceVersionData(outputId);
//Set MetaVersion for content
setMetaVersionData(outputId);
//$('body,html').animate({ scrollTop: 0 }, 0);
ClientData.IsRefresh(false);
//Go to Conten view page
avwScreenMove(ScreenIds.ContentView);
}
}
};
//function Open SubMenu Dialog
function openSubMenuDialogFunction(e){
if (e) {
e.preventDefault();
}
if (home_isMove == true) {
home_isMove = false;
return;
}
var array = [e.clientX, e.clientY];
var contentid = $(this).attr('contentid');
if (isShowBookShelf != null){
if(!isShowBookShelf){
// Get image of selected image
var base64String = returnThumbnail(contentid);
ClientData.contentInfo_contentThumbnail(base64String);
ClientData.contentInfo_contentId(contentid);
//Store Content id that user has read
if(ClientData.ReadingContentIds().length > 0){
contentIdArray = ClientData.ReadingContentIds();
for(var nIndex = 0; nIndex < contentIdArray.length; nIndex++){
if(contentIdArray[nIndex].contentid == contentid){
checkflag = true;
break;
}
else{
checkflag = false;
}
}
if(!checkflag){
contentIdArray.push({contentid: contentid, viewdate: '', originviewdate: ''});
}
}
else{
contentIdArray.push({contentid: contentid, viewdate: '', originviewdate: ''});
}
//Renew ReadingContentID
var newArray = [];
ClientData.ReadingContentIds(newArray);
//Set data for readingcontentid
ClientData.ReadingContentIds(contentIdArray);
//Set ResouceVersion for content
setResourceVersionData(contentid);
//Set MetaVersion for content
setMetaVersionData(contentid);
//Close Submenu
$('#dlgSubMenu').hide();
//Delete 'new' icon
drawEditImage(contentid);
openContentDetail();
}
else if(isShowBookShelf){
$('#dialog-read').attr('contentid',contentid);
$('#dialog-detail').attr('contentid',contentid);
//$("#dlgSubMenu").dialog({position: array, width: 130, height: 90});
$("#dlgSubMenu").show();
$("#dlgSubMenu").position({ my: "left bottom",
at: "left-10 top",
of: this,
collision: "fit"
});
}
else{
$('#dialog-read').attr('contentid',contentid);
$('#dialog-detail').attr('contentid',contentid);
//$("#dlgSubMenu").dialog({position: array, width: 130, height: 90});
$("#dlgSubMenu").show();
$("#dlgSubMenu").position({ my: "left bottom",
at: "left-10 top",
of: this,
collision: "fit"
});
}
}
else{
if(!isShowBookShelf){
// Get image of selected image
var base64String = returnThumbnail(contentid);
ClientData.contentInfo_contentThumbnail(base64String);
ClientData.contentInfo_contentId(contentid);
//Store Content id that user has read
if(ClientData.ReadingContentIds().length > 0){
contentIdArray = ClientData.ReadingContentIds();
for(var nIndex = 0; nIndex < contentIdArray.length; nIndex++){
if(contentIdArray[nIndex].contentid == contentid){
checkflag = true;
break;
}
else{
checkflag = false;
}
}
if(!checkflag){
contentIdArray.push({contentid: contentid, viewdate: '', originviewdate: ''});
}
}
else{
contentIdArray.push({contentid: contentid, viewdate: '', originviewdate: ''});
}
//Renew ReadingContentID
var newArray = [];
ClientData.ReadingContentIds(newArray);
//Set data for readingcontentid
ClientData.ReadingContentIds(contentIdArray);
//Set ResouceVersion for content
setResourceVersionData(contentid);
//Set MetaVersion for content
setMetaVersionData(contentid);
//Close Submenu
$('#dlgSubMenu').hide();
//Delete 'new' icon
drawEditImage(contentid);
openContentDetail();
}
else if(isShowBookShelf){
$('#dialog-read').attr('contentid',contentid);
$('#dialog-detail').attr('contentid',contentid);
//$("#dlgSubMenu").dialog({position: array, width: 130, height: 90});
$("#dlgSubMenu").show();
$("#dlgSubMenu").position({ my: "left bottom",
at: "left-10 top",
of: this,
collision: "fit"
});
}
else{
$('#dialog-read').attr('contentid',contentid);
$('#dialog-detail').attr('contentid',contentid);
//$("#dlgSubMenu").dialog({position: array, width: 130, height: 90});
$("#dlgSubMenu").show();
$("#dlgSubMenu").position({ my: "left bottom",
at: "left-10 top",
of: this,
collision: "fit"
});
}
}
};
//Genre Click Function
function genreSelectFunction() {
$('.file').css('font-weight', 'normal');
$('.file').css('text-decoration', 'none');
$('.folder').css('font-weight', 'normal');
$('.folder').css('text-decoration', 'none');
$('#all').css('font-weight', 'bold');
$('#all').css('text-decoration', 'underline');
var recordFrom = 0;
var recordTo = 0;
if(isShowBookShelf){
recordFrom = DEFAULT_DISP_NUMBER_RECORD_FROM;
recordTo = returnNumberDispRecordForBookShelf();
}
else if(!isShowBookShelf){
recordFrom = DEFAULT_DISP_NUMBER_RECORD_FROM;
recordTo = returnNumberDispRecordForList();
}
else{
recordFrom = DEFAULT_DISP_NUMBER_RECORD_FROM;
recordTo = returnNumberDispRecordForBookShelf();
}
//ClientData.searchCond_sortOrder(DEFAULT_SORT_ORDER);
//ClientData.searchCond_sortType(DEFAULT_SORT_TYPE);
var id = ClientData.userInfo_sid();
var searchText = ClientData.searchCond_searchText();
var searchDivision = ClientData.searchCond_searchDivision();
var sortType = ClientData.searchCond_sortType();
var sortOrder = ClientData.searchCond_sortOrder();
ClientData.searchCond_groupId('');
ClientData.searchCond_genreId('');
var groupId = ClientData.searchCond_groupId();
var genreId = ClientData.searchCond_genreId();
//refresh gridview
refreshGrid();
resetShowNextRecordCount();
handleSortDisp();
renderContent(id, searchText, searchDivision, sortType, sortOrder, recordFrom, recordTo, genreId , groupId);
};
//Group Click Function
function groupSelectFunction() {
$('.file').css('font-weight', 'normal');
$('.file').css('text-decoration', 'none');
$('.folder').css('font-weight', 'normal');
$('.folder').css('text-decoration', 'none');
var firstNode = $('#list_1').find('a')[0];
$('#list_1').find(firstNode).css('text-decoration', 'underline');
$('#list_1').find(firstNode).css('font-weight', 'bold');
var recordFrom = 0;
var recordTo = 0;
if(isShowBookShelf){
recordFrom = DEFAULT_DISP_NUMBER_RECORD_FROM;
recordTo = returnNumberDispRecordForBookShelf();
}
else if(!isShowBookShelf){
recordFrom = DEFAULT_DISP_NUMBER_RECORD_FROM;
recordTo = returnNumberDispRecordForList();
}
else{
recordFrom = DEFAULT_DISP_NUMBER_RECORD_FROM;
recordTo = returnNumberDispRecordForBookShelf();
}
//ClientData.searchCond_sortOrder(DEFAULT_SORT_ORDER);
//ClientData.searchCond_sortType(DEFAULT_SORT_TYPE);
var id = ClientData.userInfo_sid();
var searchText = ClientData.searchCond_searchText();
var searchDivision = ClientData.searchCond_searchDivision();
var sortType = ClientData.searchCond_sortType();
var sortOrder = ClientData.searchCond_sortOrder();
ClientData.searchCond_groupId('');
ClientData.searchCond_genreId('');
var groupId = ClientData.searchCond_groupId();
var genreId = ClientData.searchCond_genreId();
//refresh gridview
refreshGrid();
resetShowNextRecordCount();
handleSortDisp();
renderContent(id, searchText, searchDivision, sortType, sortOrder, recordFrom, recordTo, genreId , groupId);
};
//Get Data from Category Json
function getDataJsonFileGenre(){
var params = {
sid: ClientData.userInfo_sid()
};
abapi('category', params, 'GET', function (data1) {
dataGenre = data1.categoryList;
var arrData = new Array();
var totalCount = 0;
$.each(dataGenre, function (i, value) {
// Calculate total content
totalCount += Number(dataGenre[i].contentCount);
if (dataGenre[i].parentCategoryId == 0) {
var node = new TreeNode();
//node.IsCategory = true;
node.Text = htmlEncode(dataGenre[i].categoryName);
node.id = dataGenre[i].categoryId;
node.Value = dataGenre[i].categoryId;
node.ContentCount = dataGenre[i].contentCount;
AddChidrenNodeGenre(node);
node.IsClosed = false;
node.IsCategory = node.ChildNodes.length > 0; // Has child node
arrData.push(node);
}
});
var tree1 = new TreeView();
tree1.CategoryTagName = "a";
//tree1.TotalCount = totalCount;
if (genre_totalcontent != -1) {
tree1.TotalCount = genre_totalcontent;
}
tree1.Show("list_0", arrData, "AddGenre_Callback");
$("#list_0").treeview();
$('#all').css('font-weight', 'bold');
$('#all').css('text-decoration', 'underline');
});
};
//Add Children Node Category
function AddChidrenNodeGenre(node1) {
var dataChild = [];
$.each(dataGenre, function (index, value) {
if (dataGenre[index].parentCategoryId == node1.id) {
dataChild.push(dataGenre[index]);
}
});
$.each(dataChild, function (i, value) {
var item = new TreeNode();
//item.IsCategory = true;
item.Text = htmlEncode(dataChild[i].categoryName);
item.id = dataChild[i].categoryId;
item.Value = dataChild[i].categoryId;
item.ContentCount = dataChild[i].contentCount;
AddChidrenNodeGenre(item);
item.IsCategory = item.ChildNodes.length > 0; // Has child node
node1.ChildNodes.push(item);
});
};
//Get Value for sort
function AddGenre_Callback(selectedNode) {
$('.file').css('font-weight', 'normal');
$('.file').css('text-decoration', 'none');
$('.folder').css('font-weight', 'normal');
$('.folder').css('text-decoration', 'none');
if (selectedNode.Id == "all") {
var arrAllNodes = $('.root');
for (var nIndex = 0; nIndex < arrAllNodes.length; nIndex++) {
var objTarget = $(arrAllNodes[nIndex]);
// Check treeview
if (objTarget.parent().parent().css('display') != 'none') {
objTarget.css('font-weight', 'bold');
objTarget.css('text-decoration', 'underline');
}
}
}
else {
if (selectedNode.IsCategory == true) {
var targetObj = $('#' + selectedNode.Id).parent().children()[1];
$(targetObj).css('font-weight', 'bold');
$(targetObj).css('text-decoration', 'underline');
}
else {
$('#' + selectedNode.Id).css('font-weight', 'bold');
$('#' + selectedNode.Id).css('text-decoration', 'underline');
}
}
var node = new TreeNode();
var recordFrom = 0;
var recordTo = 0;
node = selectedNode;
lCateId = node.Value;
$('#content-grid').html('');
if(isShowBookShelf){
recordFrom = DEFAULT_DISP_NUMBER_RECORD_FROM;
recordTo = returnNumberDispRecordForBookShelf();
}
else if(!isShowBookShelf){
recordFrom = DEFAULT_DISP_NUMBER_RECORD_FROM;
recordTo = returnNumberDispRecordForList();
}
else{
recordFrom = DEFAULT_DISP_NUMBER_RECORD_FROM;
recordTo = returnNumberDispRecordForBookShelf();
}
ClientData.searchCond_genreId(lCateId);
//ClientData.searchCond_sortOrder(DEFAULT_SORT_ORDER);
//ClientData.searchCond_sortType(DEFAULT_SORT_TYPE);
var id = ClientData.userInfo_sid();
var searchText = ClientData.searchCond_searchText();
var searchDivision = ClientData.searchCond_searchDivision();
var sortType = ClientData.searchCond_sortType();
var sortOrder = ClientData.searchCond_sortOrder();
var groupId = ClientData.searchCond_groupId();
var genreId = ClientData.searchCond_genreId();
//refresh gridview
refreshGrid();
resetShowNextRecordCount();
renderContent(id, searchText, searchDivision, sortType, sortOrder, recordFrom, recordTo, genreId , groupId);
handleSortDisp();
};
//Get Data from Group Json
function getDataJsonFileGroup(){
var params = {
sid: ClientData.userInfo_sid()
};
abapi('group', params, 'GET', function (data1) {
dataGroup = data1.groupList;
var arrData = new Array();
var totalCount = 0;
$.each(dataGroup, function (i, value) {
// Calculate total group
totalCount += Number(dataGroup[i].contentCount);
if (dataGroup[i].parentGroupId == 0 || dataGroup[i].groupLevel == "0") {
var node = new TreeNode();
node.IsCategory = true;
node.Text = htmlEncode(dataGroup[i].groupName);
node.id = dataGroup[i].groupId;
node.Value = dataGroup[i].groupId;
node.ContentCount = dataGroup[i].contentCount;
AddChidrenNodeGroup(node);
//node.IsClosed = false;
node.ExpandAfterBuild = true;
node.IsCategory = node.ChildNodes.length > 0; // Has child node
arrData.push(node);
}
});
var tree2 = new TreeView();
tree2.CategoryTagName = "a";
//tree1.TotalCount = totalCount;
if (group_totalcontent != -1) {
tree2.TotalCount = group_totalcontent;
}
tree2.Show("list_1", arrData, "AddGroup_Callback");
$("#list_1").treeview();
var firstNode = $('#list_1').find('a')[0];
$('#list_1').find(firstNode).css('text-decoration', 'underline');
$('#list_1').find(firstNode).css('font-weight', 'bold');
// Expand nodes
for (var nIndex = 0; nIndex < tree2.ExpandNodes.length; nIndex++) {
if ($("#" + tree2.ExpandNodes[nIndex]).parent()) {
var objParent = $("#" + tree2.ExpandNodes[nIndex]).parent();
var objChild = objParent.children()[0];
if (objChild) {
try {
objChild.click();
}
catch (err) {
// For safari
var evObj = document.createEvent('MouseEvents');
evObj.initMouseEvent('click', true, true, window);
objChild.dispatchEvent(evObj);
}
}
}
}
});
};
//Add Children Node Group
function AddChidrenNodeGroup(node1){
var dataChild = [];
$.each(dataGroup,function(index,value){
if(dataGroup[index].parentGroupId == node1.id)
{
dataChild.push(dataGroup[index]);
}
});
$.each(dataChild, function (i, value) {
var item = new TreeNode();
//item.IsCategory = true;
item.Text = htmlEncode(dataChild[i].groupName);
item.id = dataChild[i].groupId;
item.Value = dataChild[i].groupId;
item.ContentCount = dataChild[i].contentCount;
AddChidrenNodeGroup(item);
item.IsCategory = item.ChildNodes.length > 0; // Has child node
node1.ChildNodes.push(item);
});
};
//Get Value for sort
function AddGroup_Callback(selectedNode) {
$('.file').css('font-weight', 'normal');
$('.file').css('text-decoration', 'none');
$('.folder').css('font-weight', 'normal');
$('.folder').css('text-decoration', 'none');
if (selectedNode.Id == "all") {
var arrAllNodes = $('.root');
for (var nIndex = 0; nIndex < arrAllNodes.length; nIndex++) {
var objTarget = $(arrAllNodes[nIndex]);
// Check treeview
if (objTarget.parent().parent().css('display') != 'none') {
objTarget.css('font-weight', 'bold');
objTarget.css('text-decoration', 'underline');
}
}
}
else {
if (selectedNode.IsCategory == true) {
var targetObj = $('#' + selectedNode.Id).parent().children()[1];
$(targetObj).css('font-weight', 'bold');
$(targetObj).css('text-decoration', 'underline');
}
else {
$('#' + selectedNode.Id).css('font-weight', 'bold');
$('#' + selectedNode.Id).css('text-decoration', 'underline');
}
}
var node = new TreeNode();
var recordFrom = 0;
var recordTo = 0;
node = selectedNode;
lGrpId = node.Value;
$('#content-grid').html('');
if(isShowBookShelf){
recordFrom = DEFAULT_DISP_NUMBER_RECORD_FROM;
recordTo = returnNumberDispRecordForBookShelf();
}
else if(!isShowBookShelf){
recordFrom = DEFAULT_DISP_NUMBER_RECORD_FROM;
recordTo = returnNumberDispRecordForList();
}
else{
recordFrom = DEFAULT_DISP_NUMBER_RECORD_FROM;
recordTo = returnNumberDispRecordForBookShelf();
}
ClientData.searchCond_groupId(lGrpId);
//ClientData.searchCond_sortOrder(DEFAULT_SORT_ORDER);
//ClientData.searchCond_sortType(DEFAULT_SORT_TYPE);
var id = ClientData.userInfo_sid();
var searchText = ClientData.searchCond_searchText();
var searchDivision = ClientData.searchCond_searchDivision();
var sortType = ClientData.searchCond_sortType();
var sortOrder = ClientData.searchCond_sortOrder();
var groupId = ClientData.searchCond_groupId();
var genreId = ClientData.searchCond_genreId();
//refreshGrid
refreshGrid();
resetShowNextRecordCount();
renderContent(id, searchText, searchDivision, sortType, sortOrder, recordFrom, recordTo, genreId , groupId);
handleSortDisp();
};
//Re-render page from and total record
function reRenderPageNumber(dispRecord, dispTotal){
$('#dispPage').html(dispRecord);
$('#totalPage').html(dispTotal);
$('.pageNumControl').css('visibility','visible');
};
//Call API
function abapi(name, param, method, callback){
avwCmsApiSync(ClientData.userInfo_accountPath(), name, method, param, callback, null);
};
//Dialog Details Button Click
function detailsSubmenuFunction(e){
if (e) {
e.preventDefault();
}
var contentId = $(this).attr('contentid');
// Get image of selected image
var base64String = returnThumbnail(contentId);
ClientData.contentInfo_contentId(contentId);
ClientData.contentInfo_contentThumbnail(base64String);
//Store Content id that user has read
if(ClientData.ReadingContentIds().length > 0){
contentIdArray = ClientData.ReadingContentIds();
for(var nIndex = 0; nIndex < contentIdArray.length; nIndex++){
if(contentIdArray[nIndex].contentid == contentId){
checkflag = true;
break;
}
else{
checkflag = false;
}
}
if(!checkflag){
contentIdArray.push({contentid: contentId, viewdate: '', originviewdate: ''});
}
}
else{
contentIdArray.push({contentid: contentId, viewdate: '', originviewdate: ''});
}
//Renew ReadingContentID
var newArray = [];
ClientData.ReadingContentIds(newArray);
//Set data for readingcontentid
ClientData.ReadingContentIds(contentIdArray);
//Set ResouceVersion for content
setResourceVersionData(contentId);
//Set MetaVersion for content
setMetaVersionData(contentId);
// Close popup menu
$('#dlgSubMenu').hide();
//delete 'new' icon
drawEditImage(contentId);
// Show detail
openContentDetail();
};
//Dialog Read Button CLick
function readSubmenuFunction(e){
if (e) {
e.preventDefault();
}
if (home_isMove == true) {
home_isMove = false;
return;
}
var contentId = $(this).attr('contentid');
var contentThumbnail = returnThumbnail(contentId);
var date = new Date();
var month = date.getMonth()+1;
var day = date.getDate();
var outputDate = formatNormalDate(day, month, date.getFullYear());
ClientData.contentInfo_contentId(contentId);
ClientData.contentInfo_contentThumbnail(contentThumbnail);
var checkflag = false;
//Store Content id that user has read
if(ClientData.ReadingContentIds().length > 0){
contentIdArray = ClientData.ReadingContentIds();
for(var nIndex = 0; nIndex < contentIdArray.length; nIndex++){
if(contentIdArray[nIndex].contentid == contentId){
checkflag = true;
if(contentIdArray[nIndex].viewdate == '' || contentIdArray[nIndex].viewdate == null || contentIdArray[nIndex].viewdate == 'undefined'){
contentIdArray[nIndex].viewdate = outputDate;
contentIdArray[nIndex].originviewdate = date;
}
break;
}
else{
checkflag = false;
}
}
if(!checkflag){
contentIdArray.push({contentid: contentId, viewdate: outputDate, originviewdate: date});
}
}
else{
contentIdArray.push({contentid: contentId, viewdate: outputDate, originviewdate: date});
}
//Renew ReadingContentID
var newArray = [];
ClientData.ReadingContentIds(newArray);
//Set ResouceVersion for content
setResourceVersionData(contentId);
//Set MetaVersion for content
setMetaVersionData(contentId);
//Set data for readingcontentid
ClientData.ReadingContentIds(contentIdArray);
//Close Submenu
$('#dlgSubMenu').hide();
//$('body,html').animate({ scrollTop: 0 }, 0);
ClientData.IsRefresh(false);
avwScreenMove(ScreenIds.ContentView);
};
//Item Mouse Enter Event
function itemMouseEnterEvent(){
$(this).css('background-color','gray');
};
//Item Mouse Leave Event
function itemMouseLeaveEvent(){
$(this).css('background-color','white');
};
//Handle Back To Top Button
function handleBackToTop(){
if(ClientData.searchCond_recordTo() >= totalPage){
$('#control-nextrecord').css('display','none');
}
else{
$('#control-nextrecord').css('display','block');
}
if(totalPage == 0){
$('#control-nextrecord').css('display','none');
}
};
//Show Next Record Function
function showNextRecordFunction(){
$('#control-nextrecord').hide();
//Count number of click
showNextRecordClickNumber = showNextRecordClickNumber + 1;
var fromPage = ClientData.searchCond_recordFrom();
var toPage = ClientData.searchCond_recordTo();
var sortType = ClientData.searchCond_sortType();
var sortOrder = ClientData.searchCond_sortOrder();
var searchText = ClientData.searchCond_searchText();
var searchDivision = ClientData.searchCond_searchDivision();
var genreId = ClientData.searchCond_genreId();
var groupId = ClientData.searchCond_groupId();
var sid = ClientData.userInfo_sid();
var totalrecord = totalPage;
if(fromPage == null || fromPage == 'undefined'){
fromPage = DEFAULT_DISP_NUMBER_RECORD_FROM;
}
if(toPage == null || toPage == 'undefined'){
if(isShowBookShelf){
toPage = returnNumberDispRecordForBookShelf();
}
else if(!isShowBookShelf){
toPage = returnNumberDispRecordForList();
}
else{
toPage = returnNumberDispRecordForBookShelf();
}
}
fromPage = eval(toPage) + 1;
var iRecordNumber = eval(totalrecord) - eval(fromPage);
if(iRecordNumber < iNumberOfNextRecord)
{
toPage = eval(fromPage) + eval(iRecordNumber);
}
else
{
toPage = eval(fromPage) + (eval(iNumberOfNextRecord) - 1);
}
ClientData.searchCond_recordFrom(fromPage);
ClientData.searchCond_recordTo(toPage);
if(fromPage <= totalrecord)
{
renderContent(sid, searchText, searchDivision, sortType, sortOrder, fromPage, toPage, genreId, groupId);
}
};
//Sort By Title Function
function sortByTitleFunction(){
$('#control-nextrecord').hide();
//$(this).addClass('active_tops');
$('#control-sort-title').addClass('active_tops');
$('#control-sort-titlekana').removeClass('active_tops');
$('#control-sort-releasedate').removeClass('active_tops');
var sortOrder = ClientData.searchCond_sortOrder();
var sortType = ClientData.searchCond_sortType();
var sid = ClientData.userInfo_sid();
var recordFrom = DEFAULT_DISP_NUMBER_RECORD_FROM;
var recordTo = ClientData.searchCond_recordTo();
var genreId = ClientData.searchCond_genreId();
var groupId = ClientData.searchCond_groupId();
if(sortOrder == Consts.ConstOrderSetting_Asc)
{
if(sortType == 1){
sortOrder = Consts.ConstOrderSetting_Desc;
$('#title-sorttype').html('');
$('#title-sorttype').html('▼');
$('#title-sorttype').css('width', '12px');
$('#titlekana-sorttype').html('');
$('#rDate-sorttype').html('');
}
else{
sortOrder = Consts.ConstOrderSetting_Asc;
$('#title-sorttype').html('');
$('#title-sorttype').html('▲');
$('#title-sorttype').css('width', '12px');
$('#titlekana-sorttype').html('');
$('#rDate-sorttype').html('');
}
ClientData.searchCond_sortOrder(sortOrder);
}
else
{
sortOrder = Consts.ConstOrderSetting_Asc;
$('#title-sorttype').html('');
$('#title-sorttype').html('▲');
$('#title-sorttype').css('width', '12px');
$('#titlekana-sorttype').html('');
$('#rDate-sorttype').html('');
ClientData.searchCond_sortOrder(sortOrder);
}
if(recordFrom == null || recordFrom == 'undefined'){
recordFrom = DEFAULT_DISP_NUMBER_RECORD_FROM;
ClientData.searchCond_recordFrom(recordFrom);
}
if(recordTo == null || recordTo == 'undefined'){
if(isShowBookShelf){
recordTo = returnNumberDispRecordForBookShelf();
}
else if(!isShowBookShelf){
recordTo = returnNumberDispRecordForList();
}
else{
recordTo = returnNumberDispRecordForBookShelf();
}
ClientData.searchCond_recordFrom(recordTo);
}
sortType = 1;
ClientData.searchCond_sortType(sortType);
//refresh Gridview
refreshGrid();
renderContent(sid, ClientData.searchCond_searchText(), ClientData.searchCond_searchDivision(), sortType, sortOrder, recordFrom, recordTo, genreId, groupId);
};
//Sort By Title Kana function
function sortByTitleKanaFunction(){
$('#control-nextrecord').hide();
$('#control-sort-titlekana').addClass('active_tops');
$('#control-sort-title').removeClass('active_tops');
$('#control-sort-releasedate').removeClass('active_tops');
var sortOrder = ClientData.searchCond_sortOrder();
var sortType = ClientData.searchCond_sortType();
var sid = ClientData.userInfo_sid();
var recordFrom = DEFAULT_DISP_NUMBER_RECORD_FROM;
var recordTo = ClientData.searchCond_recordTo();
var genreId = ClientData.searchCond_genreId();
var groupId = ClientData.searchCond_groupId();
if(sortOrder == Consts.ConstOrderSetting_Asc)
{
if(sortType == 2){
sortOrder = Consts.ConstOrderSetting_Desc;
$('#title-sorttype').html('');
$('#titlekana-sorttype').html('');
$('#titlekana-sorttype').html('▼');
$('#titlekana-sorttype').css('width', '12px');
$('#rDate-sorttype').html('');
}
else{
sortOrder = Consts.ConstOrderSetting_Asc;
$('#title-sorttype').html('');
$('#titlekana-sorttype').html('');
$('#titlekana-sorttype').html('▲');
$('#titlekana-sorttype').css('width', '12px');
$('#rDate-sorttype').html('');
}
ClientData.searchCond_sortOrder(sortOrder);
}
else
{
sortOrder = Consts.ConstOrderSetting_Asc;
$('#title-sorttype').html('');
$('#titlekana-sorttype').html('');
$('#titlekana-sorttype').html('▲');
$('#titlekana-sorttype').css('width', '12px');
$('#rDate-sorttype').html('');
ClientData.searchCond_sortOrder(sortOrder);
}
if(recordFrom == null || recordFrom == 'undefined'){
recordFrom = DEFAULT_DISP_NUMBER_RECORD_FROM;
ClientData.searchCond_recordFrom(recordFrom);
}
if(recordTo == null || recordTo == 'undefined'){
if(isShowBookShelf){
recordTo = returnNumberDispRecordForBookShelf();
}
else if(!isShowBookShelf){
recordTo = returnNumberDispRecordForList();
}
else{
recordTo = returnNumberDispRecordForBookShelf();
}
ClientData.searchCond_recordFrom(recordTo);
}
sortType = 2;
//refresh gridview
refreshGrid();
ClientData.searchCond_sortType(sortType);
renderContent(sid, ClientData.searchCond_searchText(), ClientData.searchCond_searchDivision(), sortType, sortOrder, recordFrom, recordTo, genreId, groupId);
};
//Sort By Release Date
function sortByReleaseDateFunction(){
$('#control-nextrecord').hide();
//$(this).addClass('active_tops');
$('#control-sort-releasedate').addClass('active_tops');
$('#control-sort-title').removeClass('active_tops');
$('#control-sort-titlekana').removeClass('active_tops');
var sortOrder = ClientData.searchCond_sortOrder();
var sortType = ClientData.searchCond_sortType();
var sid = ClientData.userInfo_sid();
var recordFrom = DEFAULT_DISP_NUMBER_RECORD_FROM;
var recordTo = ClientData.searchCond_recordTo();
var genreId = ClientData.searchCond_genreId();
var groupId = ClientData.searchCond_groupId();
if(sortOrder == Consts.ConstOrderSetting_Asc)
{
if(sortType == 3){
sortOrder = Consts.ConstOrderSetting_Desc;
$('#title-sorttype').html('');
$('#titlekana-sorttype').html('');
$('#rDate-sorttype').html('');
$('#rDate-sorttype').html('▼');
$('#rDate-sorttype').css('width', '12px');
}
else{
sortOrder = Consts.ConstOrderSetting_Asc;
$('#title-sorttype').html('');
$('#titlekana-sorttype').html('');
$('#rDate-sorttype').html('');
$('#rDate-sorttype').html('▲');
$('#rDate-sorttype').css('width', '12px');
}
ClientData.searchCond_sortOrder(sortOrder);
}
else
{
sortOrder = Consts.ConstOrderSetting_Asc;
$('#title-sorttype').html('');
$('#titlekana-sorttype').html('');
$('#rDate-sorttype').html('');
$('#rDate-sorttype').html('▲');
$('#rDate-sorttype').css('width', '12px');
ClientData.searchCond_sortOrder(sortOrder);
}
if(recordFrom == null || recordFrom == 'undefined'){
recordFrom = DEFAULT_DISP_NUMBER_RECORD_FROM;
ClientData.searchCond_recordFrom(recordFrom);
}
if(recordTo == null || recordTo == 'undefined'){
if(isShowBookShelf){
recordTo = returnNumberDispRecordForBookShelf();
}
else if(!isShowBookShelf){
recordTo = returnNumberDispRecordForList();
}
else{
recordTo = returnNumberDispRecordForBookShelf();
}
ClientData.searchCond_recordFrom(recordTo);
}
sortType = 3;
//refresh gridview
refreshGrid();
ClientData.searchCond_sortType(sortType);
renderContent(sid, ClientData.searchCond_searchText(), ClientData.searchCond_searchDivision(), sortType, sortOrder, recordFrom, recordTo, genreId, groupId);
};
//Handle language
function handleLanguage(){
//if(ClientData.userInfo_language() == Consts.ConstLanguage_En || ClientData.userInfo_language() == Consts.ConstLanguage_Ko)
if (getCurrentLanguage() == Consts.ConstLanguage_En || getCurrentLanguage() == Consts.ConstLanguage_Ko)
{
$('#control-sort-titlekana').css('display','none');
$('#separate').css('display', 'none');
//$("#titlekana-sorttype").hide();
$('#titlekana-sorttype').html('');
}
else
{
$('#control-sort-titlekana').css('display','block');
$('#separate').css('display', 'block');
if (ClientData.searchCond_sortOrder() != null && ClientData.searchCond_sortOrder() != 'undefined' || ClientData.searchCond_sortType() != '') {
var typeSort = ClientData.searchCond_sortType();
var orderSort = ClientData.searchCond_sortOrder();
if (typeSort == 2) {
if (orderSort == Consts.ConstOrderSetting_Asc) {
$('#titlekana-sorttype').html('');
$('#titlekana-sorttype').html('▲');
$('#titlekana-sorttype').css('width', '12px');
}
else {
$('#titlekana-sorttype').html('');
$('#titlekana-sorttype').html('▼');
$('#titlekana-sorttype').css('width', '12px');
}
}
}
}
};
///Render Content
function renderContent(id, text, division, type, order, from, to, cateid, grpid){
var params = {
sid: id,
searchText: text,
searchDivision: division,
sortType: type,
sortOrder: order,
recordFrom: from,
recordTo: to,
genreId: cateid,
groupId: grpid
};
abapi('webContentList', params, 'POST', function (data) {
var countCnt = 0;
$.each(data.contentList, function (i, post) {
var outputDate = formatDeliveryDate(post.contentDeliveryDate);
if (isShowBookShelf == null){
if (ClientData.sortOpt_viewMode() == Consts.ConstDisplayMode_BookShelf) {
$('#content-grid').append(
'<section class="sectionhomebookshelf" id="bookshelf' + post.contentId + '">'
+ ' <div class="cnt_section_bookshelf">'
+ ' <div class="img">'
+ ' <canvas height="170px" width="170px" id="content-thumbnail' + post.contentId + '" contentid="' + post.contentId + '" style="display:none;">'
+ ' </canvas>'
+ ' </div>'
+ ' <img id="loadingIcon' + post.contentId + '" src="./img/data_loading.gif" height="25px" width="25px" style="padding: 86px; "/>'
+ ' </div>'
+ ' <a id="title' + post.contentId + '" class="dialog name lang" lang="lblTitle" contentid="' + post.contentId + '">' + truncate(htmlEncode(post.contentTitle), 20) + '</a>'
+ '</section>'
);
if((home_realTotalRecord + i+1) % 3 == 0){
$('#bookshelf' + post.contentId).addClass('no_m_right');
}
getNextRecordNumForBookShelf();
}
// else if (ClientData.sortOpt_viewMode() == Consts.ConstDisplayMode_List) {
else if (ClientData.sortOpt_viewMode() == Consts.ConstDisplayMode_List) {
$('#content-grid').append(
'<section class="sectionhomelist">'
+ ' <div class="cnt_section_list">'
+ ' <a class="img">'
+ ' <canvas height="105px" width="150px" id="content-thumbnail' + post.contentId + '" contentid="' + post.contentId + '" style="display:none;">'
+ ' </canvas>'
+ ' <img id="loadingIcon' + post.contentId + '" src="./img/data_loading.gif" height="25px" width="25px" style="padding: 46px; "/>'
+ ' </a>'
+ ' <div class="text">'
+ ' <a id="title' + post.contentId + '" class="name dialog" contentid="' + post.contentId + '">' + truncate(htmlEncode(post.contentTitle), 20) + '</a>'
+ ' <div class="info">'
+ ' <ul class="date">'
+ ' <li><span class="lang" lang="txtPubDt"> </span> : ' + outputDate + '</li>'
+ ' <li><span class="lang" lang="txtViewDt"> </span>:<span id="lblVdate' + post.contentId + '"> </span></li>'
+ ' </ul>'
+ ' <ul class="pic">'
+ ' <li><img src="' + DEFAULT_IMG_OPTION_MEMO + '" id="imgMemo' + post.contentId + '" class="sticker" /></li>'
+ ' <li><img src="' + DEFAULT_IMG_OPTION_MARKING + '" id="imgBookMark' + post.contentId + '" class="pen" /></li>'
+ ' <li><a class="read lang button-details" contentid="' + post.contentId + '" lang="txtRead">読む</a></li>'
+ ' </ul>'
+ ' </div>'
+ ' </div>'
+ ' </div>'
+ '</section>'
);
getNextRecordNumForList();
}
else {
alert('ok');
// $('#content-grid').append(
// '<section class="sectionhomebookshelf">'
// + ' <div class="cnt_section_bookshelf">'
// + ' <div class="img">'
// + ' <canvas height="170px" width="170px" id="content-thumbnail' + post.contentId + '" contentid="' + post.contentId + '">'
// + ' </canvas>'
// + ' </div>'
// + ' </div>'
// + ' <a id="title' + post.contentId + '" class="dialog name lang" lang="lblTitle" contentid="' + post.contentId + '">' + truncate(htmlEncode(post.contentTitle), 20) + '</a>'
// + '</section>'
// );
// if (i == (eval(countCnt) + 2)) {
// $('#bookshelf' + post.contentId).addClass('no_m_right');
// countCnt = i;
// }
// getNextRecordNumForBookShelf();
}
}else{
// if (ClientData.sortOpt_viewMode() == Consts.ConstDisplayMode_BookShelf) { if (isShowBookShelf) {
$('#content-grid').append(
'<section class="sectionhomebookshelf" id="bookshelf' + post.contentId + '">'
+ ' <div class="cnt_section_bookshelf">'
+ ' <div class="img">'
+ ' <canvas height="170px" width="170px" id="content-thumbnail' + post.contentId + '" contentid="' + post.contentId + '" style="display:none;">'
+ ' </canvas>'
+ ' </div>'
+ ' <img id="loadingIcon' + post.contentId + '" src="./img/data_loading.gif" height="25px" width="25px" style="padding: 86px; "/>'
+ ' </div>'
+ ' <a id="title' + post.contentId + '" class="dialog name lang" lang="lblTitle" contentid="' + post.contentId + '">' + truncate(htmlEncode(post.contentTitle), 20) + '</a>'
+ '</section>'
);
if((home_realTotalRecord + i+1) % 3 == 0){
$('#bookshelf' + post.contentId).addClass('no_m_right');
}
getNextRecordNumForBookShelf();
}
// else if (ClientData.sortOpt_viewMode() == Consts.ConstDisplayMode_List) { else if (!isShowBookShelf) {
$('#content-grid').append(
'<section class="sectionhomelist">'
+ ' <div class="cnt_section_list">'
+ ' <a class="img">'
+ ' <canvas height="105px" width="150px" id="content-thumbnail' + post.contentId + '" contentid="' + post.contentId + '" style="display:none;">'
+ ' </canvas>'
+ ' <img id="loadingIcon' + post.contentId + '" src="./img/data_loading.gif" height="25px" width="25px" style="padding: 46px; "/>'
+ ' </a>'
+ ' <div class="text">'
+ ' <a id="title' + post.contentId + '" class="name dialog" contentid="' + post.contentId + '">' + truncate(htmlEncode(post.contentTitle), 20) + '</a>'
+ ' <div class="info">'
+ ' <ul class="date">'
+ ' <li><span class="lang" lang="txtPubDt"> </span> : ' + outputDate + '</li>'
+ ' <li><span class="lang" lang="txtViewDt"> </span>:<span id="lblVdate' + post.contentId + '"> </span></li>'
+ ' </ul>'
+ ' <ul class="pic">'
+ ' <li><img src="' + DEFAULT_IMG_OPTION_MEMO + '" id="imgMemo' + post.contentId + '" class="sticker" /></li>'
+ ' <li><img src="' + DEFAULT_IMG_OPTION_MARKING + '" id="imgBookMark' + post.contentId + '" class="pen" /></li>'
+ ' <li><a class="read lang button-details" contentid="' + post.contentId + '" lang="txtRead">読む</a></li>'
+ ' </ul>'
+ ' </div>'
+ ' </div>'
+ ' </div>'
+ '</section>'
);
getNextRecordNumForList();
}
else {
//alert('ok');
// $('#content-grid').append(
// '<section class="sectionhomebookshelf">'
// + ' <div class="cnt_section_bookshelf">'
// + ' <div class="img">'
// + ' <canvas height="170px" width="170px" id="content-thumbnail' + post.contentId + '" contentid="' + post.contentId + '">'
// + ' </canvas>'
// + ' </div>'
// + ' </div>'
// + ' <a id="title' + post.contentId + '" class="dialog name lang" lang="lblTitle" contentid="' + post.contentId + '">' + truncate(htmlEncode(post.contentTitle), 20) + '</a>'
// + '</section>'
// );
// if (i == (eval(countCnt) + 2)) {
// $('#bookshelf' + post.contentId).addClass('no_m_right');
// countCnt = i;
// }
// getNextRecordNumForBookShelf();
}
}
//assign thumbnail to array
arrayTemp.push({ contentId: post.contentId, thumbnail: formatStringBase64(post.contentThumbnail) });
//Check if user has read this content or not.
checkUserHasReadContent(post.contentId, post.resourceVersion, post.metaVersion);
//assign version to array
resourceVersionArr.push({ contentid: post.contentId, resourceversion: post.resourceVersion });
//assign meta version to array
metaVersionArr.push({ contentid: post.contentId, metaversion: post.metaVersion });
//Check if content has marking or memo
checkContentMarkingMemoOption(post.contentId);
//renderViewDate
var viewdate = renderViewDate(post.contentId);
if (viewdate != null || viewdate != 'undefined') {
$('#lblVdate' + post.contentId).html(viewdate);
}
});
home_realTotalRecord += data.contentList.length;
// Save total record for tree:genere/group
if (cateid == '' && grpid == '') {
if (genre_totalcontent == -1) {
genre_totalcontent = data.totalRecord;
}
if (group_totalcontent == -1) {
group_totalcontent = data.totalRecord;
}
}
if (data.totalRecord < data.recordTo) {
ClientData.searchCond_recordTo(data.totalRecord);
} else {
ClientData.searchCond_recordTo(data.recordTo);
}
ClientData.searchCond_recordFrom(data.recordFrom);
totalPage = data.totalRecord;
reRenderPageNumber(ClientData.searchCond_recordTo(), totalPage);
//Toggle scroll to top Control
handleBackToTop();
//changeLanguage(ClientData.userInfo_language());
i18nReplaceText();
});
};
var genre_totalcontent = -1;
var group_totalcontent = -1;
//Initial Screen
function renderGridView(){
var fromPage = DEFAULT_DISP_NUMBER_RECORD_FROM;
var toPage = 0;
var sortType = DEFAULT_SORT_TYPE;
var sortOrder = DEFAULT_SORT_ORDER;
var searchText = '';
var searchDivision = DEFAULT_SEARCH_DIVISION;
var genreId = '';
var groupId = '';
var sid = ClientData.userInfo_sid();
ClientData.searchCond_recordFrom(fromPage);
if(isShowBookShelf){
toPage = returnNumberDispRecordForBookShelf();
}
else if(!isShowBookShelf){
toPage = returnNumberDispRecordForList();
}
else{
toPage = returnNumberDispRecordForBookShelf();
}
ClientData.searchCond_recordTo(toPage);
ClientData.searchCond_sortType(sortType);
ClientData.searchCond_sortOrder(sortOrder);
ClientData.searchCond_searchText(searchText);
ClientData.searchCond_searchDivision(searchDivision);
ClientData.searchCond_genreId(genreId);
ClientData.searchCond_groupId(groupId);
//Language Handle
handleLanguage();
//handle
handleSortDisp();
//Refresh GridView
refreshGrid();
resetShowNextRecordCount();
//Render Gridview
renderContent(sid, searchText, searchDivision, sortType, sortOrder, fromPage, toPage, genreId, groupId);
};
//Get Thumnail base on contentid
function returnThumbnail(contentid){
for(var i = 0; i < arrayTemp.length; i++){
if(arrayTemp[i].contentId == contentid){
return arrayTemp[i].thumbnail;
}
}
};
//Check if Content Has marking or memo
function checkContentMarkingMemoOption(contentId){
if(!isShowBookShelf){
//Check if contentid has marking
if(ClientData.MarkingData().length == 0){
$('#imgBookMark'+contentId).css('visibility','hidden');
}
else{
for (var nIndex1 = 0; nIndex1 < ClientData.MarkingData().length; nIndex1++) {
if (ClientData.MarkingData()[nIndex1].contentid == contentId) {
$('#imgBookMark'+contentId).css('visibility','visible');
break;
}
else{
$('#imgBookMark'+contentId).css('visibility','hidden');
}
}
}
if(ClientData.MemoData().length == 0){
$('#imgMemo'+contentId).css('visibility','hidden');
}
else{
// Check if contentid has memo
for (var nIndex1 = 0; nIndex1 < ClientData.MemoData().length; nIndex1++) {
if (ClientData.MemoData()[nIndex1].contentid == contentId) {
$('#imgMemo'+contentId).css('visibility','visible');
break;
}
else
{
$('#imgMemo'+contentId).css('visibility','hidden');
}
}
}
}
};
//Check if User has read content
function checkUserHasReadContent(contId, resourceVer, metaVer){
var imgThumb = new Image();
//imgThumb.src = returnThumbnail(contId);
var imgIconNew = new Image();
//imgIconNew.src = DEFAULT_IMG_CONTENT_NEW;
var imgIconEdit = new Image();
//imgIconEdit.src = DEFAULT_IMG_CONTENT_EDIT;
var c = document.getElementById('content-thumbnail'+contId);
var ctx = c.getContext('2d');
var readFlg = false;
var versionArr = ClientData.ResourceVersion();
var metaArr = ClientData.MetaVersion();
var readArr = ClientData.ReadingContentIds();
if(readArr == null || readArr <= 0 || readArr == 'undefined'){
imgThumb.onload = function () {
var resizeImg = resizeResourceThumbnail(imgThumb, c.width, c.height);
ctx.drawImage(imgThumb, c.width / 2 - resizeImg[0] / 2, 0, resizeImg[0], resizeImg[1]);
imgIconNew.onload = function () {
ctx.drawImage(imgIconNew, c.width / 2 - resizeImg[0] / 2, 0);
$("#loadingIcon" + contId).fadeOut('slow', function () {
$('#content-thumbnail' + contId).fadeIn('slow');
});
};
imgIconNew.src = DEFAULT_IMG_CONTENT_NEW;
};
imgThumb.src = returnThumbnail(contId);
}
else{
//Check if user has read this content or not
for (var nIndex1 = 0; nIndex1 < ClientData.ReadingContentIds().length; nIndex1++) {
if(ClientData.ReadingContentIds()[nIndex1].contentid == contId){
imgThumb.onload = function(){
var resizeImg = resizeResourceThumbnail(imgThumb, c.width, c.height);
ctx.drawImage(imgThumb, c.width / 2 - resizeImg[0] / 2, 0, resizeImg[0], resizeImg[1]);
$("#loadingIcon" + contId).fadeOut('slow', function () {
$('#content-thumbnail' + contId).fadeIn('slow');
});
};
imgThumb.src = returnThumbnail(contId);
readFlg = true;
break;
}
else{
imgThumb.onload = function(){
var resizeImg = resizeResourceThumbnail(imgThumb, c.width, c.height);
ctx.drawImage(imgThumb, c.width/2 - resizeImg[0]/2, 0, resizeImg[0], resizeImg[1]);
imgIconNew.onload = function(){
ctx.drawImage(imgIconNew, c.width / 2 - resizeImg[0] / 2, 0);
$("#loadingIcon" + contId).fadeOut('slow', function () {
$('#content-thumbnail' + contId).fadeIn('slow');
});
};
imgIconNew.src = DEFAULT_IMG_CONTENT_NEW;
};
imgThumb.src = returnThumbnail(contId);
}
}
}
//Check if resource version has change
if(readFlg){
if(versionArr == null || versionArr <= 0 || versionArr == 'undefined'){
}
else{
for(var nIndex2 = 0; nIndex2 < versionArr.length; nIndex2++){
if(versionArr[nIndex2].contentid == contId){
if (versionArr[nIndex2].resourceversion != resourceVer) {
imgThumb.onload = function () {
var resizeImg = resizeResourceThumbnail(imgThumb, c.width, c.height);
ctx.drawImage(imgThumb, c.width / 2 - resizeImg[0] / 2, 0, resizeImg[0], resizeImg[1]);
imgIconEdit.onload = function () {
ctx.drawImage(imgIconEdit, c.width / 2 - resizeImg[0] / 2, 0);
$("#loadingIcon" + contId).fadeOut('slow', function () {
$('#content-thumbnail' + contId).fadeIn('slow');
});
};
imgIconEdit.src = DEFAULT_IMG_CONTENT_EDIT;
};
imgThumb.src = returnThumbnail(contId);
break;
}
}
}
}
if(metaArr == null || metaArr <= 0 || metaArr == 'undefined'){
}
else{
for(var nIndex2 = 0; nIndex2 < metaArr.length; nIndex2++){
if(metaArr[nIndex2].contentid == contId){
if (metaArr[nIndex2].metaversion != metaVer) {
imgThumb.onload = function () {
var resizeImg = resizeResourceThumbnail(imgThumb, c.width, c.height);
ctx.drawImage(imgThumb, c.width / 2 - resizeImg[0] / 2, 0, resizeImg[0] , resizeImg[1]);
imgIconEdit.onload = function () {
ctx.drawImage(imgIconEdit, c.width / 2 - resizeImg[0] / 2, 0);
$("#loadingIcon" + contId).fadeOut('slow', function () {
$('#content-thumbnail' + contId).fadeIn('slow');
});
};
imgIconEdit.src = DEFAULT_IMG_CONTENT_EDIT;
};
imgThumb.src = returnThumbnail(contId);
break;
}
}
}
}
readFlg = false;
}
};
//draw Edit Image
function drawEditImage(id){
var img = new Image();
img.src = returnThumbnail(id);
var c = document.getElementById('content-thumbnail'+id);
//use getContext to use the canvas for drawing
var ctx = c.getContext('2d');
img.onload = function(){
var resizeImg = resizeResourceThumbnail(img, c.width, c.height);
ctx.drawImage(img, c.width / 2 - resizeImg[0] / 2, 0, resizeImg[0], resizeImg[1]);
$("#loadingIcon" + id).fadeOut('slow', function () {
$('#content-thumbnail' + id).fadeIn('slow');
});
};
};
//Render User view date
function renderViewDate(id){
for(var i = 0; i < ClientData.ReadingContentIds().length; i++){
if(ClientData.ReadingContentIds()[i].contentid == id){
return ClientData.ReadingContentIds()[i].viewdate;
}
}
};
//set resource version data
function setResourceVersionData(conId){
var tempResourceArr;
var tempResource;
//check if insert new or edit
var flag = false;
if(ClientData.ResourceVersion().length <= 0 || ClientData.ResourceVersion() == null || ClientData.ResourceVersion() == 'undefined'){
tempResourceArr = [];
}
else{
tempResourceArr = ClientData.ResourceVersion();
}
for(var i = 0; i < resourceVersionArr.length; i++){
if(resourceVersionArr[i].contentid == conId){
tempResource = resourceVersionArr[i].resourceversion;
break;
}
}
if(tempResourceArr.length > 0){
for(var j = 0; j < tempResourceArr.length; j++){
if(tempResourceArr[j].contentid == conId){
tempResourceArr[j].resourceversion = tempResource;
flag = true;
break;
}
else{
flag = false;
}
}
if(!flag){
tempResourceArr.push({contentid: conId, resourceversion: tempResource});
}
}else{
tempResourceArr.push({contentid: conId, resourceversion: tempResource});
}
ClientData.ResourceVersion(tempResourceArr);
};
//set meta Version Data
function setMetaVersionData(conId){
var tempMetaArr;
var tempMeta;
//check if insert new or edit
var flag = false;
if(ClientData.MetaVersion().length <= 0 || ClientData.MetaVersion() == null || ClientData.MetaVersion() == 'undefined'){
tempMetaArr = [];
}
else{
tempMetaArr = ClientData.MetaVersion();
}
for(var i = 0; i < metaVersionArr.length; i++){
if(metaVersionArr[i].contentid == conId){
tempMeta = metaVersionArr[i].metaversion;
break;
}
}
if(tempMetaArr.length > 0){
for(var j = 0; j < tempMetaArr.length; j++){
if(tempMetaArr[j].contentid == conId){
tempMetaArr[j].metaversion = tempMeta;
flag = true;
break;
}
else{
flag = false;
}
}
if(!flag){
tempMetaArr.push({contentid: conId, metaversion: tempMeta});
}
}else{
tempMetaArr.push({contentid: conId, metaversion: tempMeta});
}
ClientData.MetaVersion(tempMetaArr);
};
//handle display sort direction
function handleSortDisp(){
$('#control-sort-title').removeClass('active_tops');
$('#control-sort-titlekana').removeClass('active_tops');
$('#control-sort-releasedate').removeClass('active_tops');
var typeSort;
var orderSort;
if(ClientData.searchCond_sortType() == null || ClientData.searchCond_sortType() == 'undefined' || ClientData.searchCond_sortType() == ''){
$('#title-sorttype').html('');
$('#title-sorttype').html('');
$('#titlekana-sorttype').html('');
$('#rDate-sorttype').html('');
}
else{
if(ClientData.searchCond_sortOrder() != null && ClientData.searchCond_sortOrder() != 'undefined' || ClientData.searchCond_sortType() != ''){
typeSort = ClientData.searchCond_sortType();
orderSort = ClientData.searchCond_sortOrder();
if(typeSort == 1){
if(orderSort == Consts.ConstOrderSetting_Asc){
$('#title-sorttype').html('');
$('#title-sorttype').html('▲');
$('#title-sorttype').css('width', '12px');
$('#titlekana-sorttype').html('');
$('#rDate-sorttype').html('');
}
else{
$('#title-sorttype').html('');
$('#title-sorttype').html('▼');
$('#title-sorttype').css('width', '12px');
$('#titlekana-sorttype').html('');
$('#rDate-sorttype').html('');
}
$('#control-sort-title').addClass('active_tops');
}
else if(typeSort == 2){
if(orderSort == Consts.ConstOrderSetting_Asc){
$('#title-sorttype').html('');
$('#titlekana-sorttype').html('');
$('#titlekana-sorttype').html('▲');
$('#titlekana-sorttype').css('width', '12px');
$('#rDate-sorttype').html('');
}
else{
$('#title-sorttype').html('');
$('#titlekana-sorttype').html('');
$('#titlekana-sorttype').html('▼');
$('#titlekana-sorttype').css('width', '12px');
$('#rDate-sorttype').html('');
}
$('#control-sort-titlekana').addClass('active_tops');
}
else if(typeSort == 3){
if(orderSort == Consts.ConstOrderSetting_Asc){
$('#title-sorttype').html('');
$('#titlekana-sorttype').html('');
$('#rDate-sorttype').html('');
$('#rDate-sorttype').html('▲');
$('#rDate-sorttype').css('width', '12px');
}
else{
$('#title-sorttype').html('');
$('#titlekana-sorttype').html('');
$('#rDate-sorttype').html('');
$('#rDate-sorttype').html('▼');
$('#rDate-sorttype').css('width', '12px');
}
$('#control-sort-releasedate').addClass('active_tops');
}
}
}
};
//convert delivery Date
function formatDeliveryDate(date){
var day = date.date;
var month = eval(date.month) + 1;
var year = eval(date.year) + 1900;
var outputDate = year + '/' + ((''+month).length<2 ? '0' : '') + month + '/' + ((''+day).length<2 ? '0' : '') + day;
return outputDate;
};
//convert view Date
function formatNormalDate(day, month, year){
var outputDate = year + '/' + ((''+month).length<2 ? '0' : '') + month + '/' + ((''+day).length<2 ? '0' : '') + day;
return outputDate;
};
//format Image string
function formatStringBase64(imgStr){
var outputString = 'data:image/jpeg;base64,'+imgStr;
return outputString;
};
//Get Number Disp Record For List
function returnNumberDispRecordForBookShelf(){
var toPage = 0;
var sysSettings = avwSysSetting();
toPage = sysSettings.bookShelfCount;
return toPage;
};
//Get Number Disp Record For List
function returnNumberDispRecordForList() {
var toPage = 0;
var sysSettings = avwSysSetting();
toPage = sysSettings.bookListCount;
return toPage;
};
//Get number record disp next for list
function getNextRecordNumForList(){
iNumberOfNextRecord = returnNumberDispRecordForList();
};
//Get number record disp next for bookshelf
function getNextRecordNumForBookShelf(){
iNumberOfNextRecord = returnNumberDispRecordForBookShelf();
};
//refresh sort order
function refreshSortTypeOrder(){
$('#title-sorttype').html('');
$('#titlekana-sorttype').html('');
$('#rDate-sorttype').html('');
$('#rDate-sorttype').html('');
};
//refresh GridView
function refreshGrid(){
$('#control-nextrecord').hide();
$('#content-grid').html('');
$('.pageNumControl').css('visibility','hidden');
};
//format text display more record
function formatDisplayMoreRecord(){
//changeLanguage(ClientData.userInfo_language());
i18nReplaceText();
if(isShowBookShelf){
$('#control-nextrecord').html(format(i18nText('dspViewMore'), returnNumberDispRecordForBookShelf()).toString());
}
else if(!isShowBookShelf){
$('#control-nextrecord').html(format(i18nText('dspViewMore'), returnNumberDispRecordForList()));
}
else {
$('#control-nextrecord').html(format(i18nText('dspViewMore'), returnNumberDispRecordForBookShelf()));
}
};
/*
Check content whether existed or not
*/
function IsExistContent(strContentId) {
var isExisted = true;
var params = {
sid: ClientData.userInfo_sid(),
getType: '1',
contentId: strContentId
};
avwCmsApiSync(ClientData.userInfo_accountPath(), "webGetContent", 'GET', params,
function (data) {
isExisted = true;
},
function (xmlHttpRequest, txtStatus, errorThrown) {
if (xmlHttpRequest.status == 404) {
isExisted = false;
}
else {
// Show system error
isExisted = true; // Mark this flag to prevent bookmarks from deleting
showSystemError();
}
});
return isExisted;
};
function syncReadingContent(){
var readArr = ClientData.ReadingContentIds();
var metaArr = ClientData.MetaVersion();
var resourceArr = ClientData.ResourceVersion();
for (var i = readArr.length - 1; i >= 0; i--) {
var readContent = readArr[i];
if (!IsExistContent(readContent.contentid)) {
errorContent.push({ contentid: readContent.contentid });
readArr.splice(i, 1);
metaArr.splice(i, 1);
resourceArr.splice(i, 1);
}
// Do not process next
if (avwHasError()) {
return;
}
}
ClientData.ReadingContentIds(readArr);
ClientData.MetaVersion(metaArr);
ClientData.ResourceVersion(resourceArr);
};
function syncBookmarkContent(){
var arrBookmark = ClientData.BookMarkData();
for(var j = arrBookmark.length - 1; j >= 0; j--){
var bookmark = arrBookmark[j];
if(isErrorContent(bookmark.contentid)){
arrBookmark.splice(j, 1);
}
else {
if(!IsExistContent(bookmark.contentid)){
errorContent.push({contentid: bookmark.contentid});
arrBookmark.splice(j, 1);
ClientData.isChangedBookmark(true);
}
}
}
ClientData.BookMarkData(arrBookmark);
};
function syncMemoContent(){
var arrMemo = ClientData.MemoData();
for(var j = arrMemo.length - 1; j >= 0; j--){
var memo = arrMemo[j];
if(isErrorContent(memo.contentid)){
arrMemo.splice(j, 1);
}
else {
if(!IsExistContent(memo.contentid)){
errorContent.push({contentid: memo.contentid});
arrMemo.splice(j, 1);
ClientData.isChangedMemo(true);
}
}
}
ClientData.MemoData(arrMemo);
};
function syncMarkingContent(){
var arrMarking = ClientData.MarkingData();
for(var j = arrMarking.length - 1; j >= 0; j--){
var marking = arrMarking[j];
if(isErrorContent(marking.contentid)){
arrMarking.splice(j, 1);
}
else {
if(!IsExistContent(marking.contentid)){
errorContent.push({contentid: marking.contentid});
arrMarking.splice(j, 1);
ClientData.isChangedMarkingData(true);
}
}
}
ClientData.MarkingData(arrMarking);
};
function syncContentData(){
if(ClientData.common_contentDataChkFlg() == 'true'){
syncReadingContent();
syncBookmarkContent();
syncMemoContent();
syncMarkingContent();
getExistContentPages();
SyncMemoPages();
SyncMarkingPages();
ClientData.common_contentDataChkFlg(false);
}
};
function isErrorContent(contentid){
for(var j = errorContent.length - 1; j >= 0; j--){
var contentErr = errorContent[j];
if(contentid == contentErr.contentid){
return true;
}
else{
return false;
}
}
};
function getExistContentPages(){
var memoArr = ClientData.MemoData();
var markingArr = ClientData.MarkingData();
for(var i = 0; i < memoArr.length; i++){
var memo = memoArr[i];
existContent.push({contentid: memo.contentid });
}
for(var i = 0; i < markingArr.length; i++){
var marking = markingArr[i];
existContent.push({contentid: marking.contentid});
}
};
function SyncMemoPages() {
var arrMemo = ClientData.MemoData();
for (var nIndex = 0; nIndex < existContent.length; nIndex++) {
// Get one content
var oneContent = existContent[nIndex];
var params = {
sid: ClientData.userInfo_sid(),
contentId: oneContent.contentid,
thumbnailFlg: 0
};
var webContentPage;
// Get all pages of content
avwCmsApiSync(ClientData.userInfo_accountPath(), "webContentPage", 'GET', params,
function (data) {
// Success
if (data.pages) {
webContentPage = data.pages;
}
}, null);
if (webContentPage) {
if (webContentPage.length > 0) {
for (var nIndex1 = arrMemo.length - 1; nIndex1 >= 0 ; nIndex1--) {
// Get one bookmar entity
var oneMemo = arrMemo[nIndex1];
// Found contentid
if (oneMemo.contentid == oneContent.contentid) {
var isFoundPage = false;
for (var nIndex2 = 0; nIndex2 < webContentPage.length; nIndex2++) {
if (oneMemo.pageNo == webContentPage[nIndex2].pageNo) {
// Found pageNo
isFoundPage = true;
break;
}
}
if (!isFoundPage) {
arrMemo.splice(nIndex1, 1);
ClientData.isChangedMemo(true);
}
}
}
}
else { // webContentPage.length = 0
for (var nIndex1 = 0; nIndex1 < arrMemo.length; nIndex1++) {
// Get one bookmar entity
var oneMemo = arrMemo[nIndex1];
if (oneMemo.contentid == oneContent.contentid) {
arrMemo.splice(nIndex1, 1);
ClientData.isChangedMemo(true);
}
}
}
}
}
ClientData.MemoData(arrMemo);
};
function SyncMarkingPages() {
var arrMarking = ClientData.MarkingData();
for (var nIndex = 0; nIndex < existContent.length; nIndex++) {
// Get one content
var oneContent = existContent[nIndex];
var params = {
sid: ClientData.userInfo_sid(),
contentId: oneContent.contentid,
thumbnailFlg: 0
};
var webContentPage;
// Get all pages of content
avwCmsApiSync(ClientData.userInfo_accountPath(), "webContentPage", 'GET', params,
function (data) {
// Success
if (data.pages) {
webContentPage = data.pages;
}
}, null);
if (webContentPage) {
if (webContentPage.length > 0) {
for (var nIndex1 = arrMarking.length - 1; nIndex1 >= 0 ; nIndex1--) {
// Get one bookmar entity
var oneMarking = arrMarking[nIndex1];
// Found contentid
if (oneMarking.contentid == oneContent.contentid) {
var isFoundPage = false;
for (var nIndex2 = 0; nIndex2 < webContentPage.length; nIndex2++) {
if (oneMarking.pageNo == webContentPage[nIndex2].pageNo) {
// Found pageNo
isFoundPage = true;
break;
}
}
if (!isFoundPage) {
arrMarking.splice(nIndex1, 1);
ClientData.isChangedMarkingData(true);
}
}
}
}
else { // webContentPage.length = 0
for (var nIndex1 = 0; nIndex1 < arrMarking.length; nIndex1++) {
// Get one bookmar entity
var oneMarking = arrMarking[nIndex1];
if (oneMarking.contentid == oneContent.contentid) {
arrMarking.splice(nIndex1, 1);
ClientData.isChangedMarkingData(true);
}
}
}
}
}
ClientData.MarkingData(arrMarking);
};
function changeLanguageCallBackFunction(){
handleLanguage();
formatDisplayMoreRecord();
document.title = i18nText('dspHome') + ' | ' + i18nText('sysAppTitle');
};
function truncate(strInput, length){
if (strInput.length <= length)
{
return strInput;
}
else
{
return strInput.substring(0, length) + "...";
}
};
function resizeResourceThumbnail(mg, width, height) {
var newWidth;
var newHeight;
if(mg.width > mg.height) {
newWidth = width;
newHeight = (mg.height * width)/mg.width;
}
else {
newHeight = height;
newWidth = (mg.width * height)/mg.height;
}
var result = [newWidth, newHeight];
return result;
};
function resetShowNextRecordCount(){
showNextRecordClickNumber = 1;
};
function setDefaultViewMode(){
if(ClientData.sortOpt_viewMode() == Consts.ConstDisplayMode_BookShelf){
isShowBookShelf = true;
}
else if(ClientData.sortOpt_viewMode() == Consts.ConstDisplayMode_List){
isShowBookShelf = false;
}
else{
isShowBookShelf = true;
}
};
function removeHoverCss(){
if(isTouchDevice()){
$('#control-sort-title').removeClass('nottouchdevice');
$('#control-sort-titlekana').removeClass('nottouchdevice');
$('#control-sort-releasedate').removeClass('nottouchdevice');
}
};
/// <reference path="../common/js/avweb.js" />
/// <reference path="../common/js/screenLock.js" />
/// <reference path="../common/js/common.js" />
/// <reference path="../common/js/i18n.js" />
/// <reference path="../common/js/jquery-1.8.1.min.js" />
/// <reference path="../common/js/jquery-ui-1.8.23.custom.min.js" />
/// <reference path="../common/js/jquery.toastmessage.js" />
/// <reference path="../common/js/pageViewer.js" />
var requirePasswordChange;
var userinfo_sid;
var userInfo_userName;
var optionList = [];
var force_pw_change_on_login;
var force_pw_change_periodically;
var user_data_backup;
var marking;
var force_login_periodically;
var login_errorMessage = "";
//Load login Info
function loadLoginInfo() {
$('#chkRemember').attr('checked', 'checked');
if (ClientData.userInfo_accountPath() != null) {
$('#txtAccPath').val(ClientData.userInfo_accountPath());
}
if (ClientData.userInfo_loginId() != null) {
$('#txtAccId').val(ClientData.userInfo_loginId());
}
};
//Initial Screen
function initialScreen() {
//Check Last time display language
//ClientData.userInfo_language(localStorage.getItem(avwsys_storagekey));
if (ClientData.userInfo_rememberLogin()) {
loadLoginInfo();
}
};
//check Save Login Info
function saveLoginInfo() {
SessionStorageUtils.login();
// Set flag コンテンツデータチェックフラグ = true to sync local with server
ClientData.common_contentDataChkFlg(true);
var chkRemember = $('#chkRemember').attr('checked');
var accountPath = $('#txtAccPath').val();
var loginId = $('#txtAccId').val();
var password = $('#txtPassword').val();
var date = new Date();
ClientData.userInfo_accountPath(accountPath);
ClientData.userInfo_loginId(loginId);
ClientData.userInfo_accountPath_session(accountPath);
ClientData.userInfo_loginId_session(loginId);
ClientData.userInfo_userName(userInfo_userName);
if(chkRemember == 'checked')
{
ClientData.userInfo_rememberLogin(true);
}
else
{
ClientData.userInfo_rememberLogin(false);
}
ClientData.userInfo_lastLoginTime(date.jpDateTimeString());
//ClientData.requirePasswordChange(requirePasswordChange);
//ClientData.userInfo_sid(userinfo_sid);
ClientData.userInfo_sid_local(userinfo_sid);
saveServiceUserOption();
};
//Check validation
function checkValidation() {
var accountPath = $('#txtAccPath').val();
var loginId = $('#txtAccId').val();
var password = $('#txtPassword').val();
var msgError = $('#main-error-message');
if (!ValidationUtil.CheckRequiredForText(accountPath)) {
login_errorMessage = "";
msgError.html(i18nText('msgLoginEmpty'));
msgError.attr('lang', 'msgLoginEmpty');
msgError.show();
return false;
}
else if (!ValidationUtil.CheckRequiredForText(loginId)) {
login_errorMessage = "";
msgError.html(i18nText('msgLoginEmpty'));
msgError.attr('lang', 'msgLoginEmpty');
msgError.show();
return false;
}
else if (!ValidationUtil.CheckRequiredForText(password)) {
login_errorMessage = "";
msgError.html(i18nText('msgLoginEmpty'));
msgError.attr('lang', 'msgLoginEmpty');
msgError.show();
return false;
}
else {
return true;
}
};
//Check Dialog validation
function checkDialogValidation(){
var currentPass = $('#txtCurrentPass').val();
var newPass = $('#txtNewPass').val();
var confirmPass = $('#txtConfirmNew').val();
var msgError = $('#dialog-error-message');
if (!ValidationUtil.CheckRequiredForText(currentPass)) {
login_errorMessage = "";
msgError.html(i18nText('msgPwdEmpty'));
msgError.attr('lang', 'msgPwdEmpty');
msgError.show();
/* show error messages */
//$().toastmessage({ position: 'middle-center' });
//$().toastmessage('showToast', {
// type: 'error',
// sticky: true,
// text: i18nText('msgPwdEmpty')
//});
return false;
}
else if (!ValidationUtil.CheckRequiredForText(newPass)) {
login_errorMessage = "";
msgError.html(i18nText('msgPwdEmpty'));
msgError.attr('lang', 'msgPwdEmpty');
msgError.show();
/* show error messages */
//$().toastmessage({ position: 'middle-center' });
//$().toastmessage('showToast', {
// type: 'error',
// sticky: true,
// text: i18nText('msgPwdEmpty')
//});
return false;
}
// else if (!ValidationUtil.CheckRequiredForText(confirmPass)) {
// //msgError.html(i18nText('msgPwdEmpty'));
// //msgError.show();
// /* show error messages */
// $().toastmessage({ position: 'middle-center' });
// $().toastmessage('showToast', {
// type: 'error',
// sticky: true,
// text: i18nText('msgPwdEmpty')
// });
// return false;
// }
else
{
if(newPass != confirmPass){
login_errorMessage = "";
msgError.html(i18nText('msgPwdNotMatch'));
msgError.attr('lang', 'msgPwdNotMatch');
msgError.show();
/* show error messages */
// $().toastmessage({ position: 'middle-center' });
// $().toastmessage('showToast', {
// type: 'error',
// sticky: true,
// text: i18nText('msgPwdNotMatch')
//});
return false;
}
else{
return true;
}
}
};
//Login Process
function processLogin() {
var accountPath = $('#txtAccPath').val();
var loginId = $('#txtAccId').val();
var password = $('#txtPassword').val();
var requireChangePassword = 0;
var skipPwdDate;
var params = {
previousSid: '',
loginId: loginId,
password: password,
urlpath: accountPath
};
// Set sid for login, this will be checked authoring 2 sessions
if (ClientData.userInfo_sid_local()) {
params.previousSid = ClientData.userInfo_sid_local();
}
// Get url to login
var sysSettings = avwSysSetting();
var apiLoginUrl = sysSettings.apiLoginUrl;
avwCmsApiWithUrl(apiLoginUrl, null, 'webClientLogin', 'GET', params, function (data) {
requirePasswordChange = data.requirePasswordChange;
userinfo_sid = data.sid;
userInfo_userName = data.userName;
optionList = data.serviceOptionList;
getServiceOptionList();
if (data.result == 'success') {
// Save retrieved info
saveLoginInfo();
$('#main-error-message').css('display', 'none');
if (data.requirePasswordChange == 0) {
ClientData.userInfo_sid(ClientData.userInfo_sid_local());
avwScreenMove("abvw/" + ScreenIds.Home);
}
else if (data.requirePasswordChange == 1) {
if (force_pw_change_on_login == 2) { // force to change password
OpenChangePasswordDialog();
$(".ui-dialog-titlebar").hide();
$('#btnSkip').hide();
$("#txtPwdRemind").css('visibility', 'hidden');
}
else if (force_pw_change_on_login == 1) { // recommend to change password
// Check 30 days
skipPwdDate = ClientData.userInfo_pwdSkipDt();
if (skipPwdDate == null || skipPwdDate == 'undefined') {
OpenChangePasswordDialog();
$('#btnSkip').show();
$(".ui-dialog-titlebar").hide();
}
else {
var date = new Date();
var skpPwdDt = new Date(skipPwdDate);
var numDay = date.subtractByDays(skpPwdDt);
if (numDay <= 30) {
ClientData.userInfo_sid(ClientData.userInfo_sid_local());
avwScreenMove("abvw/" + ScreenIds.Home);
}
else if (numDay > 30) {
OpenChangePasswordDialog();
$('#btnSkip').show();
$(".ui-dialog-titlebar").hide();
}
}
}
else { // no need to change password
ClientData.userInfo_sid(ClientData.userInfo_sid_local());
avwScreenMove("abvw/" + ScreenIds.Home);
}
}
else if (data.requirePasswordChange == 2) {
if (force_pw_change_periodically == 1) { // recommend to change password
$('#btnSkip').show();
skipPwdDate = ClientData.userInfo_pwdSkipDt();
if (skipPwdDate == null || skipPwdDate == 'undefined') {
OpenChangePasswordDialog();
$(".ui-dialog-titlebar").hide();
}
else {
var date = new Date();
var skpPwdDt = new Date(skipPwdDate);
var numDay = date.subtractByDays(skpPwdDt);
if (numDay <= 30) {
ClientData.userInfo_sid(ClientData.userInfo_sid_local());
avwScreenMove("abvw/" + ScreenIds.Home);
}
else if (numDay > 30) {
OpenChangePasswordDialog();
$(".ui-dialog-titlebar").hide();
}
}
} else if (force_pw_change_periodically == 2) { // Force to change password
OpenChangePasswordDialog();
$('#btnSkip').hide();
$(".ui-dialog-titlebar").hide();
$("#txtPwdRemind").css('visibility', 'hidden');
}
else { // No need to change password
ClientData.userInfo_sid(ClientData.userInfo_sid_local());
avwScreenMove("abvw/" + ScreenIds.Home);
}
}
}
else {
login_errorMessage = data.errorMessage;
$('#main-error-message').html(format(i18nText('msgLoginErrWrong'), data.errorMessage).toString());
$('#main-error-message').show();
// $('#main-error-message').attr('lang', 'msgLoginErrWrong');
// //$('#main-error-message').html(i18nText('msgLoginErrWrong'));
// //alert($('#main-error-message').html());
// $('#main-error-message').css('display', 'block');
// if (ClientData.userInfo_language() != null) {
// changeLanguage(ClientData.userInfo_language());
// }
// else {
// changeLanguage(Consts.ConstLanguage_Ja);
// }
}
}, function (xhr, statusText, errorThrown) {
if (xhr.responseText && xhr.status != 0) {
login_errorMessage = JSON.parse(xhr.responseText).errorMessage;
$('#main-error-message').html(format(i18nText('msgLoginErrWrong'), JSON.parse(xhr.responseText).errorMessage).toString());
} else {
$('#main-error-message').html(format(i18nText('msgLoginErrWrong'), 'E001'));
}
$('#main-error-message').show();
});
};
//Change Password Process
function changePasswordProcess(){
var accountPath = $('#txtAccPath').val();
//var sid = ClientData.userInfo_sid();
var sid = ClientData.userInfo_sid_local();
var loginId = $('#txtAccId').val();
var password = $('#txtCurrentPass').val();
var confirmPass = $('#txtConfirmNew').val();
var params = {
sid: sid,
loginId: loginId,
password: password,
newPassword: confirmPass,
appId: 4
};
avwCmsApiSync(accountPath, 'passwordChange', 'GET', params, function (data) {
var result = data.result;
if (result == 'success') {
$('#dialog-error-message').css('display', 'none');
CloseChangePasswordDialog();
ClientData.userInfo_sid(ClientData.userInfo_sid_local());
avwScreenMove("abvw/" + ScreenIds.Home);
}
else {
$('#dialog-error-message').html(i18nText('msgPwdOldWrong'));
$('#dialog-error-message').show();
}
},
function (xhr, b, c) {
if (xhr.responseText && xhr.status != 0) {
$('#dialog-error-message').html(JSON.parse(xhr.responseText).errorMessage);
$('#dialog-error-message').show();
}
else {
// Show systemerror
showSystemError();
}
});
};
//Change Language Japanese
function changeLanguageJa(){
changeLanguage(Consts.ConstLanguage_Ja);
document.title = i18nText('dspLogin') + ' | ' + i18nText('sysAppTitle');
//ClientData.userInfo_language(Consts.ConstLanguage_Ja);
if (login_errorMessage != ""){
$('#main-error-message').html(format(i18nText('msgLoginErrWrong'), login_errorMessage).toString());
}
};
//Change Language Korean
function changeLanguageKo(){
changeLanguage(Consts.ConstLanguage_Ko);
document.title = i18nText('dspLogin') + ' | ' + i18nText('sysAppTitle');
//ClientData.userInfo_language(Consts.ConstLanguage_Ko);
if (login_errorMessage != ""){
$('#main-error-message').html(format(i18nText('msgLoginErrWrong'), login_errorMessage).toString());
}
};
//Change Language English
function changeLanguageEn(){
changeLanguage(Consts.ConstLanguage_En);
document.title = i18nText('dspLogin') + ' | ' + i18nText('sysAppTitle');
//ClientData.userInfo_language(Consts.ConstLanguage_En);
if (login_errorMessage != ""){
$('#main-error-message').html(format(i18nText('msgLoginErrWrong'), login_errorMessage).toString());
}
};
//Login click function
function loginFunction(){
if (checkValidation()) {
processLogin();
}
};
//Change Password function
function changePassFunction(){
if(checkDialogValidation()){
changePasswordProcess();
}
};
//Skip Password function
function skipPassFunction(){
var date = new Date();
ClientData.userInfo_pwdSkipDt(date);
//window.location = "abvw/" + ScreenIds.Home;
ClientData.userInfo_sid(ClientData.userInfo_sid_local());
avwScreenMove("abvw/" + ScreenIds.Home);
};
//Open Change Password Dialog
function OpenChangePasswordDialog(){
// Clear all input values
$("#main-password-change").show();
$("#main-password-change").center();
lockLayout();
};
//Close Chnage Password Dialog
function CloseChangePasswordDialog(){
$("#main-password-change").dialog('close');
};
//Save Service Option
function saveServiceUserOption(){
$.each(optionList, function(i, option){
if(option.serviceName == 'force_pw_change_periodically'){
ClientData.serviceOpt_force_pw_change_periodically(option.value);
}
else if(option.serviceName == 'force_pw_change_on_login'){
ClientData.serviceOpt_force_pw_change_on_login(option.value);
}
else if(option.serviceName == 'force_login_periodically'){
ClientData.serviceOpt_force_login_periodically(option.value);
}
else if(option.serviceName == 'marking'){
ClientData.serviceOpt_marking(option.value);
}
else if(option.serviceName == 'user_data_backup'){
ClientData.serviceOpt_user_data_backup(option.value);
}
});
};
//Get Service Option
function getServiceOptionList(){
$.each(optionList, function(i, option){
if(option.serviceName == 'force_pw_change_periodically'){
force_pw_change_periodically = option.value;
}
else if(option.serviceName == 'force_pw_change_on_login'){
force_pw_change_on_login = option.value;
}
else if(option.serviceName == 'force_login_periodically'){
force_login_periodically = option.value;
}
else if(option.serviceName == 'marking'){
marking = option.value;
}
else if(option.serviceName == 'user_data_backup'){
user_data_backup = option.value;
}
});
};
function OpenChangePassword() {
//$("#dlgChangePassword").dialog("open");
//$(".ui-dialog-titlebar").hide();
};
function loginWhenClickEnter(e){
var code = (e.keyCode ? e.keyCode : e.which);
if(code == 13) { //Enter keycode
$('#btnLogin').click();
}
};
$(document).ready(function (e) {
document.title = i18nText('dspLogin') + ' | ' + i18nText('sysAppTitle');
//Initial Screen
initialScreen();
//Change language japanese
$('#language-ja').click(changeLanguageJa);
//Change language korean
$('#language-ko').click(changeLanguageKo);
//Change laguage english
$('#language-en').click(changeLanguageEn);
//Button login click event
$('#btnLogin').click(loginFunction);
//Button Change click event
$('#btnChange').click(changePassFunction);
//Button Skip click event
$('#btnSkip').click(skipPassFunction);
$('#txtPassword').keydown(loginWhenClickEnter);
});
/// 設定変更画面
/// <reference path="../common/js/avweb.js" />
/// <reference path="../common/js/screenLock.js" />
/// <reference path="../common/js/common.js" />
/// <reference path="../common/js/i18n.js" />
/// <reference path="../common/js/jquery-1.8.1.min.js" />
/// <reference path="../common/js/jquery-ui-1.8.23.custom.min.js" />
/// <reference path="../common/js/jquery.toastmessage.js" />
/// <reference path="../common/js/pageViewer.js" />
// Init function of page
$(document).ready(function () {
if (!avwCheckLogin(ScreenIds.Login)) return;
ToogleLogoutNortice();
LockScreen();
document.title = i18nText('dspSetting') + ' | ' + i18nText('sysAppTitle');
// Set bookmark screen
ClientData.BookmarkScreen(ScreenIds.Setting);
InitScreen();
$("#dspSave").click(dspSave_Click);
$("#dspPwdUpd").click(dspPwdUpd_Click);
$("#dspOptReset").click(dspOptReset_Click);
$("#dspOptBk").click(dspOptBk_Click);
$("#dspOptRes").click(dspOptRes_Click);
$("#dspPwdUpd1").click(dspPwdUpd1_Click);
$("#dspSkip").click(dspSkip_Click);
$("#dspCancel").click(dspCancel_Click);
$("#dspOptRes_OK").click(dspOptRes_OK_Click);
$("#dspOptRes_Cancel").click(dspOptRes_Cancel_Click);
$("#dspOptBk_OK").click(dspOptBk_OK_Click);
$("#dspOptBk_Cancel").click(dspOptBk_Cancel_Click);
// Check to hide/show backup button
if (ClientData.isChangedBookmark() == true
|| ClientData.isChangedMarkingData() == true
|| ClientData.isChangedMemo() == true) {
$("#dspOptBk").show();
}
else {
$("#dspOptBk").hide();
}
// Get flag to determine must change password
avwCmsApi(ClientData.userInfo_accountPath(), "requirePasswordChange", 'GET', { sid: ClientData.userInfo_sid() },
avwCmsApi_requirePasswordChange_success,
null
);
// In case: user_data_backup = "Y" -> backup
if (ClientData.serviceOpt_user_data_backup() != "Y") {
$("#dspOptBk").css('visibility', 'hidden');
$("#dspOptRes").css('visibility', 'hidden');
$("#chkOptBkCfm").css('visibility', 'hidden');
$("#txtOptBkCfm").css('visibility', 'hidden');
$("#txtBkResCap").css('visibility', 'hidden');
}
else {
if (IsExistBackupFile() == false) {
$("#dspOptRes").css('visibility', 'hidden');
}
else {
$("#dspOptRes").css('visibility', '');
}
}
});
/*
event of changing language
*/
function changeLanguageCallBackFunction() {
document.title = i18nText('dspSetting') + ' | ' + i18nText('sysAppTitle');
};
/*
Check backup file exists or not
*/
function IsExistBackupFile() {
var isExisted = false;
var params = { sid: ClientData.userInfo_sid(), deviceType: '4', filename: "webBackupData.json" };
// Get list of files
avwCmsApiSync(ClientData.userInfo_accountPath(), "getBackupFile", "post", params,
function (data) {
if (data) {
isExisted = true;
}
},
function (xhr, b, c) {
if (xhr.status != 0) {
isExisted = false;
}
else {
showSystemError();
}
});
return isExisted;
};
// Event success
function avwCmsApi_requirePasswordChange_success(data) {
ClientData.requirePasswordChange(0);
if (data.requirePasswordChange == 1) {
if (ClientData.serviceOpt_force_pw_change_on_login() == 0) { // No need to change password
// Skip this case
}
else if (ClientData.serviceOpt_force_pw_change_on_login() == 1) { // Recommend to change password
var pwdSkipDt = ClientData.userInfo_pwdSkipDt();
if (pwdSkipDt) {
// Check 30 days
var currDate = new Date();
var skipDate = new Date(pwdSkipDt);
var numDay = currDate.subtractByDays(skipDate);
if (numDay <= 30) {
// Do not show dialog to change password
}
else if (numDay > 30) {
// Show dialog to change password
OpenChangePassword();
$("#dspSkip").show();
$("#dspCancel").hide();
}
}
else {
//alert('pwdSkipDt=null');
OpenChangePassword();
$("#dspSkip").show();
$("#dspCancel").hide();
}
}
else if (ClientData.serviceOpt_force_pw_change_on_login() == 2) { // Force to change password
ClientData.requirePasswordChange(1);
OpenChangePassword();
$("#dspSkip").hide();
$("#dspCancel").hide();
//$("#dspPwdUpd1").css('margin', $("#dspCancel").css('margin'));
$("#dspPwdUpd1").css('margin', '-27px 97px 0 0');
$("#txtChangePassComment").css('visibility', 'hidden');
}
}
else if (data.requirePasswordChange == 2) {
if (ClientData.serviceOpt_force_pw_change_periodically() == 0) { // No need to change password
// Skip this case
}
else if (ClientData.serviceOpt_force_pw_change_periodically() == 1) { // Recommend to change password
var pwdSkipDt = ClientData.userInfo_pwdSkipDt();
if (pwdSkipDt) {
// Check 30 days
var currDate = new Date();
var skipDate = new Date(pwdSkipDt);
var numDay = currDate.subtractByDays(skipDate);
if (numDay <= 30) {
// Do not show dialog to change password
}
else if (numDay > 30) {
// Show dialog to change password
OpenChangePassword();
$("#dspSkip").show();
$("#dspCancel").hide();
}
}
else {
//alert('pwdSkipDt=null');
OpenChangePassword();
$("#dspSkip").show();
$("#dspCancel").hide();
}
}
else if (ClientData.serviceOpt_force_pw_change_periodically() == 2) { // Force to change password
ClientData.requirePasswordChange(1);
OpenChangePassword();
$("#dspSkip").hide();
$("#dspCancel").hide();
$("#dspPwdUpd1").css('margin', '-27px 97px 0 0');
$("#txtChangePassComment").css('visibility', 'hidden');
}
}
else if (data.requirePasswordChange == 0) {
// Skip this case
}
};
/*
----------------------------------------------------------------------------
Event groups [start]
----------------------------------------------------------------------------
*/
// OK for backup
function dspOptBk_OK_Click(e) {
e.preventDefault();
// ----------------------------
// Process backup here
// ----------------------------
// Bakup memo/marking/bookmark
var params = [
{ name: 'sid', content: ClientData.userInfo_sid() },
{ name: 'deviceType', content: '4' },
{ name: 'formFile', content: JSON.stringify(buildBackupData()), fileName: 'webBackupData.json', contentType: 'text-plain' }
];
avwUploadBackupFile(ClientData.userInfo_accountPath(), params, false, avwCmsApi_uploadBackupFile_success,
function (a, b, c) {
// Show error message: msgBackupFailed
$().toastmessage({ position: 'middle-center' });
$().toastmessage('showToast', {
type: 'error',
sticky: true,
text: i18nText('msgBackupFailed')
});
});
closeBackup();
};
function avwCmsApi_uploadBackupFile_success(data) {
if (JSON.parse(data).result == "success") {
ClientData.isChangedBookmark(false);
ClientData.isChangedMarkingData(false);
ClientData.isChangedMemo(false);
$("#dspOptBk").hide();
$("#dspOptRes").css('visibility', '');
// Show message: msgBackupSuccess
$().toastmessage({ position: 'middle-center' });
$().toastmessage('showToast', {
type: 'success',
sticky: true,
text: i18nText('msgBackupSuccess')
});
}
else {
// Show error message: msgBackupFailed
$().toastmessage({ position: 'middle-center' });
$().toastmessage('showToast', {
type: 'error',
sticky: true,
text: i18nText('msgBackupFailed')
});
}
};
// Cancel for backup
function dspOptBk_Cancel_Click(e) {
e.preventDefault();
closeBackup(true);
};
// OK for restore
function dspOptRes_OK_Click(e) {
e.preventDefault();
// ----------------------------
// Process restore
// ----------------------------
// Get list of files
avwCmsApi(ClientData.userInfo_accountPath(), "getBackupFile", "post",
{ sid: ClientData.userInfo_sid(), deviceType: '4', filename: "webBackupData.json" },
avwCmsApi_getBackupFile_success,
function (xhr, b, c) {
if (xhr.status != 0) {
// Show error message
$().toastmessage({ position: 'middle-center' });
$().toastmessage('showToast', {
type: 'error',
sticky: true,
text: i18nText('msgRestoreFailed')
});
}
else {
showSystemError();
}
}
);
closeRestore();
};
function avwCmsApi_getBackupFile_success(data) {
if (data) {
restoreData(data);
ClientData.isChangedBookmark(false);
ClientData.isChangedMarkingData(false);
ClientData.isChangedMemo(false);
$("#dspOptBk").hide();
// Show message: msgRestoreSuccess
$().toastmessage({ position: 'middle-center' });
$().toastmessage('showToast', {
type: 'success',
sticky: true,
text: i18nText('msgRestoreSuccess')
});
}
};
// Cancel for restore
function dspOptRes_Cancel_Click(e) {
e.preventDefault();
closeRestore(true);
};
// Cancel to change password
function dspCancel_Click(e) {
e.preventDefault();
var msgError = $('#dialog-error-message');
msgError.html('');
closeChangePassword(true);
};
// Save setting
function dspSave_Click(e) {
e.preventDefault();
// 最初の画面を選択
if ($("#rdoOpt001").attr('checked') == 'checked') {
ClientData.sortOpt_viewMode(Consts.ConstDisplayMode_BookShelf); // Bookshelf
}
else {
ClientData.sortOpt_viewMode(Consts.ConstDisplayMode_List); // List
}
// 動画、音楽繰り返し
if ($("#chkOpt002").attr('checked') == 'checked') {
ClientData.userOpt_musicMode(1);
ClientData.userOpt_videoMode(1);
}
else {
ClientData.userOpt_musicMode(0);
ClientData.userOpt_videoMode(0);
}
// マーキング(コンテンツを開いた時に表示する)
if ($("#chkOpt003").attr('checked') == 'checked') {
ClientData.userOpt_makingDsp(1);
}
else {
ClientData.userOpt_makingDsp(0);
}
// Show/not show alert when press F5.close tab.broswer.
if ($("#chkOpt005").attr('checked') == 'checked') {
ClientData.userOpt_closeOrRefreshAlert(1);
ToogleLogoutNortice();
}
else {
ClientData.userOpt_closeOrRefreshAlert(0);
ToogleLogoutNortice();
}
// 毎回ログアウトの時、バックアップするかどうかは必ず確認する
if ($("#chkOptBkCfm").attr('checked') == 'checked') {
ClientData.userOpt_bkConfirmFlg(1);
}
else {
ClientData.userOpt_bkConfirmFlg(0);
}
/* show messages */
$().toastmessage({ position: 'middle-center' });
$().toastmessage('showToast', {
type: 'success',
sticky: true,
text: i18nText('msgSaveOk')
});
};
// Skip to change password
function dspSkip_Click(e) {
e.preventDefault();
var msgError = $('#dialog-error-message');
msgError.html('');
// Update パスワードスキップ日時
ClientData.userInfo_pwdSkipDt(new Date());
closeChangePassword();
};
function OpenChangePassword() {
//$("#dlgChangePassword").dialog("open");
//$(".ui-dialog-titlebar").hide();
// Clear all input values
$("#txtPwdCur").val('');
$("#txtPwdNew").val('');
$("#txtPwdNewRe").val('');
lockLayout();
$("#dlgChangePassword").show();
$("#dlgChangePassword").center();
};
function closeChangePassword(skip) {
//$("#dlgChangePassword").dialog("close");
$("#dlgChangePassword").hide();
unlockLayout();
};
// Want to change password
function dspPwdUpd_Click(e) {
e.preventDefault();
$("#dspCancel").show();
$("#dspSkip").hide();
$("#txtChangePassComment").css('visibility', 'hidden');
$("#dspPwdUpd1").css('margin', '-27px 97px 0 0');
// Show dialog
OpenChangePassword();
};
// Reset setting
function dspOptReset_Click(e) {
e.preventDefault();
// 最初の画面を選択
$("#rdoOpt001").attr('checked', 'checked');
// 動画、音楽繰り返し
$("#chkOpt002").attr('checked', 'checked');
// マーキング(コンテンツを開いた時に表示する)
$("#chkOpt003").attr('checked', 'checked');
// Show alert when press F5.close tab.broswer
$("#chkOpt005").attr('checked', 'checked');
// 毎回ログアウトの時、バックアップするかどうかは必ず確認する
$("#chkOptBkCfm").attr('checked', 'checked');
};
// Backup
function dspOptBk_Click(e) {
e.preventDefault();
openBackup();
};
// Restore
function dspOptRes_Click(e) {
e.preventDefault();
openRestore();
};
// Process changing password
function dspPwdUpd1_Click(e) {
e.preventDefault();
var isOK = true;
var msgError = $('#dialog-error-message');
// Check validation
if (!ValidationUtil.CheckRequiredForText(getCurrentPassword())) {
isOK = false;
//alert(i18nText('msgPwdEmpty'));
/* show error messages */
// $().toastmessage({ position: 'middle-center' });
// $().toastmessage('showToast', {
// type: 'error',
// sticky: true,
// text: i18nText('msgPwdEmpty')
//});
msgError.html(i18nText('msgPwdEmpty'));
msgError.show();
}
else {
if (!ValidationUtil.CheckRequiredForText(getNewPassword())) {
isOK = false;
//alert(i18nText('msgPwdEmpty'));
/* show error messages */
//$().toastmessage({ position: 'middle-center' });
// $().toastmessage('showToast', {
// type: 'error',
// sticky: true,
// text: i18nText('msgPwdEmpty')
//});
msgError.html(i18nText('msgPwdEmpty'));
msgError.show();
}
else {
if (getNewPassword() != getNewPasswordRe()) {
isOK = false;
//alert(i18nText('msgPwdNotMatch'));
/* show error messages */
//$().toastmessage({ position: 'middle-center' });
// $().toastmessage('showToast', {
// type: 'error',
// sticky: true,
// text: i18nText('msgPwdNotMatch')
// });
msgError.html(i18nText('msgPwdNotMatch'));
msgError.show();
}
}
}
if (isOK) {
// Check max length
if (!ValidationUtil.CheckMaxLengthForByte(getCurrentPassword(), 10)) {
isOK = false;
}
if (!ValidationUtil.CheckMaxLengthForByte(getNewPassword(), 10)) {
isOK = false;
}
if (!ValidationUtil.CheckMaxLengthForByte(getNewPasswordRe(), 10)) {
isOK = false;
}
// Data type
if (!ValidationUtil.IsAlphabetOrNumberOrSymbol(getCurrentPassword())) {
isOK = false;
}
if (!ValidationUtil.IsAlphabetOrNumberOrSymbol(getNewPassword())) {
isOK = false;
}
if (!ValidationUtil.IsAlphabetOrNumberOrSymbol(getNewPasswordRe())) {
isOK = false;
}
var str = getCurrentPassword() + "";
// if (str.contains("_") || str.contains("‐")) {
// isOK = false;
// }
}
// Do changing password
var params = {
sid: ClientData.userInfo_sid(),
loginId: ClientData.userInfo_loginId_session(),
password: getCurrentPassword(),
newPassword: getNewPassword(),
appId: 4
};
if (isOK) {
avwCmsApi(ClientData.userInfo_accountPath(), "passwordChange", "GET", params,
avwCmsApi_passwordChange_success,
avwCmsApi_passwordChange_fail);
}
else {
//alert('error');
}
};
function avwCmsApi_passwordChange_success(data) {
// OK
var msgError = $('#dialog-error-message');
if (data.result != undefined && data.result != null) {
if (data.result != Consts.ConstAPI_SUCCESS) {
/* show error messages */
//$().toastmessage({ position: 'middle-center' });
//$().toastmessage('showToast', {
// type: 'error',
// sticky: true,
// text: i18nText('msgPwdChangeNG')
//});
//alert(i18nText('msgPwdOldWrong'));
msgError.html(i18nText('msgPwdChangeNG'));
msgError.show();
}
else {
ClientData.requirePasswordChange(0);
msgError.html('');
closeChangePassword();
/* show messages */
$().toastmessage({ position: 'middle-center' });
$().toastmessage('showToast', {
type: 'success',
sticky: true,
text: i18nText('msgPwdChangeOK')
});
}
}
};
function avwCmsApi_passwordChange_fail(xhr, b, c) {
if (xhr.responseText && xhr.status != 0) {
/* show error messages */
var msgError = $('#dialog-error-message');
//msgError.html(i18nText('msgPwdChangeNG'));
msgError.html(JSON.parse(xhr.responseText).errorMessage);
msgError.show();
}
else {
showSystemError();
}
};
/*
----------------------------------------------------------------------------
Event groups [ end ]
----------------------------------------------------------------------------
*/
// Setting dialog
$(function () {
$('#dlgChangePassword').center();
$('#dlgConfirmBackup').center();
$('#dlgConfirmRestore').center();
$('#dlgChangePassword').hide();
$('#dlgConfirmBackup').hide();
$('#dlgConfirmRestore').hide();
// $('#dlgChangePassword').dialog({
// autoOpen: false,
// title: 'Change password',
// modal: true,
// resizable: false,
// width: 550,
// height: 400
// });
// $('#dlgConfirmBackup').dialog({
// autoOpen: false,
// title: 'Backup',
// modal: true,
// resizable: false,
// width: 550,
// height: 400
// });
// $('#dlgConfirmRestore').dialog({
// autoOpen: false,
// title: 'Restore',
// modal: true,
// resizable: false,
// width: 550,
// height: 450
// });
// LockScreen();
});
function openBackup() {
//$("#dlgConfirmBackup").dialog("open");
//$(".ui-dialog-titlebar").hide();
lockLayout();
$("#dlgConfirmBackup").show();
$("#dlgConfirmBackup").center();
};
function closeBackup(cancel) {
if (cancel != undefined || cancel == true) {
//alert('you cancelled');
}
//$("#dlgConfirmBackup").dialog("close");
$("#dlgConfirmBackup").hide();
unlockLayout();
};
function openRestore() {
//$("#dlgConfirmRestore").dialog("open");
//$(".ui-dialog-titlebar").hide();
lockLayout();
$("#dlgConfirmRestore").show();
$("#dlgConfirmRestore").center();
};
function closeRestore(cancel) {
if (cancel != undefined || cancel == true) {
//alert('you cancelled');
}
//$("#dlgConfirmRestore").dialog("close");
$("#dlgConfirmRestore").hide();
unlockLayout();
};
// Get input current password
function getCurrentPassword() {
return $("#txtPwdCur").val();
};
// Get input new password
function getNewPassword() {
return $("#txtPwdNew").val();
};
// Get input new password
function getNewPasswordRe() {
return $("#txtPwdNewRe").val();
};
// Initalize screen
function InitScreen() {
// ログインID
$("#txtLoginId").text(ClientData.userInfo_loginId_session());
// アカウントパス
$("#txtLoginPath").text(ClientData.userInfo_accountPath_session());
// 最終ログイン時間
$("#txtLastLoginTime").text(ClientData.userInfo_lastLoginTime());
//alert(getLastLoginDate());
// 最初の画面を選択
if (ClientData.sortOpt_viewMode() == Consts.ConstDisplayMode_List) {
$("#rdoOpt0011").attr('checked', 'checked');
}
else {
$("#rdoOpt001").attr('checked', 'checked');
}
// 動画、音楽繰り返し
if (ClientData.userOpt_musicMode() == 0) {
$("#chkOpt002").removeAttr('checked');
}
else {
$("#chkOpt002").attr('checked', 'checked');
}
// マーキング(コンテンツを開いた時に表示する)
if (ClientData.userOpt_makingDsp() == 0) {
$("#chkOpt003").removeAttr('checked');
}
else {
$("#chkOpt003").attr('checked', 'checked');
}
// Show alert when press F5.close tab.broswer
if (ClientData.userOpt_closeOrRefreshAlert() == 0) {
$("#chkOpt005").removeAttr('checked');
}
else {
$("#chkOpt005").attr('checked', 'checked');
}
// 毎回ログアウトの時、バックアップするかどうかは必ず確認する
if (ClientData.userOpt_bkConfirmFlg() == 0) {
$("#chkOptBkCfm").removeAttr('checked');
}
else {
$("#chkOptBkCfm").attr('checked', 'checked');
}
};
......@@ -64,7 +64,7 @@
"dspBkCancel":"Logout",
"txtSearchResult":"Result",
"dspHome":"Home",
"txtLoginUser":"(Ver.20121221-2)User:",
"txtLoginUser":"(Ver.20121221-3)User:",
"txtAll":"All",
"txtMkgSize":"Size",
"txtMkgS":"S",
......@@ -120,8 +120,8 @@
"txtMemoPaste":"Paste",
"txtMemoClear":"Clear",
"txtMemo":"Memo",
"msgBGMPlayConfirm":"EN:BGMが流れるようになっています。<br/>OKボタンをクリックしてください。",
"msgPWDNeedChange":"EN:パスワード変更が必要ですので、設定変更画面に戻って変更してください。",
"msgBGMPagePlayConfirm":"EN:BGMが流れるようになっています。<br/>OKボタンをクリックしてください。"
"msgBGMPlayConfirm":"Content BGM will be played automatically.",
"msgPWDNeedChange":"Change password is required. Please back Setting view.",
"msgBGMPagePlayConfirm":"Page BGM will be played automatically."
}
......@@ -64,7 +64,7 @@
"dspBkCancel":"バックアップせずにログアウト",
"txtSearchResult":"検索結果",
"dspHome":"ホーム",
"txtLoginUser":"(Ver.20121221-2)ログイン中:",
"txtLoginUser":"(Ver.20121221-3)ログイン中:",
"txtAll":"すべて",
"txtMkgSize":"太さ",
"txtMkgS":"小",
......@@ -120,7 +120,7 @@
"txtMemoPaste":"貼り付け",
"txtMemoClear":"クリア",
"txtMemo":"メモ",
"msgBGMPlayConfirm":"BGMが流れるようになっています。<br/>OKボタンをクリックしてください。",
"msgPWDNeedChange":"パスワード変更が必要ですので、設定変更画面に戻って変更してください。",
"msgBGMPagePlayConfirm":"BGMが流れるようになっています。<br/>OKボタンをクリックしてください。"
"msgBGMPlayConfirm":"コンテンツBGMが自動再生されます。",
"msgPWDNeedChange":"パスワードの変更が必要です。設定変更画面に戻って変更してください。",
"msgBGMPagePlayConfirm":"ページBGMが自動再生されます。"
}
......@@ -13,7 +13,7 @@
"txtOpt003":"마킹",
"dspOptReset":"설정 리셋",
"txtBkResCap":"서버 백업/복원",
"txtOptBkCfm":"로그아웃 시, 백업을 할지 항상 확인",
"txtOptBkCfm":"로그아웃할 때 백업을 할지 항상 확인",
"dspOptBk":"백업",
"dspOptRes":"복원",
"dspSave":"저장",
......@@ -41,7 +41,7 @@
"txtPwdRemind":"스킵을 선택하면 30일 이내에는 이 메세지를 표시하지 않습니다.",
"txtSearch":"검색",
"dspShiori":"북마크",
"dspSetting":"설정 변경",
"dspSetting":"환경설정",
"dspLogout":"로그아웃",
"txtRead":"열람",
"txtSort":"정렬",
......@@ -64,7 +64,7 @@
"dspBkCancel":"로그아웃",
"txtSearchResult":"검색 결과",
"dspHome":"홈",
"txtLoginUser":"(Ver.20121221-2)로그인 중:",
"txtLoginUser":"(Ver.20121221-3)로그인 중:",
"txtAll":"전체",
"txtMkgSize":"두께",
"txtMkgS":"소",
......@@ -113,14 +113,14 @@
"txtMemoCopy":"복사",
"msgPageImgErr":"컨텐츠를 표시할 수 없습니다. 이 컨텐츠는 삭제되었을 가능성이 있습니다.",
"sysAppTitle":"ABook : 멀티미디어 컨텐츠 플랫폼",
"sysLockScrPwdInput":"입력 암호",
"txtOpt005":"탭 브라우저 종료 · F5 때 경고가 표시",
"txtMemoMenu":"참고 편집",
"sysLockScrPwdInput":"패스워드를 입력해 주십시오.",
"txtOpt005":"새로고침을 하거나, 탭/창을 닫을 때 경고 표시",
"txtMemoMenu":"편집",
"txtMemoNew":"신규",
"txtMemoPaste":"붙여 넣기",
"txtMemoPaste":"붙여넣기",
"txtMemoClear":"클리어",
"txtMemo":"메모",
"msgBGMPlayConfirm":"KO:BGMが流れるようになっています。<br/>OKボタンをクリックしてください。",
"msgPWDNeedChange":"KO:パスワード変更が必要ですので、設定変更画面に戻って変更してください。",
"msgBGMPagePlayConfirm":"KO:BGMが流れるようになっています。<br/>OKボタンをクリックしてください。"
"msgBGMPlayConfirm":"이 컨텐츠는 BGM을 포함하고 있습니다. 재생을 시작합니다.",
"msgPWDNeedChange":"패스워드를 변경해야 합니다. 환경설정에서 패스워드를 변경해 주십시오.",
"msgBGMPagePlayConfirm":"이 페이지는 BGM을 포함하고 있습니다. 재생을 시작합니다."
}
eval(function(p,a,c,k,e,d){e=function(c){return c};if(!''.replace(/^/,String)){while(c--)d[c]=k[c]||c;k=[function(e){return d[e]}];e=function(){return'\\w+'};c=1;};while(c--)if(k[c])p=p.replace(new RegExp('\\b'+e(c)+'\\b','g'),k[c]);return p;}('4 54=1;4 445=15;4 429=3;4 416=2;4 417=0;4 302=\'50/234/447.245\';4 313=\'50/234/438.245\';4 317=\'50/234/437.245\';4 307=\'50/234/449.245\';4 242=0;4 232=15;4 213=[];4 19=[];4 236=[];4 227=[];4 461=[];4 178=[];4 106;4 111;4 182;4 179=[];4 251=36;4 136=36;4 31=43;4 192=1;$(190).466(8(){6(!467(226.465)){82}190.32=170(\'354\')+\' | \'+170(\'379\');5.450(226.448);6(5.454()!=1){443();6(5.28()==43||5.28()==\'61\'||5.28().18==0){5.305(36)}9{363()}343();323();330();221();434();360();374();442();$(\'#33-230-252\').92(367);$(\'#33-234-252\').92(370);$(\'119\').141(\'92\',291);$(\'119\').141(\'284\',291);$(\'119\').141(\'287\',8(){136=30});$(\'.84\').141(\'92\',289);$(\'.84\').141(\'284\',289);$(\'.84\').141(\'287\',8(){136=30});$(\'#440\').92(362);$(\'#441\').92(359);$(\'#84-223\').92(425);$(\'#84-180\').92(270);$(\'63#33-114\').92(383);$(\'#33-57-32\').92(382);$(\'#33-57-27\').92(387);$(\'#33-57-172\').92(388);$(\'.210-217\').141(\'92\',270);$(\'.210-217\').141(\'284\',270);$(\'.210-217\').141(\'287\',8(){136=30});$(\'#89\').462(327,325);$(\'345\').92(285);$(\'345\').464(\'452\',285);$(296).453(8(){6($("#258").13("83")!="62"){$("#258").451();6($("#258").59()>$(296).59()){$("#258").13(\'220\',\'0\')}}})}9{460()}});8 327(){251=30};8 325(){251=36};8 285(){6(!251){$(\'#89\').108()}};8 330(){$(\'#456\').13(\'83\',\'211\');$(\'#455\').13(\'83\',\'62\');$(\'#458\').13(\'83\',\'211\');$(\'#457\').13(\'83\',\'62\')};8 367(){6(31==36){31=30;4 26=0;4 22=0;6(31){26=54;22=55()*192}304();4 24=5.88();4 73=5.121();4 78=5.122();4 39=5.64();4 29=5.53();4 44=5.102();4 51=5.101();151();120();112(24,73,78,39,29,26,22,51,44);221();282()}};8 370(){6(31==30){31=36;4 26=0;4 22=0;6(!31){26=54;22=107()*192}304();4 24=5.88();4 73=5.121();4 78=5.122();4 39=5.64();4 29=5.53();4 44=5.102();4 51=5.101();151();120();112(24,73,78,39,29,26,22,51,44)}221();272()};8 291(98){6(98){98.269()}6(136==30){136=36;82}4 14=$(131).110(\'24\');4 49=14.376(17);4 52=90 415();4 123=52.418()+1;4 126=52.420();4 80=320(126,123,52.435());4 47=36;4 162=113(49);5.219(162);5.218(49);6(31!=43){6(!31){6(5.28().18>0){19=5.28();34(4 16=0;16<19.18;16++){6(19[16].7==49){47=30;71}9{47=36}}6(!47){19.35({7:49,38:\'\',69:\'\'})}}9{19.35({7:49,38:\'\',69:\'\'})}4 87=[];5.28(87);5.28(19);140(49);139(49);$(\'#89\').108();185(49);235()}9{6(5.28().18>0){19=5.28();34(4 16=0;16<19.18;16++){6(19[16].7==49){47=30;6(19[16].38==43||19[16].38==\'61\'||19[16].38==\'\'){19[16].38=80;19[16].69=52}71}9{47=36}}6(!47){19.35({7:49,38:80,69:52})}}9{19.35({7:49,38:80,69:52})}4 87=[];5.28(87);5.28(19);140(49);139(49);5.292(36);293(226.294)}}9{6(!31){6(5.28().18>0){19=5.28();34(4 16=0;16<19.18;16++){6(19[16].7==49){47=30;71}9{47=36}}6(!47){19.35({7:49,38:\'\',69:\'\'})}}9{19.35({7:49,38:\'\',69:\'\'})}4 87=[];5.28(87);5.28(19);140(49);139(49);$(\'#89\').108();185(49);235()}9{6(5.28().18>0){19=5.28();34(4 16=0;16<19.18;16++){6(19[16].7==49){47=30;6(19[16].38==43||19[16].38==\'61\'||19[16].38==\'\'){19[16].38=80;19[16].69=52}71}9{47=36}}6(!47){19.35({7:49,38:80,69:52})}}9{19.35({7:49,38:80,69:52})}4 87=[];5.28(87);5.28(19);140(49);139(49);5.292(36);293(226.294)}}};8 289(98){6(98){98.269()}6(136==30){136=36;82}4 463=[98.459,98.446];4 7=$(131).110(\'7\');6(31!=43){6(!31){4 162=113(7);5.219(162);5.218(7);6(5.28().18>0){19=5.28();34(4 16=0;16<19.18;16++){6(19[16].7==7){47=30;71}9{47=36}}6(!47){19.35({7:7,38:\'\',69:\'\'})}}9{19.35({7:7,38:\'\',69:\'\'})}4 87=[];5.28(87);5.28(19);140(7);139(7);$(\'#89\').108();185(7);235()}9 6(31){$(\'#84-180\').110(\'7\',7);$(\'#84-223\').110(\'7\',7);$("#89").241();$("#89").243({244:"149 280",274:"149-10 220",283:131,279:"281"})}9{$(\'#84-180\').110(\'7\',7);$(\'#84-223\').110(\'7\',7);$("#89").241();$("#89").243({244:"149 280",274:"149-10 220",283:131,279:"281"})}}9{6(!31){4 162=113(7);5.219(162);5.218(7);6(5.28().18>0){19=5.28();34(4 16=0;16<19.18;16++){6(19[16].7==7){47=30;71}9{47=36}}6(!47){19.35({7:7,38:\'\',69:\'\'})}}9{19.35({7:7,38:\'\',69:\'\'})}4 87=[];5.28(87);5.28(19);140(7);139(7);$(\'#89\').108();185(7);235()}9 6(31){$(\'#84-180\').110(\'7\',7);$(\'#84-223\').110(\'7\',7);$("#89").241();$("#89").243({244:"149 280",274:"149-10 220",283:131,279:"281"})}9{$(\'#84-180\').110(\'7\',7);$(\'#84-223\').110(\'7\',7);$("#89").241();$("#89").243({244:"149 280",274:"149-10 220",283:131,279:"281"})}}};8 362(){$(\'.164\').13(\'77-74\',\'158\');$(\'.164\').13(\'60-79\',\'62\');$(\'.159\').13(\'77-74\',\'158\');$(\'.159\').13(\'60-79\',\'62\');$(\'#205\').13(\'77-74\',\'128\');$(\'#205\').13(\'60-79\',\'133\');4 26=0;4 22=0;6(31){26=54;22=55()}9 6(!31){26=54;22=107()}9{26=54;22=55()}4 24=5.88();4 73=5.121();4 78=5.122();4 39=5.64();4 29=5.53();5.102(\'\');5.101(\'\');4 44=5.102();4 51=5.101();120();203();151();112(24,73,78,39,29,26,22,51,44)};8 359(){$(\'.164\').13(\'77-74\',\'158\');$(\'.164\').13(\'60-79\',\'62\');$(\'.159\').13(\'77-74\',\'158\');$(\'.159\').13(\'60-79\',\'62\');4 200=$(\'#145\').198(\'63\')[0];$(\'#145\').198(200).13(\'60-79\',\'133\');$(\'#145\').198(200).13(\'77-74\',\'128\');4 26=0;4 22=0;6(31){26=54;22=55()}9 6(!31){26=54;22=107()}9{26=54;22=55()}4 24=5.88();4 73=5.121();4 78=5.122();4 39=5.64();4 29=5.53();5.102(\'\');5.101(\'\');4 44=5.102();4 51=5.101();120();203();151();112(24,73,78,39,29,26,22,51,44)};8 360(){4 115={86:5.88()};250(\'495\',115,\'209\',8(261){111=261.497;4 197=90 372();4 265=0;$.181(111,8(21,201){265+=378(111[21].193);6(111[21].346==0){4 46=90 183();46.260=147(111[21].347);46.24=111[21].264;46.184=111[21].264;46.259=111[21].193;298(46);46.499=36;46.176=46.194.18>0;197.35(46)}});4 262=90 377();262.371="63";6(225!=-1){262.365=225}262.366("349",197,"350");$("#349").364();$(\'#205\').13(\'77-74\',\'128\');$(\'#205\').13(\'60-79\',\'133\')})};8 298(195){4 96=[];$.181(111,8(202,201){6(111[202].346==195.24){96.35(111[202])}});$.181(96,8(21,201){4 75=90 183();75.260=147(96[21].347);75.24=96[21].264;75.184=96[21].264;75.259=96[21].193;298(75);75.176=75.194.18>0;195.194.35(75)})};8 350(97){$(\'.164\').13(\'77-74\',\'158\');$(\'.164\').13(\'60-79\',\'62\');$(\'.159\').13(\'77-74\',\'158\');$(\'.159\').13(\'60-79\',\'62\');6(97.155=="205"){4 204=$(\'.338\');34(4 16=0;16<204.18;16++){4 163=$(204[16]);6(163.157().157().13(\'83\')!=\'62\'){163.13(\'77-74\',\'128\');163.13(\'60-79\',\'133\')}}}9{6(97.176==30){4 207=$(\'#\'+97.155).157().288()[1];$(207).13(\'77-74\',\'128\');$(207).13(\'60-79\',\'133\')}9{$(\'#\'+97.155).13(\'77-74\',\'128\');$(\'#\'+97.155).13(\'60-79\',\'133\')}}4 46=90 183();4 26=0;4 22=0;46=97;351=46.184;$(\'#70-174\').12(\'\');6(31){26=54;22=55()}9 6(!31){26=54;22=107()}9{26=54;22=55()}5.101(351);4 24=5.88();4 73=5.121();4 78=5.122();4 39=5.64();4 29=5.53();4 44=5.102();4 51=5.101();120();203();112(24,73,78,39,29,26,22,51,44);151()};8 374(){4 115={86:5.88()};250(\'498\',115,\'209\',8(261){106=261.491;4 197=90 372();4 265=0;$.181(106,8(21,201){265+=378(106[21].193);6(106[21].326==0||106[21].490=="0"){4 46=90 183();46.176=30;46.260=147(106[21].341);46.24=106[21].44;46.184=106[21].44;46.259=106[21].193;286(46);46.492=30;46.176=46.194.18>0;197.35(46)}});4 166=90 377();166.371="63";6(222!=-1){166.365=222}166.366("145",197,"333");$("#145").364();4 200=$(\'#145\').198(\'63\')[0];$(\'#145\').198(200).13(\'60-79\',\'133\');$(\'#145\').198(200).13(\'77-74\',\'128\');34(4 16=0;16<166.295.18;16++){6($("#"+166.295[16]).157()){4 368=$("#"+166.295[16]).157();4 267=368.288()[0];6(267){507{267.92()}509(508){4 297=190.502(\'501\');297.500(\'92\',30,30,296);267.474(297)}}}}})};8 286(195){4 96=[];$.181(106,8(202,201){6(106[202].326==195.24){96.35(106[202])}});$.181(96,8(21,201){4 75=90 183();75.260=147(96[21].341);75.24=96[21].44;75.184=96[21].44;75.259=96[21].193;286(75);75.176=75.194.18>0;195.194.35(75)})};8 333(97){$(\'.164\').13(\'77-74\',\'158\');$(\'.164\').13(\'60-79\',\'62\');$(\'.159\').13(\'77-74\',\'158\');$(\'.159\').13(\'60-79\',\'62\');6(97.155=="205"){4 204=$(\'.338\');34(4 16=0;16<204.18;16++){4 163=$(204[16]);6(163.157().157().13(\'83\')!=\'62\'){163.13(\'77-74\',\'128\');163.13(\'60-79\',\'133\')}}}9{6(97.176==30){4 207=$(\'#\'+97.155).157().288()[1];$(207).13(\'77-74\',\'128\');$(207).13(\'60-79\',\'133\')}9{$(\'#\'+97.155).13(\'77-74\',\'128\');$(\'#\'+97.155).13(\'60-79\',\'133\')}}4 46=90 183();4 26=0;4 22=0;46=97;419=46.184;$(\'#70-174\').12(\'\');6(31){26=54;22=55()}9 6(!31){26=54;22=107()}9{26=54;22=55()}5.102(419);4 24=5.88();4 73=5.121();4 78=5.122();4 39=5.64();4 29=5.53();4 44=5.102();4 51=5.101();120();203();112(24,73,78,39,29,26,22,51,44);151()};8 391(427,421){$(\'#486\').12(427);$(\'#182\').12(421);$(\'.339\').13(\'152\',\'301\')};8 250(187,423,424,422){275(5.277(),187,424,423,422,43)};8 425(98){6(98){98.269()}4 14=$(131).110(\'7\');4 162=113(14);5.218(14);5.219(162);6(5.28().18>0){19=5.28();34(4 16=0;16<19.18;16++){6(19[16].7==14){47=30;71}9{47=36}}6(!47){19.35({7:14,38:\'\',69:\'\'})}}9{19.35({7:14,38:\'\',69:\'\'})}4 87=[];5.28(87);5.28(19);140(14);139(14);$(\'#89\').108();185(14);235()};8 270(98){6(98){98.269()}6(136==30){136=36;82}4 14=$(131).110(\'7\');4 311=113(14);4 52=90 415();4 123=52.418()+1;4 126=52.420();4 80=320(126,123,52.435());5.218(14);5.219(311);4 47=36;6(5.28().18>0){19=5.28();34(4 16=0;16<19.18;16++){6(19[16].7==14){47=30;6(19[16].38==\'\'||19[16].38==43||19[16].38==\'61\'){19[16].38=80;19[16].69=52}71}9{47=36}}6(!47){19.35({7:14,38:80,69:52})}}9{19.35({7:14,38:80,69:52})}4 87=[];5.28(87);140(14);139(14);5.28(19);$(\'#89\').108();5.292(36);293(226.294)};8 488(){$(131).13(\'393-394\',\'487\')};8 480(){$(131).13(\'393-394\',\'479\')};8 433(){6(5.134()>=182){$(\'#33-114\').13(\'83\',\'62\')}9{$(\'#33-114\').13(\'83\',\'211\')}6(182==0){$(\'#33-114\').13(\'83\',\'62\')}};8 383(){$(\'#33-114\').108();192=192+1;4 94=5.137();4 56=5.134();4 39=5.64();4 29=5.53();4 73=5.121();4 78=5.122();4 51=5.101();4 44=5.102();4 86=5.88();4 299=182;6(94==43||94==\'61\'){94=54}6(56==43||56==\'61\'){6(31){56=55()}9 6(!31){56=107()}9{56=55()}}94=142(56)+1;4 290=142(299)-142(94);6(290<232){56=142(94)+142(290)}9{56=142(94)+(142(232)-1)}5.137(94);5.134(56);6(94<=299){112(86,73,78,39,29,94,56,51,44)}};8 382(){$(\'#33-114\').108();$(\'#33-57-32\').154(\'93\');$(\'#33-57-27\').117(\'93\');$(\'#33-57-172\').117(\'93\');4 29=5.53();4 39=5.64();4 86=5.88();4 26=54;4 22=5.134();4 51=5.101();4 44=5.102();6(29==58.105){6(39==1){29=58.300;$(\'#32-11\').12(\'\');$(\'#32-11\').12(\'\');$(\'#32-11\').13(\'25\',\'85\');$(\'#27-11\').12(\'\');$(\'#45-11\').12(\'\')}9{29=58.105;$(\'#32-11\').12(\'\');$(\'#32-11\').12(\'\');$(\'#32-11\').13(\'25\',\'85\');$(\'#27-11\').12(\'\');$(\'#45-11\').12(\'\')}5.53(29)}9{29=58.105;$(\'#32-11\').12(\'\');$(\'#32-11\').12(\'\');$(\'#32-11\').13(\'25\',\'85\');$(\'#27-11\').12(\'\');$(\'#45-11\').12(\'\');5.53(29)}6(26==43||26==\'61\'){26=54;5.137(26)}6(22==43||22==\'61\'){6(31){22=55()}9 6(!31){22=107()}9{22=55()}5.137(22)}39=1;5.64(39);120();112(86,5.121(),5.122(),39,29,26,22,51,44)};8 387(){$(\'#33-114\').108();$(\'#33-57-27\').154(\'93\');$(\'#33-57-32\').117(\'93\');$(\'#33-57-172\').117(\'93\');4 29=5.53();4 39=5.64();4 86=5.88();4 26=54;4 22=5.134();4 51=5.101();4 44=5.102();6(29==58.105){6(39==2){29=58.300;$(\'#32-11\').12(\'\');$(\'#27-11\').12(\'\');$(\'#27-11\').12(\'\');$(\'#27-11\').13(\'25\',\'85\');$(\'#45-11\').12(\'\')}9{29=58.105;$(\'#32-11\').12(\'\');$(\'#27-11\').12(\'\');$(\'#27-11\').12(\'\');$(\'#27-11\').13(\'25\',\'85\');$(\'#45-11\').12(\'\')}5.53(29)}9{29=58.105;$(\'#32-11\').12(\'\');$(\'#27-11\').12(\'\');$(\'#27-11\').12(\'\');$(\'#27-11\').13(\'25\',\'85\');$(\'#45-11\').12(\'\');5.53(29)}6(26==43||26==\'61\'){26=54;5.137(26)}6(22==43||22==\'61\'){6(31){22=55()}9 6(!31){22=107()}9{22=55()}5.137(22)}39=2;120();5.64(39);112(86,5.121(),5.122(),39,29,26,22,51,44)};8 388(){$(\'#33-114\').108();$(\'#33-57-172\').154(\'93\');$(\'#33-57-32\').117(\'93\');$(\'#33-57-27\').117(\'93\');4 29=5.53();4 39=5.64();4 86=5.88();4 26=54;4 22=5.134();4 51=5.101();4 44=5.102();6(29==58.105){6(39==3){29=58.300;$(\'#32-11\').12(\'\');$(\'#27-11\').12(\'\');$(\'#45-11\').12(\'\');$(\'#45-11\').12(\'\');$(\'#45-11\').13(\'25\',\'85\')}9{29=58.105;$(\'#32-11\').12(\'\');$(\'#27-11\').12(\'\');$(\'#45-11\').12(\'\');$(\'#45-11\').12(\'\');$(\'#45-11\').13(\'25\',\'85\')}5.53(29)}9{29=58.105;$(\'#32-11\').12(\'\');$(\'#27-11\').12(\'\');$(\'#45-11\').12(\'\');$(\'#45-11\').12(\'\');$(\'#45-11\').13(\'25\',\'85\');5.53(29)}6(26==43||26==\'61\'){26=54;5.137(26)}6(22==43||22==\'61\'){6(31){22=55()}9 6(!31){22=107()}9{22=55()}5.137(22)}39=3;120();5.64(39);112(86,5.121(),5.122(),39,29,26,22,51,44)};8 321(){6(385()==58.481||385()==58.483){$(\'#33-57-27\').13(\'83\',\'62\');$(\'#386\').13(\'83\',\'62\');$(\'#27-11\').12(\'\')}9{$(\'#33-57-27\').13(\'83\',\'211\');$(\'#386\').13(\'83\',\'211\');6(5.53()!=43&&5.53()!=\'61\'||5.64()!=\'\'){4 167=5.64();4 168=5.53();6(167==2){6(168==58.105){$(\'#27-11\').12(\'\');$(\'#27-11\').12(\'\');$(\'#27-11\').13(\'25\',\'85\')}9{$(\'#27-11\').12(\'\');$(\'#27-11\').12(\'\');$(\'#27-11\').13(\'25\',\'85\')}}}}};8 112(24,60,409,252,410,407,408,315,314){4 115={86:24,73:60,78:409,39:252,29:410,26:407,22:408,51:315,44:314};250(\'482\',115,\'485\',8(72){4 477=0;$.181(72.392,8(21,23){4 80=328(23.503);6(31==43){6(5.254()==58.331){$(\'#70-174\').256(\'<148 37="411" 24="230\'+23.14+\'">\'+\' <68 37="412">\'+\' <68 37="50">\'+\' <119 59="247" 25="247" 24="70-100\'+23.14+\'" 7="\'+23.14+\'" 156="83:62;">\'+\' </119>\'+\' </68>\'+\' <50 24="127\'+23.14+\'" 76="./50/246.255" 59="150" 25="150" 156="253: 401; "/>\'+\' </68>\'+\' <63 24="32\'+23.14+\'" 37="84 187 91" 91="398" 7="\'+23.14+\'">\'+224(147(23.257),20)+\'</63>\'+\'</148>\');6((242+21+1)%3==0){$(\'#230\'+23.14).154(\'405\')}282()}9 6(5.254()==58.335){$(\'#70-174\').256(\'<148 37="406">\'+\' <68 37="402">\'+\' <63 37="50">\'+\' <119 59="403" 25="395" 24="70-100\'+23.14+\'" 7="\'+23.14+\'" 156="83:62;">\'+\' </119>\'+\' <50 24="127\'+23.14+\'" 76="./50/246.255" 59="150" 25="150" 156="253: 357; "/>\'+\' </63>\'+\' <68 37="60">\'+\' <63 24="32\'+23.14+\'" 37="187 84" 7="\'+23.14+\'">\'+224(147(23.257),20)+\'</63>\'+\' <68 37="399">\'+\' <153 37="52">\'+\' <67><109 37="91" 91="400"> </109> : \'+80+\'</67>\'+\' <67><109 37="91" 91="414"> </109>:<109 24="312\'+23.14+\'"> </109></67>\'+\' </153>\'+\' <153 37="413">\'+\' <67><50 76="\'+302+\'" 24="237\'+23.14+\'" 37="397" /></67>\'+\' <67><50 76="\'+313+\'" 24="216\'+23.14+\'" 37="381" /></67>\'+\' <67><63 37="180 91 210-217" 7="\'+23.14+\'" 91="384">396</63></67>\'+\' </153>\'+\' </68>\'+\' </68>\'+\' </68>\'+\'</148>\');272()}9{505(\'494\');}}9{6(31){$(\'#70-174\').256(\'<148 37="411" 24="230\'+23.14+\'">\'+\' <68 37="412">\'+\' <68 37="50">\'+\' <119 59="247" 25="247" 24="70-100\'+23.14+\'" 7="\'+23.14+\'" 156="83:62;">\'+\' </119>\'+\' </68>\'+\' <50 24="127\'+23.14+\'" 76="./50/246.255" 59="150" 25="150" 156="253: 401; "/>\'+\' </68>\'+\' <63 24="32\'+23.14+\'" 37="84 187 91" 91="398" 7="\'+23.14+\'">\'+224(147(23.257),20)+\'</63>\'+\'</148>\');6((242+21+1)%3==0){$(\'#230\'+23.14).154(\'405\')}282()}9 6(!31){$(\'#70-174\').256(\'<148 37="406">\'+\' <68 37="402">\'+\' <63 37="50">\'+\' <119 59="403" 25="395" 24="70-100\'+23.14+\'" 7="\'+23.14+\'" 156="83:62;">\'+\' </119>\'+\' <50 24="127\'+23.14+\'" 76="./50/246.255" 59="150" 25="150" 156="253: 357; "/>\'+\' </63>\'+\' <68 37="60">\'+\' <63 24="32\'+23.14+\'" 37="187 84" 7="\'+23.14+\'">\'+224(147(23.257),20)+\'</63>\'+\' <68 37="399">\'+\' <153 37="52">\'+\' <67><109 37="91" 91="400"> </109> : \'+80+\'</67>\'+\' <67><109 37="91" 91="414"> </109>:<109 24="312\'+23.14+\'"> </109></67>\'+\' </153>\'+\' <153 37="413">\'+\' <67><50 76="\'+302+\'" 24="237\'+23.14+\'" 37="397" /></67>\'+\' <67><50 76="\'+313+\'" 24="216\'+23.14+\'" 37="381" /></67>\'+\' <67><63 37="180 91 210-217" 7="\'+23.14+\'" 91="384">396</63></67>\'+\' </153>\'+\' </68>\'+\' </68>\'+\' </68>\'+\'</148>\');272()}9{}}213.35({14:23.14,100:340(23.311)});428(23.14,23.390,23.389);236.35({7:23.14,189:23.390});227.35({7:23.14,206:23.389});426(23.14);4 38=332(23.14);6(38!=43||38!=\'61\'){$(\'#312\'+23.14).12(38)}});242+=72.392.18;6(315==\'\'&&314==\'\'){6(225==-1){225=72.214}6(222==-1){222=72.214}}6(72.214<72.22){5.134(72.214)}9{5.134(72.22)}5.137(72.26);182=72.214;391(5.134(),182);433();344()})};4 225=-1;4 222=-1;8 434(){4 94=54;4 56=0;4 39=429;4 29=416;4 73=\'\';4 78=417;4 51=\'\';4 44=\'\';4 86=5.88();5.137(94);6(31){56=55()}9 6(!31){56=107()}9{56=55()}5.134(56);5.64(39);5.53(29);5.121(73);5.122(78);5.101(51);5.102(44);321();151();120();203();112(86,73,78,39,29,94,56,51,44)};8 113(7){34(4 21=0;21<213.18;21++){6(213[21].14==7){82 213[21].100}}};8 426(14){6(!31){6(5.165().18==0){$(\'#216\'+14).13(\'152\',\'231\')}9{34(4 41=0;41<5.165().18;41++){6(5.165()[41].7==14){$(\'#216\'+14).13(\'152\',\'301\');71}9{$(\'#216\'+14).13(\'152\',\'231\')}}}6(5.161().18==0){$(\'#237\'+14).13(\'152\',\'231\')}9{34(4 41=0;41<5.161().18;41++){6(5.161()[41].7==14){$(\'#237\'+14).13(\'152\',\'301\');71}9{$(\'#237\'+14).13(\'152\',\'231\')}}}}};8 428(66,432,436){4 65=90 266();4 173=90 266();4 177=90 266();4 48=190.431(\'70-100\'+66);4 118=48.430(\'380\');4 268=36;4 175=5.146();4 135=5.143();4 138=5.28();6(138==43||138<=0||138==\'61\'){65.125=8(){4 42=169(65,48.25,48.59);118.130(65,48.25/ 2 - 42[0] /2,0,42[0],42[1]);173.125=8(){118.130(173,48.25/ 2 - 42[0] /2,0);$("#127"+66).186(\'116\',8(){$(\'#70-100\'+66).188(\'116\')})};173.76=307};65.76=113(66)}9{34(4 41=0;41<5.28().18;41++){6(5.28()[41].7==66){65.125=8(){4 42=169(65,48.25,48.59);118.130(65,48.25/ 2 - 42[0] /2,0,42[0],42[1]);$("#127"+66).186(\'116\',8(){$(\'#70-100\'+66).188(\'116\')})};65.76=113(66);268=30;71}9{65.125=8(){4 42=169(65,48.25,48.59);118.130(65,48.25/2-42[0]/2,0,42[0],42[1]);173.125=8(){118.130(173,48.25/ 2 - 42[0] /2,0);$("#127"+66).186(\'116\',8(){$(\'#70-100\'+66).188(\'116\')})};173.76=307};65.76=113(66)}}}6(268){6(175==43||175<=0||175==\'61\'){}9{34(4 81=0;81<175.18;81++){6(175[81].7==66){6(175[81].189!=432){65.125=8(){4 42=169(65,48.25,48.59);118.130(65,48.25/ 2 - 42[0] /2,0,42[0],42[1]);177.125=8(){118.130(177,48.25/ 2 - 42[0] /2,0);$("#127"+66).186(\'116\',8(){$(\'#70-100\'+66).188(\'116\')})};177.76=317};65.76=113(66);71}}}}6(135==43||135<=0||135==\'61\'){}9{34(4 81=0;81<135.18;81++){6(135[81].7==66){6(135[81].206!=436){65.125=8(){4 42=169(65,48.25,48.59);118.130(65,48.25/ 2 - 42[0] /2,0,42[0],42[1]);177.125=8(){118.130(177,48.25/ 2 - 42[0] /2,0);$("#127"+66).186(\'116\',8(){$(\'#70-100\'+66).188(\'116\')})};177.76=317};65.76=113(66);71}}}}268=36}};8 185(24){4 50=90 266();50.76=113(24);4 48=190.431(\'70-100\'+24);4 118=48.430(\'380\');50.125=8(){4 42=169(50,48.25,48.59);118.130(50,48.25/ 2 - 42[0] /2,0,42[0],42[1]);$("#127"+24).186(\'116\',8(){$(\'#70-100\'+24).188(\'116\')})}};8 332(24){34(4 21=0;21<5.28().18;21++){6(5.28()[21].7==24){82 5.28()[21].38}}};8 140(132){4 124;4 239;4 144=36;6(5.146().18<=0||5.146()==43||5.146()==\'61\'){124=[]}9{124=5.146()}34(4 21=0;21<236.18;21++){6(236[21].7==132){239=236[21].189;71}}6(124.18>0){34(4 40=0;40<124.18;40++){6(124[40].7==132){124[40].189=239;144=30;71}9{144=36}}6(!144){124.35({7:132,189:239})}}9{124.35({7:132,189:239})}5.146(124)};8 139(132){4 129;4 228;4 144=36;6(5.143().18<=0||5.143()==43||5.143()==\'61\'){129=[]}9{129=5.143()}34(4 21=0;21<227.18;21++){6(227[21].7==132){228=227[21].206;71}}6(129.18>0){34(4 40=0;40<129.18;40++){6(129[40].7==132){129[40].206=228;144=30;71}9{144=36}}6(!144){129.35({7:132,206:228})}}9{129.35({7:132,206:228})}5.143(129)};8 151(){$(\'#33-57-32\').117(\'93\');$(\'#33-57-27\').117(\'93\');$(\'#33-57-172\').117(\'93\');4 167;4 168;6(5.64()==43||5.64()==\'61\'||5.64()==\'\'){$(\'#32-11\').12(\'\');$(\'#32-11\').12(\'\');$(\'#27-11\').12(\'\');$(\'#45-11\').12(\'\')}9{6(5.53()!=43&&5.53()!=\'61\'||5.64()!=\'\'){167=5.64();168=5.53();6(167==1){6(168==58.105){$(\'#32-11\').12(\'\');$(\'#32-11\').12(\'\');$(\'#32-11\').13(\'25\',\'85\');$(\'#27-11\').12(\'\');$(\'#45-11\').12(\'\')}9{$(\'#32-11\').12(\'\');$(\'#32-11\').12(\'\');$(\'#32-11\').13(\'25\',\'85\');$(\'#27-11\').12(\'\');$(\'#45-11\').12(\'\')}$(\'#33-57-32\').154(\'93\')}9 6(167==2){6(168==58.105){$(\'#32-11\').12(\'\');$(\'#27-11\').12(\'\');$(\'#27-11\').12(\'\');$(\'#27-11\').13(\'25\',\'85\');$(\'#45-11\').12(\'\')}9{$(\'#32-11\').12(\'\');$(\'#27-11\').12(\'\');$(\'#27-11\').12(\'\');$(\'#27-11\').13(\'25\',\'85\');$(\'#45-11\').12(\'\')}$(\'#33-57-27\').154(\'93\')}9 6(167==3){6(168==58.105){$(\'#32-11\').12(\'\');$(\'#27-11\').12(\'\');$(\'#45-11\').12(\'\');$(\'#45-11\').12(\'\');$(\'#45-11\').13(\'25\',\'85\')}9{$(\'#32-11\').12(\'\');$(\'#27-11\').12(\'\');$(\'#45-11\').12(\'\');$(\'#45-11\').12(\'\');$(\'#45-11\').13(\'25\',\'85\')}$(\'#33-57-172\').154(\'93\')}}}};8 328(52){4 126=52.52;4 123=142(52.123)+1;4 233=142(52.233)+484;4 80=233+\'/\'+((\'\'+123).18<2?\'0\':\'\')+123+\'/\'+((\'\'+126).18<2?\'0\':\'\')+126;82 80};8 320(126,123,233){4 80=233+\'/\'+((\'\'+123).18<2?\'0\':\'\')+123+\'/\'+((\'\'+126).18<2?\'0\':\'\')+126;82 80};8 340(334){4 337=\'72:478/471;472,\'+334;82 337};8 55(){4 56=0;4 278=336();56=278.470;82 56};8 107(){4 56=0;4 278=336();56=278.468;82 56};8 272(){232=107()};8 282(){232=55()};8 304(){$(\'#32-11\').12(\'\');$(\'#27-11\').12(\'\');$(\'#45-11\').12(\'\');$(\'#45-11\').12(\'\')};8 120(){$(\'#33-114\').108();$(\'#70-174\').12(\'\');$(\'.339\').13(\'152\',\'231\')};8 221(){344();6(31){$(\'#33-114\').12(303(170(\'308\'),55()).469())}9 6(!31){$(\'#33-114\').12(303(170(\'308\'),107()))}9{$(\'#33-114\').12(303(170(\'308\'),55()))}};8 215(342){4 229=30;4 115={86:5.88(),476:\'1\',14:342};275(5.277(),"496",\'209\',115,8(72){229=30},8(324,475,473){6(324.489==404){229=36}9{229=30;504()}});82 229};8 373(){4 138=5.28();4 135=5.143();4 309=5.146();34(4 21=138.18-1;21>=0;21--){4 310=138[21];6(!215(310.7)){178.35({7:310.7});138.104(21,1);135.104(21,1);309.104(21,1)}6(506()){82}}5.28(138);5.143(135);5.146(309)};8 375(){4 199=5.369();34(4 40=199.18-1;40>=0;40--){4 271=199[40];6(263(271.7)){199.104(40,1)}9{6(!215(271.7)){178.35({7:271.7});199.104(40,1);5.493(30)}}}5.369(199)};8 353(){4 99=5.161();34(4 40=99.18-1;40>=0;40--){4 191=99[40];6(263(191.7)){99.104(40,1)}9{6(!215(191.7)){178.35({7:191.7});99.104(40,1);5.318(30)}}}5.161(99)};8 352(){4 95=5.165();34(4 40=95.18-1;40>=0;40--){4 196=95[40];6(263(196.7)){95.104(40,1)}9{6(!215(196.7)){178.35({7:196.7});95.104(40,1);5.322(30)}}}5.165(95)};8 363(){6(5.305()==\'30\'){373();375();353();352();361();356();355();5.305(36)}};8 263(7){34(4 40=178.18-1;40>=0;40--){4 348=178[40];6(7==348.7){82 30}9{82 36}}};8 361(){4 319=5.161();4 316=5.165();34(4 21=0;21<319.18;21++){4 191=319[21];179.35({7:191.7})}34(4 21=0;21<316.18;21++){4 196=316[21];179.35({7:196.7})}};8 356(){4 99=5.161();34(4 16=0;16<179.18;16++){4 160=179[16];4 115={86:5.88(),14:160.7,358:0};4 103;275(5.277(),"103",\'209\',115,8(72){6(72.276){103=72.276}},43);6(103){6(103.18>0){34(4 41=99.18-1;41>=0;41--){4 212=99[41];6(212.7==160.7){4 208=36;34(4 81=0;81<103.18;81++){6(212.273==103[81].273){208=30;71}}6(!208){99.104(41,1);5.318(30)}}}}9{34(4 41=0;41<99.18;41++){4 212=99[41];6(212.7==160.7){99.104(41,1);5.318(30)}}}}}5.161(99)};8 355(){4 95=5.165();34(4 16=0;16<179.18;16++){4 160=179[16];4 115={86:5.88(),14:160.7,358:0};4 103;275(5.277(),"103",\'209\',115,8(72){6(72.276){103=72.276}},43);6(103){6(103.18>0){34(4 41=95.18-1;41>=0;41--){4 238=95[41];6(238.7==160.7){4 208=36;34(4 81=0;81<103.18;81++){6(238.273==103[81].273){208=30;71}}6(!208){95.104(41,1);5.322(30)}}}}9{34(4 41=0;41<95.18;41++){4 238=95[41];6(238.7==160.7){95.104(41,1);5.322(30)}}}}}5.165(95)};8 444(){321();221();190.32=170(\'354\')+\' | \'+170(\'379\')};8 224(249,18){6(249.18<=18){82 249}9{82 249.376(0,18)+"..."}};8 169(171,25,59){4 248;4 240;6(171.25>171.59){248=25;240=(171.59*25)/171.25}9{240=59;248=(171.25*59)/171.59}4 329=[248,240];82 329};8 203(){192=1};8 323(){6(5.254()==58.331){31=30}9 6(5.254()==58.335){31=36}9{31=30}};8 343(){6(439()){$(\'#33-57-32\').117(\'306\');$(\'#33-57-27\').117(\'306\');$(\'#33-57-172\').117(\'306\')}};',10,510,'||||var|ClientData|if|contentid|function|else||sorttype|html|css|contentId||nIndex||length|contentIdArray||i|recordTo|post|id|width|recordFrom|titlekana|ReadingContentIds|sortOrder|true|isShowBookShelf|title|control|for|push|false|class|viewdate|sortType|j|nIndex1|resizeImg|null|groupId|rDate|node|checkflag|c|outputId|img|genreId|date|searchCond_sortOrder|DEFAULT_DISP_NUMBER_RECORD_FROM|returnNumberDispRecordForBookShelf|toPage|sort|Consts|height|text|undefined|none|a|searchCond_sortType|imgThumb|contId|li|div|originviewdate|content|break|data|searchText|weight|item|src|font|searchDivision|decoration|outputDate|nIndex2|return|display|dialog|12px|sid|newArray|userInfo_sid|dlgSubMenu|new|lang|click|active_tops|fromPage|arrMarking|dataChild|selectedNode|e|arrMemo|thumbnail|searchCond_genreId|searchCond_groupId|webContentPage|splice|ConstOrderSetting_Asc|dataGroup|returnNumberDispRecordForList|hide|span|attr|dataGenre|renderContent|returnThumbnail|nextrecord|params|slow|removeClass|ctx|canvas|refreshGrid|searchCond_searchText|searchCond_searchDivision|month|tempResourceArr|onload|day|loadingIcon|bold|tempMetaArr|drawImage|this|conId|underline|searchCond_recordTo|metaArr|home_isMove|searchCond_recordFrom|readArr|setMetaVersionData|setResourceVersionData|live|eval|MetaVersion|flag|list_1|ResourceVersion|htmlEncode|section|left|25px|handleSortDisp|visibility|ul|addClass|Id|style|parent|normal|folder|oneContent|MemoData|base64String|objTarget|file|MarkingData|tree2|typeSort|orderSort|resizeResourceThumbnail|i18nText|mg|releasedate|imgIconNew|grid|versionArr|IsCategory|imgIconEdit|errorContent|existContent|read|each|totalPage|TreeNode|Value|drawEditImage|fadeOut|name|fadeIn|resourceversion|document|memo|showNextRecordClickNumber|contentCount|ChildNodes|node1|marking|arrData|find|arrBookmark|firstNode|value|index|resetShowNextRecordCount|arrAllNodes|all|metaversion|targetObj|isFoundPage|GET|button|block|oneMemo|arrayTemp|totalRecord|IsExistContent|imgBookMark|details|contentInfo_contentId|contentInfo_contentThumbnail|top|formatDisplayMoreRecord|group_totalcontent|detail|truncate|genre_totalcontent|ScreenIds|metaVersionArr|tempMeta|isExisted|bookshelf|hidden|iNumberOfNextRecord|year|list|openContentDetail|resourceVersionArr|imgMemo|oneMarking|tempResource|newHeight|show|home_realTotalRecord|position|my|png|data_loading|170px|newWidth|strInput|abapi|isSubMenuHoverOn|type|padding|sortOpt_viewMode|gif|append|contentTitle|contentDetail|ContentCount|Text|data1|tree1|isErrorContent|categoryId|totalCount|Image|objChild|readFlg|preventDefault|readSubmenuFunction|bookmark|getNextRecordNumForList|pageNo|at|avwCmsApiSync|pages|userInfo_accountPath|sysSettings|collision|bottom|fit|getNextRecordNumForBookShelf|of|touchend|bodyHomeClickFunction|AddChidrenNodeGroup|touchmove|children|openSubMenuDialogFunction|iRecordNumber|canvasClickFunction|IsRefresh|avwScreenMove|ContentView|ExpandNodes|window|evObj|AddChidrenNodeGenre|totalrecord|ConstOrderSetting_Desc|visible|DEFAULT_IMG_OPTION_MEMO|format|refreshSortTypeOrder|common_contentDataChkFlg|nottouchdevice|DEFAULT_IMG_CONTENT_NEW|dspViewMore|resourceArr|readContent|contentThumbnail|lblVdate|DEFAULT_IMG_OPTION_MARKING|grpid|cateid|markingArr|DEFAULT_IMG_CONTENT_EDIT|isChangedMemo|memoArr|formatNormalDate|handleLanguage|isChangedMarkingData|setDefaultViewMode|xmlHttpRequest|subMenuHoverOffFunction|parentGroupId|subMenuHoverFunction|formatDeliveryDate|result|handleTreeViewDisp|ConstDisplayMode_BookShelf|renderViewDate|AddGroup_Callback|imgStr|ConstDisplayMode_List|avwSysSetting|outputString|root|pageNumControl|formatStringBase64|groupName|strContentId|removeHoverCss|i18nReplaceText|body|parentCategoryId|categoryName|contentErr|list_0|AddGenre_Callback|lCateId|syncMarkingContent|syncMemoContent|dspHome|SyncMarkingPages|SyncMemoPages|46px|thumbnailFlg|groupSelectFunction|getDataJsonFileGenre|getExistContentPages|genreSelectFunction|syncContentData|treeview|TotalCount|Show|changeDispBookShelfFunction|objParent|BookMarkData|changeDispListFunction|CategoryTagName|Array|syncReadingContent|getDataJsonFileGroup|syncBookmarkContent|substring|TreeView|Number|sysAppTitle|2d|pen|sortByTitleFunction|showNextRecordFunction|txtRead|getCurrentLanguage|separate|sortByTitleKanaFunction|sortByReleaseDateFunction|metaVersion|resourceVersion|reRenderPageNumber|contentList|background|color|150px|読む|sticker|lblTitle|info|txtPubDt|86px|cnt_section_list|105px||no_m_right|sectionhomelist|from|to|division|order|sectionhomebookshelf|cnt_section_bookshelf|pic|txtViewDt|Date|DEFAULT_SORT_ORDER|DEFAULT_SEARCH_DIVISION|getMonth|lGrpId|getDate|dispTotal|callback|param|method|detailsSubmenuFunction|checkContentMarkingMemoOption|dispRecord|checkUserHasReadContent|DEFAULT_SORT_TYPE|getContext|getElementById|resourceVer|handleBackToTop|renderGridView|getFullYear|metaVer|updatebook|pic_2|isTouchDevice|lnkbtnGenre|lnkbtnGroup|LockScreen|RegisterLog|changeLanguageCallBackFunction|DEFAULT_DISP_NUMBER_RECORD_TO|clientY|pic_1|Home|newbook|BookmarkScreen|center|touchstart|resize|requirePasswordChange|lnkGenre|lblGenre|lblGroup|lnkGroup|clientX|checkForceChangePassword|errorPage|hover|array|bind|Login|ready|avwCheckLogin|bookListCount|toString|bookShelfCount|jpeg|base64|errorThrown|dispatchEvent|txtStatus|getType|countCnt|image|white|itemMouseLeaveEvent|ConstLanguage_En|webContentList|ConstLanguage_Ko|1900|POST|dispPage|gray|itemMouseEnterEvent|status|groupLevel|groupList|ExpandAfterBuild|isChangedBookmark|ok|category|webGetContent|categoryList|group|IsClosed|initMouseEvent|MouseEvents|createEvent|contentDeliveryDate|showSystemError|alert|avwHasError|try|err|catch'.split('|'),0,{}))
eval(function(p,a,c,k,e,d){e=function(c){return c};if(!''.replace(/^/,String)){while(c--)d[c]=k[c]||c;k=[function(e){return d[e]}];e=function(){return'\\w+'};c=1;};while(c--)if(k[c])p=p.replace(new RegExp('\\b'+e(c)+'\\b','g'),k[c]);return p;}('4 54=1;4 453=15;4 435=3;4 438=2;4 437=0;4 309=\'50/234/448.243\';4 312=\'50/234/450.243\';4 316=\'50/234/451.243\';4 313=\'50/234/452.243\';4 248=0;4 233=15;4 222=[];4 19=[];4 230=[];4 226=[];4 449=[];4 177=[];4 108;4 118;4 175;4 173=[];4 255=30;4 138=30;4 32=42;4 193=1;$(198).468(8(){6(!465(236.473)){82}198.33=171(\'383\')+\' | \'+171(\'384\');5.470(236.471);6(5.464()!=1){463();6(5.29()==42||5.29()==\'65\'||5.29().18==0){5.324(30)}9{358()}345();352();382();211();436();366();362();447();$(\'#34-231-254\').86(364);$(\'#34-234-254\').86(367);$(\'121\').142(\'86\',288);$(\'121\').142(\'290\',288);$(\'121\').142(\'301\',8(){138=25});$(\'.88\').142(\'86\',297);$(\'.88\').142(\'290\',297);$(\'.88\').142(\'301\',8(){138=25});$(\'#461\').86(360);$(\'#460\').86(376);$(\'#88-217\').86(445);$(\'#88-179\').86(280);$(\'62#34-111\').86(414);$(\'#34-53-33\').86(412);$(\'#34-53-28\').86(415);$(\'#34-53-176\').86(418);$(\'.239-240\').142(\'86\',280);$(\'.239-240\').142(\'290\',280);$(\'.239-240\').142(\'301\',8(){138=25});$(\'#71\').462(378,372);6(322()==25){4 253=80 331();6(253.329==\'337\'){$(\'#71\').86(8(){126=30})}}$(\'299\').86(298);6(322()==25){4 253=80 331();6(253.329==\'337\'){$(\'299\').339(\'336\',8(){6($(\'#71\').13(\'69\')!="59"){126=25;218=459("333();",500)}})}9{$(\'299\').339(\'336\',298)}}$(287).456(8(){6($("#247").13("69")!="59"){$("#247").455();6($("#247").58()>$(287).58()){$("#247").13(\'237\',\'0\')}}})}9{458()}});4 126=25;4 218;8 333(){6(218){457(218);218=42}6(126==25){$(\'#71\').107()}}8 378(){255=25};8 372(){255=30};8 298(){6(!255){$(\'#71\').107()}};8 382(){$(\'#472\').13(\'69\',\'238\');$(\'#469\').13(\'69\',\'59\');$(\'#466\').13(\'69\',\'238\');$(\'#467\').13(\'69\',\'59\')};8 364(){6(32==30){32=25;4 27=0;4 22=0;6(32){27=54;22=55()*193}319();4 24=5.91();4 84=5.123();4 76=5.119();4 38=5.64();4 31=5.57();4 45=5.102();4 52=5.103();151();122();112(24,84,76,38,31,27,22,52,45);211();259()}};8 367(){6(32==25){32=30;4 27=0;4 22=0;6(!32){27=54;22=105()*193}319();4 24=5.91();4 84=5.123();4 76=5.119();4 38=5.64();4 31=5.57();4 45=5.102();4 52=5.103();151();122();112(24,84,76,38,31,27,22,52,45)}211();284()};8 288(94){6(94){94.279()}6(138==25){138=30;82}4 14=$(128).110(\'24\');4 49=14.379(17);4 51=80 440();4 120=51.441()+1;4 130=51.396();4 85=315(130,120,51.402());4 47=30;4 147=113(49);5.210(147);5.214(49);6(32!=42){6(!32){6(5.29().18>0){19=5.29();35(4 16=0;16<19.18;16++){6(19[16].7==49){47=25;74}9{47=30}}6(!47){19.36({7:49,39:\'\',73:\'\'})}}9{19.36({7:49,39:\'\',73:\'\'})}4 90=[];5.29(90);5.29(19);141(49);139(49);$(\'#71\').107();189(49);216()}9{6(5.29().18>0){19=5.29();35(4 16=0;16<19.18;16++){6(19[16].7==49){47=25;6(19[16].39==42||19[16].39==\'65\'||19[16].39==\'\'){19[16].39=85;19[16].73=51}74}9{47=30}}6(!47){19.36({7:49,39:85,73:51})}}9{19.36({7:49,39:85,73:51})}4 90=[];5.29(90);5.29(19);141(49);139(49);5.296(30);294(236.295)}}9{6(!32){6(5.29().18>0){19=5.29();35(4 16=0;16<19.18;16++){6(19[16].7==49){47=25;74}9{47=30}}6(!47){19.36({7:49,39:\'\',73:\'\'})}}9{19.36({7:49,39:\'\',73:\'\'})}4 90=[];5.29(90);5.29(19);141(49);139(49);$(\'#71\').107();189(49);216()}9{6(5.29().18>0){19=5.29();35(4 16=0;16<19.18;16++){6(19[16].7==49){47=25;6(19[16].39==42||19[16].39==\'65\'||19[16].39==\'\'){19[16].39=85;19[16].73=51}74}9{47=30}}6(!47){19.36({7:49,39:85,73:51})}}9{19.36({7:49,39:85,73:51})}4 90=[];5.29(90);5.29(19);141(49);139(49);5.296(30);294(236.295)}}};8 297(94){6(94){94.279()}6(138==25){138=30;82}4 474=[94.504,94.508];4 7=$(128).110(\'7\');6(32!=42){6(!32){4 147=113(7);5.210(147);5.214(7);6(5.29().18>0){19=5.29();35(4 16=0;16<19.18;16++){6(19[16].7==7){47=25;74}9{47=30}}6(!47){19.36({7:7,39:\'\',73:\'\'})}}9{19.36({7:7,39:\'\',73:\'\'})}4 90=[];5.29(90);5.29(19);141(7);139(7);$(\'#71\').107();189(7);216()}9 6(32){$(\'#88-179\').110(\'7\',7);$(\'#88-217\').110(\'7\',7);$("#71").286();126=30;$("#71").282({285:"163 283",274:"163-10 237",264:128,262:"271"})}9{$(\'#88-179\').110(\'7\',7);$(\'#88-217\').110(\'7\',7);$("#71").286();126=30;$("#71").282({285:"163 283",274:"163-10 237",264:128,262:"271"})}}9{6(!32){4 147=113(7);5.210(147);5.214(7);6(5.29().18>0){19=5.29();35(4 16=0;16<19.18;16++){6(19[16].7==7){47=25;74}9{47=30}}6(!47){19.36({7:7,39:\'\',73:\'\'})}}9{19.36({7:7,39:\'\',73:\'\'})}4 90=[];5.29(90);5.29(19);141(7);139(7);$(\'#71\').107();189(7);216()}9 6(32){$(\'#88-179\').110(\'7\',7);$(\'#88-217\').110(\'7\',7);$("#71").286();126=30;$("#71").282({285:"163 283",274:"163-10 237",264:128,262:"271"})}9{$(\'#88-179\').110(\'7\',7);$(\'#88-217\').110(\'7\',7);$("#71").286();126=30;$("#71").282({285:"163 283",274:"163-10 237",264:128,262:"271"})}}};8 360(){$(\'.164\').13(\'81-79\',\'166\');$(\'.164\').13(\'60-77\',\'59\');$(\'.156\').13(\'81-79\',\'166\');$(\'.156\').13(\'60-77\',\'59\');$(\'#208\').13(\'81-79\',\'132\');$(\'#208\').13(\'60-77\',\'129\');4 27=0;4 22=0;6(32){27=54;22=55()}9 6(!32){27=54;22=105()}9{27=54;22=55()}4 24=5.91();4 84=5.123();4 76=5.119();4 38=5.64();4 31=5.57();5.102(\'\');5.103(\'\');4 45=5.102();4 52=5.103();122();188();151();112(24,84,76,38,31,27,22,52,45)};8 376(){$(\'.164\').13(\'81-79\',\'166\');$(\'.164\').13(\'60-77\',\'59\');$(\'.156\').13(\'81-79\',\'166\');$(\'.156\').13(\'60-77\',\'59\');4 203=$(\'#165\').206(\'62\')[0];$(\'#165\').206(203).13(\'60-77\',\'129\');$(\'#165\').206(203).13(\'81-79\',\'132\');4 27=0;4 22=0;6(32){27=54;22=55()}9 6(!32){27=54;22=105()}9{27=54;22=55()}4 24=5.91();4 84=5.123();4 76=5.119();4 38=5.64();4 31=5.57();5.102(\'\');5.103(\'\');4 45=5.102();4 52=5.103();122();188();151();112(24,84,76,38,31,27,22,52,45)};8 366(){4 115={92:5.91()};251(\'507\',115,\'212\',8(267){118=267.506;4 187=80 363();4 269=0;$.172(118,8(21,201){269+=361(118[21].200);6(118[21].371==0){4 46=80 185();46.261=154(118[21].369);46.24=118[21].273;46.204=118[21].273;46.260=118[21].200;300(46);46.511=30;46.174=46.197.18>0;187.36(46)}});4 272=80 380();272.381="62";6(221!=-1){272.386=221}272.387("370",187,"356");$("#370").374();$(\'#208\').13(\'81-79\',\'132\');$(\'#208\').13(\'60-77\',\'129\')})};8 300(205){4 97=[];$.172(118,8(196,201){6(118[196].371==205.24){97.36(118[196])}});$.172(97,8(21,201){4 75=80 185();75.261=154(97[21].369);75.24=97[21].273;75.204=97[21].273;75.260=97[21].200;300(75);75.174=75.197.18>0;205.197.36(75)})};8 356(101){$(\'.164\').13(\'81-79\',\'166\');$(\'.164\').13(\'60-77\',\'59\');$(\'.156\').13(\'81-79\',\'166\');$(\'.156\').13(\'60-77\',\'59\');6(101.155=="208"){4 207=$(\'.347\');35(4 16=0;16<207.18;16++){4 146=$(207[16]);6(146.145().145().13(\'69\')!=\'59\'){146.13(\'81-79\',\'132\');146.13(\'60-77\',\'129\')}}}9{6(101.174==25){4 199=$(\'#\'+101.155).145().289()[1];$(199).13(\'81-79\',\'132\');$(199).13(\'60-77\',\'129\')}9{$(\'#\'+101.155).13(\'81-79\',\'132\');$(\'#\'+101.155).13(\'60-77\',\'129\')}}4 46=80 185();4 27=0;4 22=0;46=101;357=46.204;$(\'#70-181\').12(\'\');6(32){27=54;22=55()}9 6(!32){27=54;22=105()}9{27=54;22=55()}5.103(357);4 24=5.91();4 84=5.123();4 76=5.119();4 38=5.64();4 31=5.57();4 45=5.102();4 52=5.103();122();188();112(24,84,76,38,31,27,22,52,45);151()};8 362(){4 115={92:5.91()};251(\'510\',115,\'212\',8(267){108=267.502;4 187=80 363();4 269=0;$.172(108,8(21,201){269+=361(108[21].200);6(108[21].328==0||108[21].501=="0"){4 46=80 185();46.174=25;46.261=154(108[21].340);46.24=108[21].45;46.204=108[21].45;46.260=108[21].200;291(46);46.499=25;46.174=46.197.18>0;187.36(46)}});4 170=80 380();170.381="62";6(224!=-1){170.386=224}170.387("165",187,"353");$("#165").374();4 203=$(\'#165\').206(\'62\')[0];$(\'#165\').206(203).13(\'60-77\',\'129\');$(\'#165\').206(203).13(\'81-79\',\'132\');35(4 16=0;16<170.293.18;16++){6($("#"+170.293[16]).145()){4 334=$("#"+170.293[16]).145();4 270=334.289()[0];6(270){519{270.86()}516(513){4 292=198.517(\'515\');292.514(\'86\',25,25,287);270.481(292)}}}}})};8 291(205){4 97=[];$.172(108,8(196,201){6(108[196].328==205.24){97.36(108[196])}});$.172(97,8(21,201){4 75=80 185();75.261=154(97[21].340);75.24=97[21].45;75.204=97[21].45;75.260=97[21].200;291(75);75.174=75.197.18>0;205.197.36(75)})};8 353(101){$(\'.164\').13(\'81-79\',\'166\');$(\'.164\').13(\'60-77\',\'59\');$(\'.156\').13(\'81-79\',\'166\');$(\'.156\').13(\'60-77\',\'59\');6(101.155=="208"){4 207=$(\'.347\');35(4 16=0;16<207.18;16++){4 146=$(207[16]);6(146.145().145().13(\'69\')!=\'59\'){146.13(\'81-79\',\'132\');146.13(\'60-77\',\'129\')}}}9{6(101.174==25){4 199=$(\'#\'+101.155).145().289()[1];$(199).13(\'81-79\',\'132\');$(199).13(\'60-77\',\'129\')}9{$(\'#\'+101.155).13(\'81-79\',\'132\');$(\'#\'+101.155).13(\'60-77\',\'129\')}}4 46=80 185();4 27=0;4 22=0;46=101;422=46.204;$(\'#70-181\').12(\'\');6(32){27=54;22=55()}9 6(!32){27=54;22=105()}9{27=54;22=55()}5.102(422);4 24=5.91();4 84=5.123();4 76=5.119();4 38=5.64();4 31=5.57();4 45=5.102();4 52=5.103();122();188();112(24,84,76,38,31,27,22,52,45);151()};8 443(420,426){$(\'#478\').12(420);$(\'#175\').12(426);$(\'.350\').13(\'160\',\'314\')};8 251(192,424,425,446){281(5.277(),192,425,424,446,42)};8 445(94){6(94){94.279()}126=30;4 14=$(128).110(\'7\');4 147=113(14);5.214(14);5.210(147);6(5.29().18>0){19=5.29();35(4 16=0;16<19.18;16++){6(19[16].7==14){47=25;74}9{47=30}}6(!47){19.36({7:14,39:\'\',73:\'\'})}}9{19.36({7:14,39:\'\',73:\'\'})}4 90=[];5.29(90);5.29(19);141(14);139(14);$(\'#71\').107();189(14);216()};8 280(94){6(94){94.279()}126=30;6(138==25){138=30;82}4 14=$(128).110(\'7\');4 305=113(14);4 51=80 440();4 120=51.441()+1;4 130=51.396();4 85=315(130,120,51.402());5.214(14);5.210(305);4 47=30;6(5.29().18>0){19=5.29();35(4 16=0;16<19.18;16++){6(19[16].7==14){47=25;6(19[16].39==\'\'||19[16].39==42||19[16].39==\'65\'){19[16].39=85;19[16].73=51}74}9{47=30}}6(!47){19.36({7:14,39:85,73:51})}}9{19.36({7:14,39:85,73:51})}4 90=[];5.29(90);141(14);139(14);5.29(19);$(\'#71\').107();5.296(30);294(236.295)};8 495(){$(128).13(\'394-393\',\'494\')};8 493(){$(128).13(\'394-393\',\'498\')};8 439(){6(5.131()>=175){$(\'#34-111\').13(\'69\',\'59\')}9{$(\'#34-111\').13(\'69\',\'238\')}6(175==0){$(\'#34-111\').13(\'69\',\'59\')}};8 414(){$(\'#34-111\').107();193=193+1;4 96=5.133();4 56=5.131();4 38=5.64();4 31=5.57();4 84=5.123();4 76=5.119();4 52=5.103();4 45=5.102();4 92=5.91();4 304=175;6(96==42||96==\'65\'){96=54}6(56==42||56==\'65\'){6(32){56=55()}9 6(!32){56=105()}9{56=55()}}96=140(56)+1;4 303=140(304)-140(96);6(303<233){56=140(96)+140(303)}9{56=140(96)+(140(233)-1)}5.133(96);5.131(56);6(96<=304){112(92,84,76,38,31,96,56,52,45)}};8 412(){$(\'#34-111\').107();$(\'#34-53-33\').150(\'93\');$(\'#34-53-28\').114(\'93\');$(\'#34-53-176\').114(\'93\');4 31=5.57();4 38=5.64();4 92=5.91();4 27=54;4 22=5.131();4 52=5.103();4 45=5.102();6(31==61.104){6(38==1){31=61.302;$(\'#33-11\').12(\'\');$(\'#33-11\').12(\'\');$(\'#33-11\').13(\'26\',\'87\');$(\'#28-11\').12(\'\');$(\'#44-11\').12(\'\')}9{31=61.104;$(\'#33-11\').12(\'\');$(\'#33-11\').12(\'\');$(\'#33-11\').13(\'26\',\'87\');$(\'#28-11\').12(\'\');$(\'#44-11\').12(\'\')}5.57(31)}9{31=61.104;$(\'#33-11\').12(\'\');$(\'#33-11\').12(\'\');$(\'#33-11\').13(\'26\',\'87\');$(\'#28-11\').12(\'\');$(\'#44-11\').12(\'\');5.57(31)}6(27==42||27==\'65\'){27=54;5.133(27)}6(22==42||22==\'65\'){6(32){22=55()}9 6(!32){22=105()}9{22=55()}5.133(22)}38=1;5.64(38);122();112(92,5.123(),5.119(),38,31,27,22,52,45)};8 415(){$(\'#34-111\').107();$(\'#34-53-28\').150(\'93\');$(\'#34-53-33\').114(\'93\');$(\'#34-53-176\').114(\'93\');4 31=5.57();4 38=5.64();4 92=5.91();4 27=54;4 22=5.131();4 52=5.103();4 45=5.102();6(31==61.104){6(38==2){31=61.302;$(\'#33-11\').12(\'\');$(\'#28-11\').12(\'\');$(\'#28-11\').12(\'\');$(\'#28-11\').13(\'26\',\'87\');$(\'#44-11\').12(\'\')}9{31=61.104;$(\'#33-11\').12(\'\');$(\'#28-11\').12(\'\');$(\'#28-11\').12(\'\');$(\'#28-11\').13(\'26\',\'87\');$(\'#44-11\').12(\'\')}5.57(31)}9{31=61.104;$(\'#33-11\').12(\'\');$(\'#28-11\').12(\'\');$(\'#28-11\').12(\'\');$(\'#28-11\').13(\'26\',\'87\');$(\'#44-11\').12(\'\');5.57(31)}6(27==42||27==\'65\'){27=54;5.133(27)}6(22==42||22==\'65\'){6(32){22=55()}9 6(!32){22=105()}9{22=55()}5.133(22)}38=2;122();5.64(38);112(92,5.123(),5.119(),38,31,27,22,52,45)};8 418(){$(\'#34-111\').107();$(\'#34-53-176\').150(\'93\');$(\'#34-53-33\').114(\'93\');$(\'#34-53-28\').114(\'93\');4 31=5.57();4 38=5.64();4 92=5.91();4 27=54;4 22=5.131();4 52=5.103();4 45=5.102();6(31==61.104){6(38==3){31=61.302;$(\'#33-11\').12(\'\');$(\'#28-11\').12(\'\');$(\'#44-11\').12(\'\');$(\'#44-11\').12(\'\');$(\'#44-11\').13(\'26\',\'87\')}9{31=61.104;$(\'#33-11\').12(\'\');$(\'#28-11\').12(\'\');$(\'#44-11\').12(\'\');$(\'#44-11\').12(\'\');$(\'#44-11\').13(\'26\',\'87\')}5.57(31)}9{31=61.104;$(\'#33-11\').12(\'\');$(\'#28-11\').12(\'\');$(\'#44-11\').12(\'\');$(\'#44-11\').12(\'\');$(\'#44-11\').13(\'26\',\'87\');5.57(31)}6(27==42||27==\'65\'){27=54;5.133(27)}6(22==42||22==\'65\'){6(32){22=55()}9 6(!32){22=105()}9{22=55()}5.133(22)}38=3;122();5.64(38);112(92,5.123(),5.119(),38,31,27,22,52,45)};8 326(){6(407()==61.497||407()==61.496){$(\'#34-53-28\').13(\'69\',\'59\');$(\'#405\').13(\'69\',\'59\');$(\'#28-11\').12(\'\')}9{$(\'#34-53-28\').13(\'69\',\'238\');$(\'#405\').13(\'69\',\'238\');6(5.57()!=42&&5.57()!=\'65\'||5.64()!=\'\'){4 168=5.64();4 180=5.57();6(168==2){6(180==61.104){$(\'#28-11\').12(\'\');$(\'#28-11\').12(\'\');$(\'#28-11\').13(\'26\',\'87\')}9{$(\'#28-11\').12(\'\');$(\'#28-11\').12(\'\');$(\'#28-11\').13(\'26\',\'87\')}}}}};8 112(24,60,411,254,409,406,416,307,318){4 115={92:24,84:60,76:411,38:254,31:409,27:406,22:416,52:307,45:318};251(\'489\',115,\'488\',8(72){4 487=0;$.172(72.401,8(21,23){4 85=388(23.492);6(32==42){6(5.258()==61.342){$(\'#70-181\').245(\'<144 37="399" 24="231\'+23.14+\'">\'+\' <67 37="397">\'+\' <67 37="50">\'+\' <121 58="246" 26="246" 24="70-95\'+23.14+\'" 7="\'+23.14+\'" 152="69:59;">\'+\' </121>\'+\' </67>\'+\' <50 24="135\'+23.14+\'" 78="./50/249.256" 58="153" 26="153" 152="257: 419; "/>\'+\' </67>\'+\' <62 24="33\'+23.14+\'" 37="88 192 89" 89="442" 7="\'+23.14+\'">\'+219(154(23.252),20)+\'</62>\'+\'</144>\');6((248+21+1)%3==0){$(\'#231\'+23.14).150(\'421\')}259()}9 6(5.258()==61.344){$(\'#70-181\').245(\'<144 37="341">\'+\' <67 37="430">\'+\' <62 37="50">\'+\' <121 58="423" 26="398" 24="70-95\'+23.14+\'" 7="\'+23.14+\'" 152="69:59;">\'+\' </121>\'+\' <50 24="135\'+23.14+\'" 78="./50/249.256" 58="153" 26="153" 152="257: 403; "/>\'+\' </62>\'+\' <67 37="60">\'+\' <62 24="33\'+23.14+\'" 37="192 88" 7="\'+23.14+\'">\'+219(154(23.252),20)+\'</62>\'+\' <67 37="410">\'+\' <149 37="51">\'+\' <68><117 37="89" 89="408"> </117> : \'+85+\'</68>\'+\' <68><117 37="89" 89="417"> </117>:<117 24="308\'+23.14+\'"> </117></68>\'+\' </149>\'+\' <149 37="413">\'+\' <68><50 78="\'+309+\'" 24="225\'+23.14+\'" 37="395" /></68>\'+\' <68><50 78="\'+312+\'" 24="213\'+23.14+\'" 37="392" /></68>\'+\' <68><62 37="179 89 239-240" 7="\'+23.14+\'" 89="389">390</62></68>\'+\' </149>\'+\' </67>\'+\' </67>\'+\' </67>\'+\'</144>\');284()}9{491(\'490\');}}9{6(32){$(\'#70-181\').245(\'<144 37="399" 24="231\'+23.14+\'">\'+\' <67 37="397">\'+\' <67 37="50">\'+\' <121 58="246" 26="246" 24="70-95\'+23.14+\'" 7="\'+23.14+\'" 152="69:59;">\'+\' </121>\'+\' </67>\'+\' <50 24="135\'+23.14+\'" 78="./50/249.256" 58="153" 26="153" 152="257: 419; "/>\'+\' </67>\'+\' <62 24="33\'+23.14+\'" 37="88 192 89" 89="442" 7="\'+23.14+\'">\'+219(154(23.252),20)+\'</62>\'+\'</144>\');6((248+21+1)%3==0){$(\'#231\'+23.14).150(\'421\')}259()}9 6(!32){$(\'#70-181\').245(\'<144 37="341">\'+\' <67 37="430">\'+\' <62 37="50">\'+\' <121 58="423" 26="398" 24="70-95\'+23.14+\'" 7="\'+23.14+\'" 152="69:59;">\'+\' </121>\'+\' <50 24="135\'+23.14+\'" 78="./50/249.256" 58="153" 26="153" 152="257: 403; "/>\'+\' </62>\'+\' <67 37="60">\'+\' <62 24="33\'+23.14+\'" 37="192 88" 7="\'+23.14+\'">\'+219(154(23.252),20)+\'</62>\'+\' <67 37="410">\'+\' <149 37="51">\'+\' <68><117 37="89" 89="408"> </117> : \'+85+\'</68>\'+\' <68><117 37="89" 89="417"> </117>:<117 24="308\'+23.14+\'"> </117></68>\'+\' </149>\'+\' <149 37="413">\'+\' <68><50 78="\'+309+\'" 24="225\'+23.14+\'" 37="395" /></68>\'+\' <68><50 78="\'+312+\'" 24="213\'+23.14+\'" 37="392" /></68>\'+\' <68><62 37="179 89 239-240" 7="\'+23.14+\'" 89="389">390</62></68>\'+\' </149>\'+\' </67>\'+\' </67>\'+\' </67>\'+\'</144>\');284()}9{}}222.36({14:23.14,95:346(23.305)});427(23.14,23.391,23.400);230.36({7:23.14,209:23.391});226.36({7:23.14,195:23.400});444(23.14);4 39=429(23.14);6(39!=42||39!=\'65\'){$(\'#308\'+23.14).12(39)}});248+=72.401.18;6(307==\'\'&&318==\'\'){6(221==-1){221=72.215}6(224==-1){224=72.215}}6(72.215<72.22){5.131(72.215)}9{5.131(72.22)}5.133(72.27);175=72.215;443(5.131(),175);439();351()})};4 221=-1;4 224=-1;8 436(){4 96=54;4 56=0;4 38=435;4 31=438;4 84=\'\';4 76=437;4 52=\'\';4 45=\'\';4 92=5.91();5.133(96);6(32){56=55()}9 6(!32){56=105()}9{56=55()}5.131(56);5.64(38);5.57(31);5.123(84);5.119(76);5.103(52);5.102(45);326();151();122();188();112(92,84,76,38,31,96,56,52,45)};8 113(7){35(4 21=0;21<222.18;21++){6(222[21].14==7){82 222[21].95}}};8 444(14){6(!32){6(5.157().18==0){$(\'#213\'+14).13(\'160\',\'235\')}9{35(4 41=0;41<5.157().18;41++){6(5.157()[41].7==14){$(\'#213\'+14).13(\'160\',\'314\');74}9{$(\'#213\'+14).13(\'160\',\'235\')}}}6(5.162().18==0){$(\'#225\'+14).13(\'160\',\'235\')}9{35(4 41=0;41<5.162().18;41++){6(5.162()[41].7==14){$(\'#225\'+14).13(\'160\',\'314\');74}9{$(\'#225\'+14).13(\'160\',\'235\')}}}}};8 427(66,432,433){4 63=80 266();4 183=80 266();4 178=80 266();4 48=198.434(\'70-95\'+66);4 116=48.431(\'428\');4 265=30;4 182=5.158();4 127=5.159();4 143=5.29();6(143==42||143<=0||143==\'65\'){63.125=8(){4 43=169(63,48.26,48.58);116.124(63,48.26/ 2 - 43[0] /2,0,43[0],43[1]);183.125=8(){116.124(183,48.26/ 2 - 43[0] /2,0);$("#135"+66).186(\'109\',8(){$(\'#70-95\'+66).184(\'109\')})};183.78=313};63.78=113(66)}9{35(4 41=0;41<5.29().18;41++){6(5.29()[41].7==66){63.125=8(){4 43=169(63,48.26,48.58);116.124(63,48.26/ 2 - 43[0] /2,0,43[0],43[1]);$("#135"+66).186(\'109\',8(){$(\'#70-95\'+66).184(\'109\')})};63.78=113(66);265=25;74}9{63.125=8(){4 43=169(63,48.26,48.58);116.124(63,48.26/ 2 - 43[0] /2,0,43[0],43[1]);183.125=8(){116.124(183,48.26/ 2 - 43[0] /2,0);$("#135"+66).186(\'109\',8(){$(\'#70-95\'+66).184(\'109\')})};183.78=313};63.78=113(66)}}}6(265){6(182==42||182<=0||182==\'65\'){}9{35(4 83=0;83<182.18;83++){6(182[83].7==66){6(182[83].209!=432){63.125=8(){4 43=169(63,48.26,48.58);116.124(63,48.26/ 2 - 43[0] /2,0,43[0],43[1]);178.125=8(){116.124(178,48.26/ 2 - 43[0] /2,0);$("#135"+66).186(\'109\',8(){$(\'#70-95\'+66).184(\'109\')})};178.78=316};63.78=113(66);74}}}}6(127==42||127<=0||127==\'65\'){}9{35(4 83=0;83<127.18;83++){6(127[83].7==66){6(127[83].195!=433){63.125=8(){4 43=169(63,48.26,48.58);116.124(63,48.26/ 2 - 43[0] /2,0,43[0],43[1]);178.125=8(){116.124(178,48.26/ 2 - 43[0] /2,0);$("#135"+66).186(\'109\',8(){$(\'#70-95\'+66).184(\'109\')})};178.78=316};63.78=113(66);74}}}}265=30}};8 189(24){4 50=80 266();50.78=113(24);4 48=198.434(\'70-95\'+24);4 116=48.431(\'428\');50.125=8(){4 43=169(50,48.26,48.58);116.124(50,48.26/ 2 - 43[0] /2,0,43[0],43[1]);$("#135"+24).186(\'109\',8(){$(\'#70-95\'+24).184(\'109\')})}};8 429(24){35(4 21=0;21<5.29().18;21++){6(5.29()[21].7==24){82 5.29()[21].39}}};8 141(137){4 136;4 228;4 148=30;6(5.158().18<=0||5.158()==42||5.158()==\'65\'){136=[]}9{136=5.158()}35(4 21=0;21<230.18;21++){6(230[21].7==137){228=230[21].209;74}}6(136.18>0){35(4 40=0;40<136.18;40++){6(136[40].7==137){136[40].209=228;148=25;74}9{148=30}}6(!148){136.36({7:137,209:228})}}9{136.36({7:137,209:228})}5.158(136)};8 139(137){4 134;4 227;4 148=30;6(5.159().18<=0||5.159()==42||5.159()==\'65\'){134=[]}9{134=5.159()}35(4 21=0;21<226.18;21++){6(226[21].7==137){227=226[21].195;74}}6(134.18>0){35(4 40=0;40<134.18;40++){6(134[40].7==137){134[40].195=227;148=25;74}9{148=30}}6(!148){134.36({7:137,195:227})}}9{134.36({7:137,195:227})}5.159(134)};8 151(){$(\'#34-53-33\').114(\'93\');$(\'#34-53-28\').114(\'93\');$(\'#34-53-176\').114(\'93\');4 168;4 180;6(5.64()==42||5.64()==\'65\'||5.64()==\'\'){$(\'#33-11\').12(\'\');$(\'#33-11\').12(\'\');$(\'#28-11\').12(\'\');$(\'#44-11\').12(\'\')}9{6(5.57()!=42&&5.57()!=\'65\'||5.64()!=\'\'){168=5.64();180=5.57();6(168==1){6(180==61.104){$(\'#33-11\').12(\'\');$(\'#33-11\').12(\'\');$(\'#33-11\').13(\'26\',\'87\');$(\'#28-11\').12(\'\');$(\'#44-11\').12(\'\')}9{$(\'#33-11\').12(\'\');$(\'#33-11\').12(\'\');$(\'#33-11\').13(\'26\',\'87\');$(\'#28-11\').12(\'\');$(\'#44-11\').12(\'\')}$(\'#34-53-33\').150(\'93\')}9 6(168==2){6(180==61.104){$(\'#33-11\').12(\'\');$(\'#28-11\').12(\'\');$(\'#28-11\').12(\'\');$(\'#28-11\').13(\'26\',\'87\');$(\'#44-11\').12(\'\')}9{$(\'#33-11\').12(\'\');$(\'#28-11\').12(\'\');$(\'#28-11\').12(\'\');$(\'#28-11\').13(\'26\',\'87\');$(\'#44-11\').12(\'\')}$(\'#34-53-28\').150(\'93\')}9 6(168==3){6(180==61.104){$(\'#33-11\').12(\'\');$(\'#28-11\').12(\'\');$(\'#44-11\').12(\'\');$(\'#44-11\').12(\'\');$(\'#44-11\').13(\'26\',\'87\')}9{$(\'#33-11\').12(\'\');$(\'#28-11\').12(\'\');$(\'#44-11\').12(\'\');$(\'#44-11\').12(\'\');$(\'#44-11\').13(\'26\',\'87\')}$(\'#34-53-176\').150(\'93\')}}}};8 388(51){4 130=51.51;4 120=140(51.120)+1;4 232=140(51.232)+479;4 85=232+\'/\'+((\'\'+120).18<2?\'0\':\'\')+120+\'/\'+((\'\'+130).18<2?\'0\':\'\')+130;82 85};8 315(130,120,232){4 85=232+\'/\'+((\'\'+120).18<2?\'0\':\'\')+120+\'/\'+((\'\'+130).18<2?\'0\':\'\')+130;82 85};8 346(343){4 355=\'72:480/475;476,\'+343;82 355};8 55(){4 56=0;4 278=349();56=278.477;82 56};8 105(){4 56=0;4 278=349();56=278.484;82 56};8 284(){233=105()};8 259(){233=55()};8 319(){$(\'#33-11\').12(\'\');$(\'#28-11\').12(\'\');$(\'#44-11\').12(\'\');$(\'#44-11\').12(\'\')};8 122(){$(\'#34-111\').107();$(\'#70-181\').12(\'\');$(\'.350\').13(\'160\',\'235\')};8 211(){351();6(32){$(\'#34-111\').12(320(171(\'317\'),55()).485())}9 6(!32){$(\'#34-111\').12(320(171(\'317\'),105()))}9{$(\'#34-111\').12(320(171(\'317\'),55()))}};8 241(332){4 229=25;4 115={92:5.91(),486:\'1\',14:332};281(5.277(),"482",\'212\',115,8(72){229=25},8(377,483,512){6(377.518==404){229=30}9{229=25;503()}});82 229};8 368(){4 143=5.29();4 127=5.159();4 310=5.158();35(4 21=143.18-1;21>=0;21--){4 311=143[21];6(!241(311.7)){177.36({7:311.7});143.106(21,1);127.106(21,1);310.106(21,1)}6(505()){82}}5.29(143);5.159(127);5.158(310)};8 365(){4 191=5.359();35(4 40=191.18-1;40>=0;40--){4 268=191[40];6(263(268.7)){191.106(40,1)}9{6(!241(268.7)){177.36({7:268.7});191.106(40,1);5.509(25)}}}5.359(191)};8 385(){4 99=5.162();35(4 40=99.18-1;40>=0;40--){4 194=99[40];6(263(194.7)){99.106(40,1)}9{6(!241(194.7)){177.36({7:194.7});99.106(40,1);5.325(25)}}}5.162(99)};8 375(){4 98=5.157();35(4 40=98.18-1;40>=0;40--){4 190=98[40];6(263(190.7)){98.106(40,1)}9{6(!241(190.7)){177.36({7:190.7});98.106(40,1);5.327(25)}}}5.157(98)};8 358(){6(5.324()==\'25\'){368();365();385();375();335();330();354();5.324(30)}};8 263(7){35(4 40=177.18-1;40>=0;40--){4 373=177[40];6(7==373.7){82 25}9{82 30}}};8 335(){4 323=5.162();4 321=5.157();35(4 21=0;21<323.18;21++){4 194=323[21];173.36({7:194.7})}35(4 21=0;21<321.18;21++){4 190=321[21];173.36({7:190.7})}};8 330(){4 99=5.162();35(4 16=0;16<173.18;16++){4 161=173[16];4 115={92:5.91(),14:161.7,348:0};4 100;281(5.277(),"100",\'212\',115,8(72){6(72.276){100=72.276}},42);6(100){6(100.18>0){35(4 41=99.18-1;41>=0;41--){4 223=99[41];6(223.7==161.7){4 202=30;35(4 83=0;83<100.18;83++){6(223.275==100[83].275){202=25;74}}6(!202){99.106(41,1);5.325(25)}}}}9{35(4 41=0;41<99.18;41++){4 223=99[41];6(223.7==161.7){99.106(41,1);5.325(25)}}}}}5.162(99)};8 354(){4 98=5.157();35(4 16=0;16<173.18;16++){4 161=173[16];4 115={92:5.91(),14:161.7,348:0};4 100;281(5.277(),"100",\'212\',115,8(72){6(72.276){100=72.276}},42);6(100){6(100.18>0){35(4 41=98.18-1;41>=0;41--){4 220=98[41];6(220.7==161.7){4 202=30;35(4 83=0;83<100.18;83++){6(220.275==100[83].275){202=25;74}}6(!202){98.106(41,1);5.327(25)}}}}9{35(4 41=0;41<98.18;41++){4 220=98[41];6(220.7==161.7){98.106(41,1);5.327(25)}}}}}5.157(98)};8 454(){326();211();198.33=171(\'383\')+\' | \'+171(\'384\')};8 219(250,18){6(250.18<=18){82 250}9{82 250.379(0,18)+"..."}};8 169(167,26,58){4 244;4 242;6(167.26>167.58){244=26;242=(167.58*26)/167.26}9{242=58;244=(167.26*58)/167.58}4 338=[244,242];82 338};8 188(){193=1};8 352(){6(5.258()==61.342){32=25}9 6(5.258()==61.344){32=30}9{32=25}};8 345(){6(322()){$(\'#34-53-33\').114(\'306\');$(\'#34-53-28\').114(\'306\');$(\'#34-53-176\').114(\'306\')}};',10,520,'||||var|ClientData|if|contentid|function|else||sorttype|html|css|contentId||nIndex||length|contentIdArray||i|recordTo|post|id|true|width|recordFrom|titlekana|ReadingContentIds|false|sortOrder|isShowBookShelf|title|control|for|push|class|sortType|viewdate|j|nIndex1|null|resizeImg|rDate|groupId|node|checkflag|c|outputId|img|date|genreId|sort|DEFAULT_DISP_NUMBER_RECORD_FROM|returnNumberDispRecordForBookShelf|toPage|searchCond_sortOrder|height|none|text|Consts|a|imgThumb|searchCond_sortType|undefined|contId|div|li|display|content|dlgSubMenu|data|originviewdate|break|item|searchDivision|decoration|src|weight|new|font|return|nIndex2|searchText|outputDate|click|12px|dialog|lang|newArray|userInfo_sid|sid|active_tops|e|thumbnail|fromPage|dataChild|arrMarking|arrMemo|webContentPage|selectedNode|searchCond_groupId|searchCond_genreId|ConstOrderSetting_Asc|returnNumberDispRecordForList|splice|hide|dataGroup|slow|attr|nextrecord|renderContent|returnThumbnail|removeClass|params|ctx|span|dataGenre|searchCond_searchDivision|month|canvas|refreshGrid|searchCond_searchText|drawImage|onload|allowTimerCloseSubMenu|metaArr|this|underline|day|searchCond_recordTo|bold|searchCond_recordFrom|tempMetaArr|loadingIcon|tempResourceArr|conId|home_isMove|setMetaVersionData|eval|setResourceVersionData|live|readArr|section|parent|objTarget|base64String|flag|ul|addClass|handleSortDisp|style|25px|htmlEncode|Id|folder|MarkingData|ResourceVersion|MetaVersion|visibility|oneContent|MemoData|left|file|list_1|normal|mg|typeSort|resizeResourceThumbnail|tree2|i18nText|each|existContent|IsCategory|totalPage|releasedate|errorContent|imgIconEdit|read|orderSort|grid|versionArr|imgIconNew|fadeIn|TreeNode|fadeOut|arrData|resetShowNextRecordCount|drawEditImage|marking|arrBookmark|name|showNextRecordClickNumber|memo|metaversion|index|ChildNodes|document|targetObj|contentCount|value|isFoundPage|firstNode|Value|node1|find|arrAllNodes|all|resourceversion|contentInfo_contentThumbnail|formatDisplayMoreRecord|GET|imgBookMark|contentInfo_contentId|totalRecord|openContentDetail|detail|timer_subMenu|truncate|oneMarking|genre_totalcontent|arrayTemp|oneMemo|group_totalcontent|imgMemo|metaVersionArr|tempMeta|tempResource|isExisted|resourceVersionArr|bookshelf|year|iNumberOfNextRecord|list|hidden|ScreenIds|top|block|button|details|IsExistContent|newHeight|png|newWidth|append|170px|contentDetail|home_realTotalRecord|data_loading|strInput|abapi|contentTitle|avwUserEnvObj|type|isSubMenuHoverOn|gif|padding|sortOpt_viewMode|getNextRecordNumForBookShelf|ContentCount|Text|collision|isErrorContent|of|readFlg|Image|data1|bookmark|totalCount|objChild|fit|tree1|categoryId|at|pageNo|pages|userInfo_accountPath|sysSettings|preventDefault|readSubmenuFunction|avwCmsApiSync|position|bottom|getNextRecordNumForList|my|show|window|canvasClickFunction|children|touchend|AddChidrenNodeGroup|evObj|ExpandNodes|avwScreenMove|ContentView|IsRefresh|openSubMenuDialogFunction|bodyHomeClickFunction|body|AddChidrenNodeGenre|touchmove|ConstOrderSetting_Desc|iRecordNumber|totalrecord|contentThumbnail|nottouchdevice|cateid|lblVdate|DEFAULT_IMG_OPTION_MEMO|resourceArr|readContent|DEFAULT_IMG_OPTION_MARKING|DEFAULT_IMG_CONTENT_NEW|visible|formatNormalDate|DEFAULT_IMG_CONTENT_EDIT|dspViewMore|grpid|refreshSortTypeOrder|format|markingArr|isTouchDevice|memoArr|common_contentDataChkFlg|isChangedMemo|handleLanguage|isChangedMarkingData|parentGroupId|os|SyncMemoPages|UserEnvironment|strContentId|startTimerCloseMenu|objParent|getExistContentPages|touchstart|ipad|result|bind|groupName|sectionhomelist|ConstDisplayMode_BookShelf|imgStr|ConstDisplayMode_List|removeHoverCss|formatStringBase64|root|thumbnailFlg|avwSysSetting|pageNumControl|i18nReplaceText|setDefaultViewMode|AddGroup_Callback|SyncMarkingPages|outputString|AddGenre_Callback|lCateId|syncContentData|BookMarkData|genreSelectFunction|Number|getDataJsonFileGroup|Array|changeDispBookShelfFunction|syncBookmarkContent|getDataJsonFileGenre|changeDispListFunction|syncReadingContent|categoryName|list_0|parentCategoryId|subMenuHoverOffFunction|contentErr|treeview|syncMarkingContent|groupSelectFunction|xmlHttpRequest|subMenuHoverFunction|substring|TreeView|CategoryTagName|handleTreeViewDisp|dspHome|sysAppTitle|syncMemoContent|TotalCount|Show|formatDeliveryDate|txtRead|読む|resourceVersion|pen|color|background|sticker|getDate|cnt_section_bookshelf|150px|sectionhomebookshelf|metaVersion|contentList|getFullYear|46px||separate|from|getCurrentLanguage|txtPubDt|order|info|division|sortByTitleFunction|pic|showNextRecordFunction|sortByTitleKanaFunction|to|txtViewDt|sortByReleaseDateFunction|86px|dispRecord|no_m_right|lGrpId|105px|param|method|dispTotal|checkUserHasReadContent|2d|renderViewDate|cnt_section_list|getContext|resourceVer|metaVer|getElementById|DEFAULT_SORT_TYPE|renderGridView|DEFAULT_SEARCH_DIVISION|DEFAULT_SORT_ORDER|handleBackToTop|Date|getMonth|lblTitle|reRenderPageNumber|checkContentMarkingMemoOption|detailsSubmenuFunction|callback|LockScreen|pic_1|errorPage|pic_2|updatebook|newbook|DEFAULT_DISP_NUMBER_RECORD_TO|changeLanguageCallBackFunction|center|resize|clearTimeout|checkForceChangePassword|setTimeout|lnkbtnGroup|lnkbtnGenre|hover|RegisterLog|requirePasswordChange|avwCheckLogin|lnkGroup|lblGroup|ready|lnkGenre|BookmarkScreen|Home|lblGenre|Login|array|jpeg|base64|bookShelfCount|dispPage|1900|image|dispatchEvent|webGetContent|txtStatus|bookListCount|toString|getType|countCnt|POST|webContentList|ok|alert|contentDeliveryDate|itemMouseLeaveEvent|gray|itemMouseEnterEvent|ConstLanguage_Ko|ConstLanguage_En|white|ExpandAfterBuild||groupLevel|groupList|showSystemError|clientX|avwHasError|categoryList|category|clientY|isChangedBookmark|group|IsClosed|errorThrown|err|initMouseEvent|MouseEvents|catch|createEvent|status|try'.split('|'),0,{}))
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment