Commit 6865932b by Motohisa Nakano

20121217-3

parent 5224d11b
...@@ -1857,15 +1857,11 @@ function unlockFunction(inputPass) { ...@@ -1857,15 +1857,11 @@ function unlockFunction(inputPass) {
errorCode = JSON.parse(xhr.responseText); errorCode = JSON.parse(xhr.responseText);
} }
else { else {
// System error errorCode = { errorMessage: "E001" };
showSystemError();
} }
}); });
// Check error
if (avwHasError()) {
return;
}
if (result == true) { if (result == true) {
if (window.onUnlock) { if (window.onUnlock) {
onUnlock(); onUnlock();
......
...@@ -64,7 +64,7 @@ ...@@ -64,7 +64,7 @@
"dspBkCancel":"Logout", "dspBkCancel":"Logout",
"txtSearchResult":"Result", "txtSearchResult":"Result",
"dspHome":"Home", "dspHome":"Home",
"txtLoginUser":"(Ver.20121214-1)User:", "txtLoginUser":"(Ver.20121217-3)User:",
"txtAll":"All", "txtAll":"All",
"txtMkgSize":"Size", "txtMkgSize":"Size",
"txtMkgS":"S", "txtMkgS":"S",
...@@ -119,5 +119,6 @@ ...@@ -119,5 +119,6 @@
"txtMemoNew":"New", "txtMemoNew":"New",
"txtMemoPaste":"Paste", "txtMemoPaste":"Paste",
"txtMemoClear":"Clear", "txtMemoClear":"Clear",
"txtMemo":"Memo" "txtMemo":"Memo",
"msgBGMPlayConfirm":"EN:このコンテンツはBGMが流れるようになっています。BGMを再生してもよろしいですか?"
} }
...@@ -64,7 +64,7 @@ ...@@ -64,7 +64,7 @@
"dspBkCancel":"バックアップせずにログアウト", "dspBkCancel":"バックアップせずにログアウト",
"txtSearchResult":"検索結果", "txtSearchResult":"検索結果",
"dspHome":"ホーム", "dspHome":"ホーム",
"txtLoginUser":"(Ver.20121214-1)ログイン中:", "txtLoginUser":"(Ver.20121217-3)ログイン中:",
"txtAll":"すべて", "txtAll":"すべて",
"txtMkgSize":"太さ", "txtMkgSize":"太さ",
"txtMkgS":"小", "txtMkgS":"小",
...@@ -119,5 +119,6 @@ ...@@ -119,5 +119,6 @@
"txtMemoNew":"新規", "txtMemoNew":"新規",
"txtMemoPaste":"貼り付け", "txtMemoPaste":"貼り付け",
"txtMemoClear":"クリア", "txtMemoClear":"クリア",
"txtMemo":"メモ" "txtMemo":"メモ",
"msgBGMPlayConfirm":"このコンテンツはBGMが流れるようになっています。BGMを再生してもよろしいですか?"
} }
...@@ -64,7 +64,7 @@ ...@@ -64,7 +64,7 @@
"dspBkCancel":"로그아웃", "dspBkCancel":"로그아웃",
"txtSearchResult":"검색 결과", "txtSearchResult":"검색 결과",
"dspHome":"홈", "dspHome":"홈",
"txtLoginUser":"(Ver.20121214-1)로그인 중:", "txtLoginUser":"(Ver.20121217-3)로그인 중:",
"txtAll":"전체", "txtAll":"전체",
"txtMkgSize":"두께", "txtMkgSize":"두께",
"txtMkgS":"소", "txtMkgS":"소",
...@@ -119,5 +119,6 @@ ...@@ -119,5 +119,6 @@
"txtMemoNew":"신규", "txtMemoNew":"신규",
"txtMemoPaste":"붙여 넣기", "txtMemoPaste":"붙여 넣기",
"txtMemoClear":"클리어", "txtMemoClear":"클리어",
"txtMemo":"메모" "txtMemo":"메모",
"msgBGMPlayConfirm":"KO:このコンテンツはBGMが流れるようになっています。BGMを再生してもよろしいですか?"
} }
...@@ -40,7 +40,7 @@ ...@@ -40,7 +40,7 @@
<script src="./js/contentview_Marking.js"></script> <script src="./js/contentview_Marking.js"></script>
<script src="./js/contentview_PopupText.js"></script> <script src="./js/contentview_PopupText.js"></script>
<script src="./js/contentview_Paint.js"></script> <script src="./js/contentview_Paint.js"></script>
<script src="common/js/zoomDetector.js" type="text/javascript"></script>
<link type="text/css" rel="stylesheet" href="css/reset.css" /> <link type="text/css" rel="stylesheet" href="css/reset.css" />
<link type="text/css" rel="stylesheet" href="css/viewer.css" /> <link type="text/css" rel="stylesheet" href="css/viewer.css" />
...@@ -141,7 +141,10 @@ ...@@ -141,7 +141,10 @@
var isPressLeftMouse = false; var isPressLeftMouse = false;
var isMoveOutDrawCanvas = false; var isMoveOutDrawCanvas = false;
var typeSelectMemo = 0; var typeSelectMemo = 0;
var arrThumbnailsLoaded = []; var arrThumbnailsLoaded = [];
var isSendingData = true;
/* get Json stored content info */ /* get Json stored content info */
function getJsonContentInfo(){ function getJsonContentInfo(){
avwGrabContentPageImage(ClientData.userInfo_accountPath(), avwGrabContentPageImage(ClientData.userInfo_accountPath(),
...@@ -1005,7 +1008,7 @@ ...@@ -1005,7 +1008,7 @@
isDrawing = false; isDrawing = false;
/* clear canvas */ /* clear canvas */
context_draw.clearRect(0,0,canvas_draw.width,canvas_draw.height); context_draw.clearRect(0,0,canvas_draw.width,canvas_draw.height);
context_draw.save(); context_draw.save();
...@@ -1235,19 +1238,29 @@ ...@@ -1235,19 +1238,29 @@
// } // }
// } // }
$('#firstpage').unbind('click'); $('#firstpage').unbind('click');
$('#prevpage').unbind('click'); $('#firstpage').removeClass();
$('#nextpage').unbind('click'); $('#firstpage').addClass('begin_off');
$('#lastpage').unbind('click'); $('#prevpage').unbind('click');
$('#zoomfit').unbind('click'); $('#prevpage').removeClass();
$('#prevpage').addClass('prev_off');
$('#nextpage').unbind('click');
$('#nextpage').removeClass();
$('#nextpage').addClass('next_off');
$('#lastpage').unbind('click');
$('#lastpage').removeClass();
$('#lastpage').addClass('last_off');
$('#zoomfit').unbind('click');
$('#zoomfit').removeClass();
$('#zoomfit').addClass('fit_off');
$('#zoomin').unbind('click'); $('#zoomin').unbind('click');
$('#zoomin').removeClass(); $('#zoomin').removeClass();
$('#zoomin').addClass('expansion_off'); $('#zoomin').addClass('expansion_off');
$('#zoomout').unbind('click'); $('#zoomout').unbind('click');
$('#zoomout').removeClass(); $('#zoomout').removeClass();
$('#zoomout').addClass('reduction_off'); $('#zoomout').addClass('reduction_off');
if(avwUserEnvObj.os != "android"){ if(avwUserEnvObj.os != "android"){
$("#slider_page").slider("option", "disabled", true ); $("#slider_page").slider("option", "disabled", true );
} }
...@@ -1255,22 +1268,7 @@ ...@@ -1255,22 +1268,7 @@
$('#button_next_canvas').css('display','none'); $('#button_next_canvas').css('display','none');
$('#button_pre_canvas').css('display','none'); $('#button_pre_canvas').css('display','none');
if(isTouchDevice() == true){
$('#firstpage').removeClass();
$('#firstpage').addClass('begin');
$('#prevpage').removeClass();
$('#prevpage').addClass('prev');
$('#nextpage').removeClass();
$('#nextpage').addClass('next');
$('#lastpage').removeClass();
$('#lastpage').addClass('last');
$('#zoomfit').removeClass();
$('#zoomfit').addClass('fit');
}
} }
/*enable all control on page */ /*enable all control on page */
...@@ -1565,120 +1563,69 @@ ...@@ -1565,120 +1563,69 @@
return nIndexBookmark; return nIndexBookmark;
} }
/* get list bookmark of content */
function getBookMarkListByContentID(){
var bmList = [];
var bmListResult = [];
bmList = ClientData.BookMarkData();
for(var nIndex = 0; nIndex < bmList.length; nIndex ++){
if(bmList[nIndex].contentid == contentID){
bmListResult.push(bmList[nIndex]);
}
}
return bmListResult;
}
/*get API WebContentPage */ /*get API WebContentPage */
function handleAPIWebContentPage(dataJson,pos){ function handleAPIWebContentPage(dataJson,pos){
var bmList = []; var bmList = [];
bmList = ClientData.BookMarkData(); bmList = getBookMarkListByContentID();
var dataStored = arrThumbnailsLoaded;
/* create data on dialog */
//$('#divListBookmark').append('<table id="tblBookmarkList" class="tblbookmarklist">'); var sPageNo = [];
var nIndexBookMark = -1;
var sPageNo = ''; var lstPageNoBookMark = [];
for(var nIndex = 0; nIndex < bmList.length; nIndex ++){ $('#bookmarkBoxHdBM').children().remove();
if(bmList[nIndex].contentid == contentID){ $('#bookmarkBoxHdBM').html('<a id="bookmarkClosing" class="delete" > </a>');
if (checkDataLoaded(bmList[nIndex].pageNo) == false){ /* check if data not loaded */ $("#bookmarkClosing").click(closeBookmarkBox);
if(dataJson.pages.length > 0){ $('#bookmarkBoxHdBM').append(i18nText('txtShioriCtnLs'));
var contentPage = dataJson.pages;
for(var nIndexJson = 0; nIndexJson < contentPage.length; nIndexJson++){
if(contentPage[nIndexJson].pageNo == bmList[nIndex].pageNo){
sPageNo += contentPage[nIndexJson].pageNo + ',';
break;
}
}
}
}
}
}
if(sPageNo != ''){ $('#boxBookMark').css('z-index' , '101');
sPageNo = sPageNo.substring(0,sPageNo.length - 1); $('#boxBookMark').css('display' , 'block');
$('#bookmarkBoxHdBM').children().remove(); $('#boxBookMark').draggable({ handle: "h1" });
$('#bookmarkBoxHdBM').html('<a id="bookmarkClosing" class="delete" > </a>'); $("#boxBookMark").offset({left:pos[0],top:pos[1]});
$("#bookmarkClosing").click(closeBookmarkBox); $("#divListBookmark").show();
$('#bookmarkBoxHdBM').append(i18nText('txtShioriCtnLs')); $("#divListBookmark").offset({left:pos[0],top:(pos[1] + $('#bookmarkBoxHdBM').height())});
$('#divListBookmark').children().remove();
$('#boxBookMark').css('z-index' , '101');
$('#boxBookMark').css('display' , 'block'); for(var nIndex = 0; nIndex < bmList.length; nIndex ++){
$('#boxBookMark').draggable({ handle: "h1" }); nIndexBookMark = -1;
$("#boxBookMark").offset({left:pos[0],top:pos[1]}); var contentPage = dataJson.pages;
$("#divListBookmark").show();
$("#divListBookmark").offset({left:pos[0],top:(pos[1] + $('#bookmarkBoxHdBM').height())}); for(var nIndexJson = 0; nIndexJson < contentPage.length; nIndexJson++){
$('#divListBookmark').children().remove(); if(contentPage[nIndexJson].pageNo == bmList[nIndex].pageNo){
nIndexBookMark = nIndexJson;
/* create loading on dialog */ break;
$('#divListBookmark').children().remove(); }
$('#divListBookmark').append(
'<img src="img/view_loading.gif" style="padding-left: 65px; padding-top: 45px" width="64px" height="64px">'
);
avwCmsApi(ClientData.userInfo_accountPath(),
"webContentPage",
"GET",
{sid:ClientData.userInfo_sid(),contentId: contentID,pageNos: sPageNo, thumbnailFlg:1},
function(data){
$('#divListBookmark').children().remove();
getDataLoaded(data.pages);
loadDataToDialogBookmark(bmList,dataJson);
},
null);
}else{
$('#bookmarkBoxHdBM').children().remove();
$('#bookmarkBoxHdBM').html('<a id="bookmarkClosing" class="delete" > </a>');
$("#bookmarkClosing").click(closeBookmarkBox);
$('#bookmarkBoxHdBM').append(i18nText('txtShioriCtnLs'));
$('#boxBookMark').css('z-index' , '101');
$('#boxBookMark').css('display' , 'block');
$('#boxBookMark').draggable({ handle: "h1" });
$("#boxBookMark").offset({left:pos[0],top:pos[1]});
$("#divListBookmark").show();
$("#divListBookmark").offset({left:pos[0],top:(pos[1] + $('#bookmarkBoxHdBM').height())});
$('#divListBookmark').children().remove();
loadDataToDialogBookmark(bmList,dataJson);
}
// $('#divListBookmark').append('</table>');
}
function loadDataToDialogBookmark(bmList,dataJson){
for(var nIndex = 0; nIndex < bmList.length; nIndex ++){
if(bmList[nIndex].contentid == contentID){
//get image and title from json
var sImage = '';
var sTitle = '';
var isExistPage = false;
if(dataJson.pages.length > 0){
var contentPage = arrThumbnailsLoaded;
for(var nIndexJson = 0; nIndexJson < contentPage.length; nIndexJson++){
if(contentPage[nIndexJson].pageNo == bmList[nIndex].pageNo){
sImage = formatStringBase64(contentPage[nIndexJson].pageThumbnail);
sTitle = htmlEncode(contentPage[nIndexJson].pageText);
isExistPage = true;
break;
}
}
} }
if(nIndexBookMark != -1){ /* page exist */
if(isExistPage == true){ /* exist page */ var nStored = checkDataLoaded(bmList[nIndex].pageNo,dataStored);
$('#divListBookmark').append( if( nStored != -1){ /* data loaded */
' <li id="'+changePageNo(bmList[nIndex].pageNo)+'">' + $('#divListBookmark').append(
' <img class="imgbox" src="' +sImage+ '"/>' + ' <li id="'+changePageNo(bmList[nIndex].pageNo)+'">' +
' <span class="mdltext">' + ' <img id="img_bookmark_' +bmList[nIndex].pageNo + '" class="imgbox" src="' +formatStringBase64(dataStored[nStored].pageThumbnail)+ '"/>' +
i18nText('txtPage') + (changePageNo(bmList[nIndex].pageNo) + 1) + '<br /> ' + ' <span class="mdltext">' +
truncate(sTitle,20) + i18nText('txtPage') + (changePageNo(bmList[nIndex].pageNo) + 1) + '<br /> ' +
' </span>' + truncate(htmlEncode(contentPage[nIndexBookMark].pageText),20) +
' </li>' ' </span>' +
); ' </li>'
//Resize Image );
//Resize Image
var imgTemp = new Image(); var imgTemp = new Image();
imgTemp.onload = function(){ imgTemp.onload = function(){
...@@ -1696,36 +1643,149 @@ ...@@ -1696,36 +1643,149 @@
} }
}; };
imgTemp.src = sImage; imgTemp.src = formatStringBase64(dataStored[nStored].pageThumbnail);
}else{ /* not exist page */
$('#divListBookmark').append( }else{ /* data not loaded*/
' <li id="'+changePageNo(bmList[nIndex].pageNo)+'">' + $('#divListBookmark').append(
' <span class="mdltext">' + ' <li id="'+changePageNo(bmList[nIndex].pageNo)+'">' +
' <img id="img_bookmark_' +bmList[nIndex].pageNo + '" class="imgbox" src="img/view_loading.gif" />' +
' <span class="mdltext">' +
i18nText('txtPage') + (changePageNo(bmList[nIndex].pageNo) + 1) + '<br /> ' +
truncate(htmlEncode(contentPage[nIndexBookMark].pageText),20) +
' </span>' +
' </li>'
);
//Resize Image
var imgTemp = new Image();
imgTemp.onload = function(){
if(imgTemp.width > imgTemp.height) {
$("img.imgbox").attr('height', '');
$("img.imgbox").removeAttr('height');
$("img.imgbox").attr('width', '43');
}
else {
$("img.imgbox").attr('width', '');
$("img.imgbox").removeAttr('width');
$("img.imgbox").attr('height', '43');
}
};
imgTemp.src = "img/view_loading.gif";
/*avwCmsApiSync(ClientData.userInfo_accountPath(),
"webContentPage",
"GET",
{sid:ClientData.userInfo_sid(),contentId: contentID,pageNos: bmList[nIndex].pageNo, thumbnailFlg:1},
function(data){
getDataLoaded(data.pages);
//Resize Image
var imgTemp = new Image();
$('#img_bookmark_' +data.pages[0].pageNo).attr('src',formatStringBase64(data.pages[0].pageThumbnail));
imgTemp.onload = function(){
if(imgTemp.width > imgTemp.height) {
$("img.imgbox").attr('height', '');
$("img.imgbox").removeAttr('height');
$("img.imgbox").attr('width', '43');
}
else {
$("img.imgbox").attr('width', '');
$("img.imgbox").removeAttr('width');
$("img.imgbox").attr('height', '43');
}
};
imgTemp.src = formatStringBase64(data.pages[0].pageThumbnail);
},
null); */
lstPageNoBookMark.push(bmList[nIndex].pageNo);
}
}else{ /* page deleted */
$('#divListBookmark').append(
' <li id="'+changePageNo(bmList[nIndex].pageNo)+'">' +
' <span class="mdltext">' +
' <span>' + i18nText('txtPage') + bmList[nIndex].pageNo + '</span> <br /> ' + ' <span>' + i18nText('txtPage') + bmList[nIndex].pageNo + '</span> <br /> ' +
' </span>' + ' </span>' +
' </li>' + ' </li>' +
' <li>' + ' <li>' +
' <span class="mdltext">' + ' <span class="mdltext">' +
' <span style="color:red">' +i18nText('msgShioriDeleted')+ '</span>' + ' <span style="color:red">' +i18nText('msgShioriDeleted')+ '</span>' +
' </span>' + ' </span>' +
' </li>' ' </li>'
); );
} }
} }
} if(lstPageNoBookMark.length > 0){
isSendingData = true;
loadDataBookmark(lstPageNoBookMark);
}
}
function loadDataBookmark(lstPageNo){
if(isSendingData == true){
avwCmsApi(ClientData.userInfo_accountPath(),
"webContentPage",
"GET",
{sid:ClientData.userInfo_sid(),contentId: contentID,pageNos: lstPageNo[0], thumbnailFlg:1},
function(data){
getDataLoaded(data.pages);
//Resize Image
var imgTemp = new Image();
$('#img_bookmark_' +data.pages[0].pageNo).attr('src',formatStringBase64(data.pages[0].pageThumbnail));
imgTemp.onload = function(){
if(imgTemp.width > imgTemp.height) {
$("img.imgbox").attr('height', '');
$("img.imgbox").removeAttr('height');
$("img.imgbox").attr('width', '43');
}
else {
$("img.imgbox").attr('width', '');
$("img.imgbox").removeAttr('width');
$("img.imgbox").attr('height', '43');
}
};
imgTemp.src = formatStringBase64(data.pages[0].pageThumbnail);
lstPageNo = jQuery.grep(lstPageNo, function(value) {
return value != lstPageNo[0];
});
if(lstPageNo.length > 0){
loadDataBookmark(lstPageNo);
}else{
isSendingData = false;
}
},
null);
}
} }
/* check data has load */ /* check data has load */
function checkDataLoaded(nPageNo){ function checkDataLoaded(nPageNo,arrData){
var isExist = false; var nIndex = -1;
for(var n = 0; n < arrThumbnailsLoaded.length; n ++){ for(var n = 0; n < arrData.length; n ++){
if(arrThumbnailsLoaded[n].pageNo == nPageNo){ if(arrData[n].pageNo == nPageNo){
isExist = true; nIndex = n;
break; break;
} }
} }
return isExist; return nIndex;
} }
/* get data load*/ /* get data load*/
...@@ -1774,6 +1834,7 @@ ...@@ -1774,6 +1834,7 @@
/* event close list bookmark box */ /* event close list bookmark box */
function closeBookmarkBox(){ function closeBookmarkBox(){
$("#divListBookmark").hide(); $("#divListBookmark").hide();
isSendingData = false;
$('#boxBookMark').css('display' , 'none'); $('#boxBookMark').css('display' , 'none');
isDisplayBookMarkList = false; isDisplayBookMarkList = false;
...@@ -2059,20 +2120,51 @@ ...@@ -2059,20 +2120,51 @@
} }
/*event click show copy text */ /*event click show copy text */
function showCopyText(e){ function showCopyText(e) {
isDisplayCopyText = true; /* display dialog overlay */
//change class if (avwUserEnvObj.os == "android") {
$('#copytext').removeClass(); copyText();
$('#copytext').addClass('copy_hover'); } else {
isDisplayCopyText = true;
/* display dialog overlay */ //change class
$("#overlay").show(); $('#copytext').removeClass();
$('#copytext').addClass('copy_hover');
var array = [e.pageX, e.pageY]; $("#overlay").show();
var contentPage = dataWebContentPage.pages; var array = [e.pageX, e.pageY];
handleCopyTextData(contentPage,array) var contentPage = dataWebContentPage.pages;
handleCopyTextData(contentPage, array)
}
} }
function copyText() {
var w = window.open('contentview_textcopy.html');
}
function getText() {
/* init var page text */
var data = dataWebContentPage.pages;
var sPageText = '';
var w = $("#wrapper").width() / 2 - $('#boxCopyText').width() / 2;
var h = $("#wrapper").height() / 2 - $('#boxCopyText').height() / 2;
for(var nIndex = 0; nIndex < data.length; nIndex++){
/* get text of current page */
if(data[nIndex].pageNo == changePageIndex(getPageIndex())){
sPageText = htmlEncode(data[nIndex].pageText);
break;
}
}
if (sPageText == '') {
return { text: i18nText('txtNoTextCopy'), title: i18nText('txtTextCopy') + ' | ' + i18nText('sysAppTitle') };
}
else {
var strPattern = "\n";
var strTemp = sPageText;
strTemp = strTemp.replaceAll(strPattern, "<br/>");
strTemp += "<br/>";
return { text: strTemp, title: i18nText('txtTextCopy') + ' | ' + i18nText('sysAppTitle') };
}
}
/* event close copy text box */ /* event close copy text box */
function closeCopyTextBox(){ function closeCopyTextBox(){
isDisplayCopyText = false; isDisplayCopyText = false;
...@@ -2252,6 +2344,7 @@ ...@@ -2252,6 +2344,7 @@
/* event close searching result box */ /* event close searching result box */
function closeSearchingBox(){ function closeSearchingBox(){
isSendingData = false;
$("#divSearchResult").hide(); $("#divSearchResult").hide();
$('#boxSearching').css('display' , 'none'); $('#boxSearching').css('display' , 'none');
...@@ -2286,27 +2379,21 @@ ...@@ -2286,27 +2379,21 @@
var pos = [w, marginY]; var pos = [w, marginY];
if($('#txtSearch').val() != '') if($('#txtSearch').val() != '')
{ {
var dataStored = arrThumbnailsLoaded;
var contentPage = dataWebContentPage.pages; var contentPage = dataWebContentPage.pages;
var myRegExp = new RegExp($('#txtSearch').val()); var myRegExp = new RegExp($('#txtSearch').val());
var sPageNo = ''; var sPageNo = [];
var lstPageNo = [];
var isExistData = false; var isExistData = false;
//search content
for(var nIndex = 0; nIndex < contentPage.length; nIndex++){ for(var nIndex = 0; nIndex < contentPage.length; nIndex++){
if(myRegExp.test(contentPage[nIndex].pageText)){ if(myRegExp.test(contentPage[nIndex].pageText)){
if (checkDataLoaded(contentPage[nIndex].pageNo) == false){ /* check if data not loaded */ //searchResult.push(contentPage[nIndex]);
//searchResult.push(contentPage[nIndex]); sPageNo.push(contentPage[nIndex]);
sPageNo += contentPage[nIndex].pageNo + ',';
}else{
isExistData = true;
}
} }
} }
if(sPageNo.length > 0){
if(sPageNo != ''){ //title start
sPageNo = sPageNo.substring(0,sPageNo.length - 1);
//title start
$('#bookmarkBoxHdSearching').children().remove(); $('#bookmarkBoxHdSearching').children().remove();
$('#bookmarkBoxHdSearching').html('<a id="searchingResultClosing" class="delete" > </a>'); $('#bookmarkBoxHdSearching').html('<a id="searchingResultClosing" class="delete" > </a>');
$("#searchingResultClosing").click(closeSearchingBox); $("#searchingResultClosing").click(closeSearchingBox);
...@@ -2319,42 +2406,114 @@ ...@@ -2319,42 +2406,114 @@
$('#boxSearching').draggable({ handle: "h1" }); $('#boxSearching').draggable({ handle: "h1" });
$("#boxSearching").offset({left:pos[0],top:pos[1]}); $("#boxSearching").offset({left:pos[0],top:pos[1]});
$("#divSearchResult").show(); $("#divSearchResult").show();
$("#divSearchResult").offset({left:pos[0],top:(pos[1] + $('#bookmarkBoxHdSearching').height() - 2)}); $("#divSearchResult").offset({left:pos[0],top:(pos[1] + $('#bookmarkBoxHdSearching').height() - 2)});
/* create loading on dialog */ $('#divSearchResult').children().remove();
$('#divSearchResult').children().remove();
$('#divSearchResult').append(
'<img src="img/view_loading.gif" style="padding-left: 65px; padding-top: 45px" width="64px" height="64px">'
);
avwCmsApi(ClientData.userInfo_accountPath(),
"webContentPage",
"GET",
{sid:ClientData.userInfo_sid(),contentId: contentID,pageNos: sPageNo, thumbnailFlg:1},
function(data){
getDataLoaded(data.pages);
loadDataToDialogSearch(arrThumbnailsLoaded);
},
null);
}else if(isExistData == true){
//title start
$('#bookmarkBoxHdSearching').children().remove();
$('#bookmarkBoxHdSearching').html('<a id="searchingResultClosing" class="delete" > </a>');
$("#searchingResultClosing").click(closeSearchingBox);
$('#bookmarkBoxHdSearching').append(i18nText('txtSearchResult'));
//title end
//lockLayout();
$('#boxSearching').css('z-index' , '101');
$('#boxSearching').css('display' , 'block');
$('#boxSearching').draggable({ handle: "h1" });
$("#boxSearching").offset({left:pos[0],top:pos[1]});
$("#divSearchResult").show();
$("#divSearchResult").offset({left:pos[0],top:(pos[1] + $('#bookmarkBoxHdSearching').height() - 2)});
loadDataToDialogSearch(arrThumbnailsLoaded) for(var i = 0; i < sPageNo.length; i ++){
}else{ var nStored = checkDataLoaded(sPageNo[i].pageNo,dataStored);
if( nStored != -1){ /* data loaded */
$('#divSearchResult').append(
' <li id="'+changePageNo(sPageNo[i].pageNo)+'">' +
' <img id="img_search_' +sPageNo[i].pageNo + '" class="imgbox" src="' +formatStringBase64(dataStored[nStored].pageThumbnail)+ '"/>' +
' <span class="mdltext">' +
i18nText('txtPage') + (changePageNo(sPageNo[i].pageNo) + 1) + '<br /> ' +
htmlEncode(truncate(sPageNo[i].pageText,20)) +
' </span>' +
' </li>'
);
//Resize Image
var imgTemp = new Image();
imgTemp.onload = function(){
if(imgTemp.width > imgTemp.height) {
$("img.imgbox").attr('height', '');
$("img.imgbox").removeAttr('height');
$("img.imgbox").attr('width', '43');
}
else {
$("img.imgbox").attr('width', '');
$("img.imgbox").removeAttr('width');
$("img.imgbox").attr('height', '43');
}
};
imgTemp.src = formatStringBase64(dataStored[nStored].pageThumbnail);
}else{
$('#divSearchResult').append(
' <li id="'+changePageNo(sPageNo[i].pageNo)+'">' +
' <img id="img_search_' +sPageNo[i].pageNo + '" class="imgbox" src="img/view_loading.gif"/>' +
' <span class="mdltext">' +
i18nText('txtPage') + (changePageNo(sPageNo[i].pageNo) + 1) + '<br /> ' +
htmlEncode(truncate(sPageNo[i].pageText,20)) +
' </span>' +
' </li>'
);
//Resize Image
var imgTemp = new Image();
imgTemp.onload = function(){
if(imgTemp.width > imgTemp.height) {
$("img.imgbox").attr('height', '');
$("img.imgbox").removeAttr('height');
$("img.imgbox").attr('width', '43');
}
else {
$("img.imgbox").attr('width', '');
$("img.imgbox").removeAttr('width');
$("img.imgbox").attr('height', '43');
}
};
imgTemp.src = "img/view_loading.gif";
lstPageNo.push(sPageNo[i].pageNo);
/*avwCmsApi(ClientData.userInfo_accountPath(),
"webContentPage",
"GET",
{sid:ClientData.userInfo_sid(),contentId: contentID,pageNos: sPageNo[i].pageNo, thumbnailFlg:1},
function(data){
getDataLoaded(data.pages);
//Resize Image
var imgTemp = new Image();
$('#img_search_' +data.pages[0].pageNo).attr('src',formatStringBase64(data.pages[0].pageThumbnail));
imgTemp.onload = function(){
if(imgTemp.width > imgTemp.height) {
$("img.imgbox").attr('height', '');
$("img.imgbox").removeAttr('height');
$("img.imgbox").attr('width', '43');
}
else {
$("img.imgbox").attr('width', '');
$("img.imgbox").removeAttr('width');
$("img.imgbox").attr('height', '43');
}
};
imgTemp.src = formatStringBase64(data.pages[0].pageThumbnail);
},
null);
*/
}
}
if(lstPageNo.length > 0){
isSendingData = true;
loadDataSearch(lstPageNo);
}
}else{
$('#divSearchResult').children().remove(); $('#divSearchResult').children().remove();
$('#divSearchResult').append('<span class="last">' + i18nText('txtNoSearchResult') + '</span>'); $('#divSearchResult').append('<span class="last">' + i18nText('txtNoSearchResult') + '</span>');
...@@ -2386,6 +2545,50 @@ ...@@ -2386,6 +2545,50 @@
} }
} }
function loadDataSearch(lstPageNo){
if(isSendingData == true){
avwCmsApi(ClientData.userInfo_accountPath(),
"webContentPage",
"GET",
{sid:ClientData.userInfo_sid(),contentId: contentID,pageNos: lstPageNo[0], thumbnailFlg:1},
function(data){
getDataLoaded(data.pages);
//Resize Image
var imgTemp = new Image();
$('#img_search_' +data.pages[0].pageNo).attr('src',formatStringBase64(data.pages[0].pageThumbnail));
imgTemp.onload = function(){
if(imgTemp.width > imgTemp.height) {
$("img.imgbox").attr('height', '');
$("img.imgbox").removeAttr('height');
$("img.imgbox").attr('width', '43');
}
else {
$("img.imgbox").attr('width', '');
$("img.imgbox").removeAttr('width');
$("img.imgbox").attr('height', '43');
}
};
imgTemp.src = formatStringBase64(data.pages[0].pageThumbnail);
lstPageNo = jQuery.grep(lstPageNo, function(value) {
return value != lstPageNo[0];
});
if(lstPageNo.length > 0){
loadDataSearch(lstPageNo);
}else{
isSendingData = false;
}
},
null);
}
}
/* load data to dialog search */ /* load data to dialog search */
function loadDataToDialogSearch(searchResultTemp){ function loadDataToDialogSearch(searchResultTemp){
...@@ -2453,9 +2656,12 @@ ...@@ -2453,9 +2656,12 @@
function nextPage_click() { function nextPage_click() {
if(getContent().hasNextPage()) { if(getContent().hasNextPage()) {
disableAllControl(); disableAllControl();
$('#divImageLoading').css('display', 'block');
$('#divImageLoading').css('display','block'); // Clear canvas main
context_main.clearRect(0, 0, context_main.width, context_main.height);
avwGrabContentPageImage(ClientData.userInfo_accountPath(), avwGrabContentPageImage(ClientData.userInfo_accountPath(),
{contentId: contentID,sid:ClientData.userInfo_sid(),pageNo:getPageIndex() + 2}, {contentId: contentID,sid:ClientData.userInfo_sid(),pageNo:getPageIndex() + 2},
function(data){ function(data){
...@@ -2520,6 +2726,9 @@ ...@@ -2520,6 +2726,9 @@
$('#divImageLoading').css('display','block'); $('#divImageLoading').css('display','block');
// Clear canvas main
context_main.clearRect(0, 0, context_main.width, context_main.height);
//pageImages = getURLPageImage("webContentPageImage") + "?contentId=" + contentID + "&sid=" + ClientData.userInfo_sid() + "&pageNo=" + (getPageIndex() - 1); //pageImages = getURLPageImage("webContentPageImage") + "?contentId=" + contentID + "&sid=" + ClientData.userInfo_sid() + "&pageNo=" + (getPageIndex() - 1);
avwGrabContentPageImage(ClientData.userInfo_accountPath(), avwGrabContentPageImage(ClientData.userInfo_accountPath(),
{contentId: contentID,sid:ClientData.userInfo_sid(),pageNo:getPageIndex()}, {contentId: contentID,sid:ClientData.userInfo_sid(),pageNo:getPageIndex()},
...@@ -2549,6 +2758,9 @@ ...@@ -2549,6 +2758,9 @@
$('#divImageLoading').css('display','block'); $('#divImageLoading').css('display','block');
// Clear canvas main
context_main.clearRect(0, 0, context_main.width, context_main.height);
avwGrabContentPageImage(ClientData.userInfo_accountPath(), avwGrabContentPageImage(ClientData.userInfo_accountPath(),
{contentId: contentID,sid:ClientData.userInfo_sid(),pageNo:1}, {contentId: contentID,sid:ClientData.userInfo_sid(),pageNo:1},
function(data){ function(data){
...@@ -2577,6 +2789,9 @@ ...@@ -2577,6 +2789,9 @@
$('#divImageLoading').css('display','block'); $('#divImageLoading').css('display','block');
// Clear canvas main
context_main.clearRect(0, 0, context_main.width, context_main.height);
//pageImages = getURLPageImage("webContentPageImage") + "?contentId=" + contentID + "&sid=" + ClientData.userInfo_sid() + "&pageNo=" + (totalPage - 1); //pageImages = getURLPageImage("webContentPageImage") + "?contentId=" + contentID + "&sid=" + ClientData.userInfo_sid() + "&pageNo=" + (totalPage - 1);
avwGrabContentPageImage(ClientData.userInfo_accountPath(), avwGrabContentPageImage(ClientData.userInfo_accountPath(),
{contentId: contentID,sid:ClientData.userInfo_sid(),pageNo:totalPage}, {contentId: contentID,sid:ClientData.userInfo_sid(),pageNo:totalPage},
...@@ -2609,8 +2824,11 @@ ...@@ -2609,8 +2824,11 @@
if(page_index != getContent().pageIndex){ if(page_index != getContent().pageIndex){
disableAllControl(); disableAllControl();
$('#divImageLoading').css('display','block'); $('#divImageLoading').css('display', 'block');
// Clear canvas main
context_main.clearRect(0, 0, context_main.width, context_main.height);
avwGrabContentPageImage(ClientData.userInfo_accountPath(), avwGrabContentPageImage(ClientData.userInfo_accountPath(),
{contentId: contentID,sid:ClientData.userInfo_sid(),pageNo:page_index + 1}, {contentId: contentID,sid:ClientData.userInfo_sid(),pageNo:page_index + 1},
...@@ -3163,16 +3381,15 @@ ...@@ -3163,16 +3381,15 @@
/* tablet [end]*/ /* tablet [end]*/
} }
function ev_canvas(ev) { function ev_canvas (ev) {
if (ev.offsetX || ev.offsetX == 0) { // Opera
if (ev.offsetX || ev.offsetX == 0) { // Opera ev._x = ev.offsetX;
ev._x = ev.offsetX; ev._y = ev.offsetY;
ev._y = ev.offsetY; } else if (ev.layerX || ev.layerX == 0) { // Firefox
} else if (ev.layerX || ev.layerX == 0) { // Firefox ev._x = ev.layerX;
ev._x = ev.layerX; ev._y = ev.layerY;
ev._y = ev.layerY; }
}
// Call the event handler of the tool. // Call the event handler of the tool.
var func = tool[ev.type]; var func = tool[ev.type];
...@@ -3303,22 +3520,22 @@ function oldContent_Back(){ ...@@ -3303,22 +3520,22 @@ function oldContent_Back(){
$("#draw_canvas").attr('height', destRect.bottom - destRect.top) $("#draw_canvas").attr('height', destRect.bottom - destRect.top)
.attr('width', destRect.right - destRect.left) .attr('width', destRect.right - destRect.left)
.css('top', destRect.top) .css('top', destRect.top)
.css('left',destRect.left + marginX - 1); .css('left',destRect.left + marginX);
$("#marker_canvas").attr('height', destRect.bottom - destRect.top) $("#marker_canvas").attr('height', destRect.bottom - destRect.top)
.attr('width', destRect.right - destRect.left) .attr('width', destRect.right - destRect.left)
.css('top', destRect.top) .css('top', destRect.top)
.css('left',destRect.left + marginX - 1); .css('left',destRect.left + marginX);
}else{ }else{
$("#draw_canvas").attr('height', destRect.bottom - destRect.top) $("#draw_canvas").attr('height', destRect.bottom - destRect.top)
.attr('width', destRect.right - destRect.left) .attr('width', destRect.right - destRect.left)
.css('top', destRect.top + marginY - 1) .css('top', destRect.top + marginY)
.css('left',destRect.left + marginX - 1); .css('left',destRect.left + marginX);
$("#marker_canvas").attr('height', destRect.bottom - destRect.top) $("#marker_canvas").attr('height', destRect.bottom - destRect.top)
.attr('width', destRect.right - destRect.left) .attr('width', destRect.right - destRect.left)
.css('top', destRect.top + marginY - 1) .css('top', destRect.top + marginY)
.css('left',destRect.left + marginX - 1); .css('left',destRect.left + marginX);
} }
} }
...@@ -3545,8 +3762,11 @@ function oldContent_Back(){ ...@@ -3545,8 +3762,11 @@ function oldContent_Back(){
function changePageWithoutSlide(pageMove){ function changePageWithoutSlide(pageMove){
disableAllControl(); disableAllControl();
$('#divImageLoading').css('display','block'); $('#divImageLoading').css('display','block');
// Clear canvas main
context_main.clearRect(0, 0, context_main.width, context_main.height);
avwGrabContentPageImage(ClientData.userInfo_accountPath(), avwGrabContentPageImage(ClientData.userInfo_accountPath(),
{contentId: contentID,sid:ClientData.userInfo_sid(),pageNo:pageMove + 1}, {contentId: contentID,sid:ClientData.userInfo_sid(),pageNo:pageMove + 1},
function(data){ function(data){
...@@ -3709,86 +3929,110 @@ function oldContent_Back(){ ...@@ -3709,86 +3929,110 @@ function oldContent_Back(){
sizingScreen(); sizingScreen();
/* close dialog popuptext */ /* close dialog popuptext */
closeDialogResize(); closeDialogResize();
}); });
$(document).ajaxComplete(function(){ $(document).ajaxComplete(function () {
/*Init Page */
nAjaxLoad ++; /*Init Page */
if(nAjaxLoad == 7){ nAjaxLoad++;
if (nAjaxLoad == 7) {
/* handle from bookmark page */
//handleFromBookMarkPage(); /* handle from bookmark page */
/* check move content */ //handleFromBookMarkPage();
if(ClientData.bookmark_pageNo()){ /* check move content */
//changePage(changePageNo(ClientData.bookmark_pageNo())); if (ClientData.bookmark_pageNo()) {
changePageWithoutSlide(changePageNo(ClientData.bookmark_pageNo())); //changePage(changePageNo(ClientData.bookmark_pageNo()));
ClientData.bookmark_pageNo(null) changePageWithoutSlide(changePageNo(ClientData.bookmark_pageNo()));
ClientData.bookmark_pageNo(null)
}else if(ClientData.common_prePageNo()){
/* handle from jump content */ } else if (ClientData.common_prePageNo()) {
handleFromJumpContent(); /* handle from jump content */
}else if (ClientData.IsJumpBack() == true){ handleFromJumpContent();
/* handle back */ } else if (ClientData.IsJumpBack() == true) {
oldContent_Back(); /* handle back */
}else{ oldContent_Back();
if(getPageIndex() == 0){ } else {
getContent().setPageImages(totalPage, pageImages) if (getPageIndex() == 0) {
getContent().setPageImages(totalPage, pageImages)
.setPageObjects(pageObjects) .setPageObjects(pageObjects)
.setUpPage(0); .setUpPage(0);
/* set pageTitle*/ /* set pageTitle*/
if(dataPageTitle[0]){ if (dataPageTitle[0]) {
if(dataPageTitle[0] != ''){ if (dataPageTitle[0] != '') {
document.title = contentName + '_' + dataPageTitle[0] + ' | ' + i18nText('sysAppTitle'); document.title = contentName + '_' + dataPageTitle[0] + ' | ' + i18nText('sysAppTitle');
}else{ } else {
document.title = contentName + ' | ' + i18nText('sysAppTitle'); document.title = contentName + ' | ' + i18nText('sysAppTitle');
} }
}else{ } else {
document.title = contentName + ' | ' + i18nText('sysAppTitle'); document.title = contentName + ' | ' + i18nText('sysAppTitle');
} }
/* handle slider bar */ /* handle slider bar */
handleSliderBar(); handleSliderBar();
} }
} }
if (isTouchDevice() == true) {
/* window resize event */ if (avwUserEnvObj.os == "android") {
$(window).resize(function() { startDetectZoom({ time: 500,
resizeScreen(); callbackFunction: function (oldRatio, newRatio, oldW, oldH, newW, newH) {
isChangeSizeScreen = false; // Adjust position for toolbar and footer bar
var top = window.innerHeight - $("#footer_toolbar_1").height();
/* change position dialog */ $("#header_toolbar").css("width", window.innerWidth);
changePosDialog() $("#footer_toolbar_1").css("top", top + "px");
$("#footer_toolbar_2").css("top", top + "px");
/* close dialog popuptext */ }
closeDialogResize(); });
}); }
}
/* check status button */ /* window resize event */
checkExistNextPrePage(); $(window).resize(function () {
if (isTouchDevice() == true) {
/*init Image Bookmark */ if (avwUserEnvObj.os == "android") {
initImageBookmark(); // Adjust position for toolbar and footer bar
var top = window.innerHeight - $("#footer_toolbar_1").height();
$('#lblSlider').text('/ ' + totalPage); $("#header_toolbar").css("width", window.innerWidth);
/* memo */ $("#footer_toolbar_1").css("top", top + "px");
initImageMemo(); $("#footer_toolbar_2").css("top", top + "px");
initImageAddMemo(); }
}
/* init image had draw */ resizeScreen();
initDisplayMarking(); isChangeSizeScreen = false;
/* check status */ /* change position dialog */
checkStatusImageMarking(); changePosDialog()
trackTransforms(context_main); /* close dialog popuptext */
closeDialogResize();
nAjaxLoad = 0;
});
}
/* check status button */
}); checkExistNextPrePage();
/*init Image Bookmark */
initImageBookmark();
$('#lblSlider').text('/ ' + totalPage);
/* memo */
initImageMemo();
initImageAddMemo();
/* init image had draw */
initDisplayMarking();
/* check status */
checkStatusImageMarking();
trackTransforms(context_main);
//nAjaxLoad = 0;
}
});
} }
$("document").ready(function () { $("document").ready(function () {
...@@ -3915,12 +4159,12 @@ function oldContent_Back(){ ...@@ -3915,12 +4159,12 @@ function oldContent_Back(){
</header> </header>
<aside id="boxAddMemo" class="bookmarkBox" style="display: none;height:175px"> <aside id="boxAddMemo" class="bookmarkBox" style="display: none;height:180px">
<h1 id="bookmarkBoxHdMemo" class="bookmarkBoxHd"> <h1 id="bookmarkBoxHdMemo" class="bookmarkBoxHd">
<a id="memoClosing" class="delete" > </a> <a id="memoClosing" class="delete" > </a>
<label class="lang" lang = "txtMemoMenu" ></label> <label class="lang" lang = "txtMemoMenu" ></label>
</h1> </h1>
<ul id="divAddMemo" class="bookmarkBoxBody_on" style="height:151px"> <ul id="divAddMemo" class="bookmarkBoxBody_on" style="height:156px">
<br /> <br />
<a id="liAddMemo" lang = "txtMemoNew" class="lang cancelbtn" style="margin-left:35px" > </a> <br /> <a id="liAddMemo" lang = "txtMemoNew" class="lang cancelbtn" style="margin-left:35px" > </a> <br />
<a id="liCopyMemo" lang = "txtMemoPaste" class="lang cancelbtn" style="margin-left:35px" > </a> <br /> <a id="liCopyMemo" lang = "txtMemoPaste" class="lang cancelbtn" style="margin-left:35px" > </a> <br />
......
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8" />
<title>テキストコピー | ABook閲覧ウェブ版 (言語対応)</title>
<script src="common/js/jquery-1.8.1.min.js" type="text/javascript"></script>
<script>
$(document).ready(function () {
var data = window.opener.getText();
$('#result').html(data.text);
document.title = data.title;
});
</script>
<style>
#result {
-webkit-box-shadow: 3px 3px 8px rgba(50, 50, 50, 0.4);
-moz-box-shadow: 3px 3px 8px rgba(50, 50, 50, 0.4);
box-shadow: 3px 3px 8px rgba(50, 50, 50, 0.4);
background:#FFFFFF;
border:solid 1px #cfd0d0;
border-top: 1px solid #cfd0d0;
vertical-align:middle;
word-wrap:break-word;
padding: 5px;
line-height: 25px;
margin: 30px 20px 20px 20px;
min-height: 300px;
}
</style>
</head>
<body>
<div id="result"></div>
</body>
</html>
...@@ -418,7 +418,8 @@ div .ui-slider-range, .ui-widget-header, .ui-slider-range-max { ...@@ -418,7 +418,8 @@ div .ui-slider-range, .ui-widget-header, .ui-slider-range-max {
z-index: 102; z-index: 102;
font-family: Verdana; font-family: Verdana;
font-size: 10pt; font-size: 10pt;
border-radius: 10px; border-radius: 10px;
z-index: 101;
} }
.popuptext_arrow { .popuptext_arrow {
......
...@@ -38,6 +38,7 @@ ...@@ -38,6 +38,7 @@
html,body{ html,body{
width:100%; width:100%;
height:100%;
} }
body{ body{
...@@ -51,8 +52,7 @@ body{ ...@@ -51,8 +52,7 @@ body{
#wrapper { #wrapper {
max-width:none; max-width:none;
min-width:1000px; min-width:1000px;
height:100%;
} }
...@@ -74,8 +74,7 @@ header{ ...@@ -74,8 +74,7 @@ header{
max-width:none; max-width:none;
min-width:1000px; min-width:1000px;
height:60px; height:60px;
position:absolute; /*position:absolute;*/
width:100%;
} }
/*ヘッダー左カラム*/ /*ヘッダー左カラム*/
...@@ -944,6 +943,7 @@ aside.bookmarkBox li .imgbox{ ...@@ -944,6 +943,7 @@ aside.bookmarkBox li .imgbox{
border:solid 1px #444; border:solid 1px #444;
background:#ccc; background:#ccc;
margin:0 4px 0 0; margin:0 4px 0 0;
} }
aside.bookmarkBox li .mdltext{ aside.bookmarkBox li .mdltext{
...@@ -1067,15 +1067,15 @@ aside.bookmarkBox .last{ ...@@ -1067,15 +1067,15 @@ aside.bookmarkBox .last{
.transition .last {width:56px;background-position:-174px 0;} .transition .last {width:56px;background-position:-174px 0;}
.transition a:hover.last {background-position:-174px -33px;} .transition a:hover.last {background-position:-174px -33px;}
.transition .begin_device {width:59px;background-position:0 -33px;} .transition .begin_device {width:59px;background-position:0 0;}
.transition .prev_device {width:57px;background-position:-59px -33px;} .transition .prev_device {width:57px;background-position:-59px 0;}
.transition .next_device {width:58px;background-position:-116px -33px;} .transition .next_device {width:58px;background-position:-116px 0;}
.transition .last_device {width:56px;background-position:-174px -33px;} .transition .last_device {width:56px;background-position:-174px 0;}
.transition .begin_off {width:59px;background-position:0 0;} .transition .begin_off {width:59px;background-position:0 -66px;}
.transition .prev_off {width:57px;background-position:-59px 0;} .transition .prev_off {width:57px;background-position:-59px -66px;}
.transition .next_off {width:58px;background-position:-116px 0;} .transition .next_off {width:58px;background-position:-116px -66px;}
.transition .last_off {width:56px;background-position:-174px 0;} .transition .last_off {width:56px;background-position:-174px -66px;}
/*----------------------------*/ /*----------------------------*/
...@@ -1111,13 +1111,13 @@ aside.bookmarkBox .last{ ...@@ -1111,13 +1111,13 @@ aside.bookmarkBox .last{
.sizing .reduction {width:56px;background-position:-117px 0;} .sizing .reduction {width:56px;background-position:-117px 0;}
.sizing a:hover.reduction {background-position:-117px -33px;} .sizing a:hover.reduction {background-position:-117px -33px;}
.sizing .expansion_device {width:59px;background-position:0 -33px;} .sizing .expansion_device {width:59px;background-position:0 0;}
.sizing .fit_device {width:58px;background-position:-59px -33px;} .sizing .fit_device {width:58px;background-position:-59px 0;}
.sizing .reduction_device {width:56px;background-position:-117px -33px;} .sizing .reduction_device {width:56px;background-position:-117px 0;}
.sizing .expansion_off {width:59px;background-position:0 0;} .sizing .expansion_off {width:59px;background-position:0 -66px;}
.sizing .fit_off {width:58px;background-position:-59px 0;} .sizing .fit_off {width:58px;background-position:-59px -66px;}
.sizing .reduction_off {width:56px;background-position:-117px 0;} .sizing .reduction_off {width:56px;background-position:-117px -66px;}
/*----------------------------*/ /*----------------------------*/
/* 14. toolbar setting */ /* 14. toolbar setting */
/*----------------------------*/ /*----------------------------*/
......
...@@ -842,7 +842,8 @@ function SyncContent() { ...@@ -842,7 +842,8 @@ function SyncContent() {
} }
} }
else { else {
// Skip this case arrBookmarks.splice(nIndex, 1);
ClientData.isChangedBookmark(true);
} }
} }
......
...@@ -836,7 +836,8 @@ Transition.prototype.flipNextPage = function() { ...@@ -836,7 +836,8 @@ Transition.prototype.flipNextPage = function() {
var w = $('#main').attr('width'); var w = $('#main').attr('width');
removeObject(); removeObject();
if(getContent().hasNextPage()) { if(getContent().hasNextPage()) {
context_main.clearRect(0, 0, canvas_main.width, canvas_main.height);
$('#main').animate( $('#main').animate(
{left : '-' + w + 'px'}, {left : '-' + w + 'px'},
{ {
...@@ -886,6 +887,7 @@ Transition.prototype.flipPreviousPage = function() { ...@@ -886,6 +887,7 @@ Transition.prototype.flipPreviousPage = function() {
removeObject(); removeObject();
if(getContent().hasPreviousPage()) { if(getContent().hasPreviousPage()) {
context_main.clearRect(0, 0, canvas_main.width, canvas_main.height);
$('#main').animate( $('#main').animate(
{left : w + 'px'}, {left : w + 'px'},
{ {
...@@ -934,6 +936,7 @@ Transition.prototype.flipToPage = function(index) { ...@@ -934,6 +936,7 @@ Transition.prototype.flipToPage = function(index) {
/* init image had draw */ /* init image had draw */
initDisplayMarking(); initDisplayMarking();
}else if(index < getContent().pageIndex){ }else if(index < getContent().pageIndex){
context_main.clearRect(0, 0, canvas_main.width, canvas_main.height);
removeObject(); removeObject();
$('#main').animate( $('#main').animate(
{left : w + 'px'}, {left : w + 'px'},
...@@ -971,8 +974,9 @@ Transition.prototype.flipToPage = function(index) { ...@@ -971,8 +974,9 @@ Transition.prototype.flipToPage = function(index) {
} }
} }
); );
}else{ }else{
removeObject(); context_main.clearRect(0, 0, canvas_main.width, canvas_main.height);
removeObject();
$('#main').animate( $('#main').animate(
{left : '-' + w + 'px'}, {left : '-' + w + 'px'},
{ {
...@@ -1026,6 +1030,7 @@ function removeObject(){ ...@@ -1026,6 +1030,7 @@ function removeObject(){
$("#boxIndex").hide(); $("#boxIndex").hide();
$("#boxBookMark").hide(); $("#boxBookMark").hide();
$('#pop_up_memo').hide(); $('#pop_up_memo').hide();
isSendingData = false;
isDisplayBookMarkList = false; isDisplayBookMarkList = false;
...@@ -1145,22 +1150,27 @@ function onClick_CanvasMain(event){ ...@@ -1145,22 +1150,27 @@ function onClick_CanvasMain(event){
posXPopupMemo = event.pageX; posXPopupMemo = event.pageX;
posYPopupMemo = event.pageY; posYPopupMemo = event.pageY;
if((event.pageX - marginX) >= destRect.left && (event.pageX - marginX) <= destRect.right){ if((event.pageX - marginX) >= destRect.left && (event.pageX - marginX) <= destRect.right){
if(isCopyMemo == true){ /* click add memo */
CopyMemo(objEditMemo.text,contentID,changePageIndex(getPageIndex()),$('#divDialogMemo'),event.pageX,event.pageY,function(){ if(ClientData.IsAddingMemo() == true){
if(!ClientData.memo_copyText()){
AddMemo(contentID,changePageIndex(getPageIndex()),$('#divDialogMemo'),event.pageX,event.pageY,function(){
//set flag change memo //set flag change memo
ClientData.isChangedMemo(true); ClientData.isChangedMemo(true);
ClientData.IsAddingMemo(false);
/* refresh draw memo */ /* refresh draw memo */
drawMemoOnScreen(); drawMemoOnScreen();
});
}else{ //change image
/* click add memo */ $('#imgaddmemo').removeClass();
if(ClientData.IsAddingMemo() == true){ $('#imgaddmemo').addClass('memoAdd');
});
if(!ClientData.memo_copyText()){ }else{
AddMemo(contentID,changePageIndex(getPageIndex()),$('#divDialogMemo'),event.pageX,event.pageY,function(){ if(typeSelectMemo == 1){ /* add new */
AddMemo(contentID,changePageIndex(getPageIndex()),$('#divDialogMemo'),posXPopupMemo,posYPopupMemo,function(){
//set flag change memo //set flag change memo
ClientData.isChangedMemo(true); ClientData.isChangedMemo(true);
ClientData.IsAddingMemo(false); ClientData.IsAddingMemo(false);
...@@ -1170,129 +1180,114 @@ function onClick_CanvasMain(event){ ...@@ -1170,129 +1180,114 @@ function onClick_CanvasMain(event){
//change image //change image
$('#imgaddmemo').removeClass(); $('#imgaddmemo').removeClass();
$('#imgaddmemo').addClass('memoAdd'); $('#imgaddmemo').addClass('memoAdd');
}); });
}else{
if(typeSelectMemo == 1){ /* add new */ }else if(typeSelectMemo == 2){ /* copy */
AddMemo(contentID,changePageIndex(getPageIndex()),$('#divDialogMemo'),posXPopupMemo,posYPopupMemo,function(){ CopyMemo(ClientData.memo_copyText(),contentID,changePageIndex(getPageIndex()),$('#divDialogMemo'),posXPopupMemo,posYPopupMemo,function(){
//set flag change memo //set flag change memo
ClientData.isChangedMemo(true); ClientData.isChangedMemo(true);
ClientData.IsAddingMemo(false); ClientData.IsAddingMemo(false);
/* refresh draw memo */ /* refresh draw memo */
drawMemoOnScreen(); drawMemoOnScreen();
//change image //change image
$('#imgaddmemo').removeClass(); $('#imgaddmemo').removeClass();
$('#imgaddmemo').addClass('memoAdd'); $('#imgaddmemo').addClass('memoAdd');
}); });
}
}else if(typeSelectMemo == 2){ /* copy */ }
CopyMemo(ClientData.memo_copyText(),contentID,changePageIndex(getPageIndex()),$('#divDialogMemo'),posXPopupMemo,posYPopupMemo,function(){
//set flag change memo }else{
ClientData.isChangedMemo(true);
ClientData.IsAddingMemo(false); var isClickMemo = false;
/* refresh draw memo */ if(isOpenPopUpText == true){
drawMemoOnScreen(); isOpenPopUpText = false;
ClosePopupText();
//change image }
$('#imgaddmemo').removeClass();
$('#imgaddmemo').addClass('memoAdd'); if(isOpenPopUpMemo == true){
}); isOpenPopUpMemo = false;
$("#pop_up_memo").hide();
}
/* click memo edit */
if (ClientData.IsDisplayMemo() == true){
getAllMemoOfPage();
/* check exist object memo in mouse position */
for(var nIndex = 0; nIndex < memoObjects.length; nIndex++){
var hitPageObjMemo = memoObjects[nIndex];
if(hitPageObjMemo.hitTest(imagePt.x, imagePt.y)) {
//console.log("PageObject Hit!! Id: " + hitPageObjMemo.id);
//hitPageObjMemo.action();
/* save object memo */
objEditMemo = hitPageObjMemo;
var posMemoX = event.pageX;
var posMemoY = event.pageY;
if(imagePt.y > heightEachPage - $("#pop_up_memo").height()){
posMemoY = posMemoY - $("#pop_up_memo").height();
}
if(imagePt.x > widthEachPage - $("#pop_up_memo").width()){
posMemoX = posMemoX - $("#pop_up_memo").width();
}
/*display pop-up-memo */
$("#pop_up_memo").css('top', posMemoY).css('left', posMemoX);
$("#pop_up_memo").show();
/*set true for flag click memo */
isClickMemo = true;
isOpenPopUpMemo =true;
} }
}
}else{
var isClickMemo = false;
if(isOpenPopUpText == true){
isOpenPopUpText = false;
ClosePopupText();
} }
}
/* click pageObject */
if(isClickMemo == false){
var isClickLinkList = false;
if(isOpenPopUpMemo == true){ /* check exist object in mouse position */
isOpenPopUpMemo = false; var hitPageObj = getContent().currentPage.hitTest(imagePt.x, imagePt.y);
$("#pop_up_memo").hide();
}
/* click memo edit */ if(hitPageObj) {
if (ClientData.IsDisplayMemo() == true){ //console.log("PageObject Hit!! Id: " + hitPageObj.id);
getAllMemoOfPage(); hitPageObj.action();
/* check exist object memo in mouse position */ }else{
for(var nIndex = 0; nIndex < memoObjects.length; nIndex++){
var hitPageObjMemo = memoObjects[nIndex]; /* check click link list */
if(hitPageObjMemo.hitTest(imagePt.x, imagePt.y)) { for(var nIndex = 0; nIndex < webGetContentType4Objects.length; nIndex++){
//console.log("PageObject Hit!! Id: " + hitPageObjMemo.id); var hitPageObjLinkList = webGetContentType4Objects[nIndex];
//hitPageObjMemo.action(); if(hitPageObjLinkList.hitTest(imagePt.x, imagePt.y)) {
//console.log("PageObject Hit!! Id: " + hitPageObjLinkList.id);
/* save object memo */ hitPageObjLinkList.action();
objEditMemo = hitPageObjMemo;
var posMemoX = event.pageX;
var posMemoY = event.pageY;
if(imagePt.y > heightEachPage - $("#pop_up_memo").height()){
posMemoY = posMemoY - $("#pop_up_memo").height();
}
if(imagePt.x > widthEachPage - $("#pop_up_memo").width()){
posMemoX = posMemoX - $("#pop_up_memo").width();
}
/*display pop-up-memo */
$("#pop_up_memo").css('top', posMemoY).css('left', posMemoX);
$("#pop_up_memo").show();
/*set true for flag click memo */ /*set true for flag click memo */
isClickMemo = true; isClickLinkList = true;
isOpenPopUpMemo =true;
} }
} }
}
/* click pageObject */
if(isClickMemo == false){
var isClickLinkList = false;
/* check exist object in mouse position */
var hitPageObj = getContent().currentPage.hitTest(imagePt.x, imagePt.y);
if(hitPageObj) {
//console.log("PageObject Hit!! Id: " + hitPageObj.id);
hitPageObj.action();
}else{
/* check click link list */
for(var nIndex = 0; nIndex < webGetContentType4Objects.length; nIndex++){
var hitPageObjLinkList = webGetContentType4Objects[nIndex];
if(hitPageObjLinkList.hitTest(imagePt.x, imagePt.y)) {
//console.log("PageObject Hit!! Id: " + hitPageObjLinkList.id);
hitPageObjLinkList.action();
/*set true for flag click memo */
isClickLinkList = true;
}
}
if(isClickLinkList == false && ClientData.IsAddingMarking() == false){
/* area next and prev page */
var cwMain = $('#main').width();
if(event.pageX > 0 && event.pageX < 300){
prevPage_click();
}else if(event.pageX > (cwMain - 300) && event.pageX < cwMain){
nextPage_click();
}
}
if(isClickLinkList == false && ClientData.IsAddingMarking() == false){
/* area next and prev page */
var cwMain = $('#main').width();
if(event.pageX > 0 && event.pageX < 300){
prevPage_click();
}else if(event.pageX > (cwMain - 300) && event.pageX < cwMain){
nextPage_click();
}
} }
}
} }
} }
}
}else{ }else{
if(ClientData.IsAddingMarking() == false && isCopyMemo == false){ if(ClientData.IsAddingMarking() == false && isCopyMemo == false){
var cwMain = $('#main').width(); var cwMain = $('#main').width();
...@@ -1578,10 +1573,18 @@ function disableControlsCopyMemo(){ ...@@ -1578,10 +1573,18 @@ function disableControlsCopyMemo(){
$('#imgmarkingtoolbar').removeClass(); $('#imgmarkingtoolbar').removeClass();
$('#imgmarkingtoolbar').addClass('markingToolbar_off'); $('#imgmarkingtoolbar').addClass('markingToolbar_off');
$('#firstpage').unbind('click'); $('#firstpage').unbind('click');
$('#firstpage').removeClass();
$('#firstpage').addClass('begin_off');
$('#prevpage').unbind('click'); $('#prevpage').unbind('click');
$('#prevpage').removeClass();
$('#prevpage').addClass('prev_off');
$('#nextpage').unbind('click'); $('#nextpage').unbind('click');
$('#nextpage').removeClass();
$('#nextpage').addClass('next_off');
$('#lastpage').unbind('click'); $('#lastpage').unbind('click');
$('#lastpage').removeClass();
$('#lastpage').addClass('last_off');
if(avwUserEnvObj.os != "android"){ if(avwUserEnvObj.os != "android"){
$("#slider_page").slider("option", "disabled", true ); $("#slider_page").slider("option", "disabled", true );
...@@ -2161,13 +2164,13 @@ function flip() { ...@@ -2161,13 +2164,13 @@ function flip() {
$("#draw_canvas").attr('height', destRect.bottom - destRect.top) $("#draw_canvas").attr('height', destRect.bottom - destRect.top)
.attr('width', destRect.right - destRect.left) .attr('width', destRect.right - destRect.left)
.css('top', destRect.top + marginY - 1) .css('top', destRect.top + marginY )
.css('left',destRect.left + marginX - 1); .css('left',destRect.left + marginX );
$("#marker_canvas").attr('height', destRect.bottom - destRect.top) $("#marker_canvas").attr('height', destRect.bottom - destRect.top)
.attr('width', destRect.right - destRect.left) .attr('width', destRect.right - destRect.left)
.css('top', destRect.top + marginY - 1) .css('top', destRect.top + marginY )
.css('left',destRect.left + marginX - 1); .css('left',destRect.left + marginX );
isFirstLoad = false; isFirstLoad = false;
} }
...@@ -3264,9 +3267,9 @@ function showEditMemo(){ ...@@ -3264,9 +3267,9 @@ function showEditMemo(){
/*click copyMemo() */ /*click copyMemo() */
function copyMemo(){ function copyMemo(){
isCopyMemo = true; //isCopyMemo = true;
ClientData.memo_copyText(objEditMemo.text); ClientData.memo_copyText(objEditMemo.text);
disableControlsCopyMemo(); //disableControlsCopyMemo();
$("#pop_up_memo").hide(); $("#pop_up_memo").hide();
} }
......
...@@ -54,7 +54,7 @@ function OpenPopupText(posX, posY, content, dialogDiv, arrowDiv) { ...@@ -54,7 +54,7 @@ function OpenPopupText(posX, posY, content, dialogDiv, arrowDiv) {
// Ajust direction [ end ] // Ajust direction [ end ]
switch (direction) { switch (direction) {
case 0: left_dialog = left_arrow - dialogDiv.outerWidth(); case 0: left_dialog = left_arrow - dialogDiv.outerWidth();
top_dialog = top_arrow - 20; top_dialog = top_arrow - 20;
arrowDiv.css("border-color", "transparent transparent transparent #ccd"); arrowDiv.css("border-color", "transparent transparent transparent #ccd");
...@@ -62,7 +62,7 @@ function OpenPopupText(posX, posY, content, dialogDiv, arrowDiv) { ...@@ -62,7 +62,7 @@ function OpenPopupText(posX, posY, content, dialogDiv, arrowDiv) {
dialogDiv.css("-webkit-box-shadow", "-3px 3px 3px #777"); dialogDiv.css("-webkit-box-shadow", "-3px 3px 3px #777");
dialogDiv.css("box-shadow", "-3px 3px 3px #777"); dialogDiv.css("box-shadow", "-3px 3px 3px #777");
break; break;
case 1: left_dialog = left_arrow - dialogDiv.outerWidth(); case 1: left_dialog = left_arrow - dialogDiv.outerWidth();
top_dialog = top_arrow - dialogDiv.height() + 30; top_dialog = top_arrow - dialogDiv.height() + 30;
arrowDiv.css("border-color", "transparent transparent transparent #ccd"); arrowDiv.css("border-color", "transparent transparent transparent #ccd");
...@@ -70,7 +70,7 @@ function OpenPopupText(posX, posY, content, dialogDiv, arrowDiv) { ...@@ -70,7 +70,7 @@ function OpenPopupText(posX, posY, content, dialogDiv, arrowDiv) {
dialogDiv.css("-webkit-box-shadow", "-3px 3px 3px #777"); dialogDiv.css("-webkit-box-shadow", "-3px 3px 3px #777");
dialogDiv.css("box-shadow", "-3px 3px 3px #777"); dialogDiv.css("box-shadow", "-3px 3px 3px #777");
break; break;
case 2: left_dialog = left_arrow + 40; case 2: left_dialog = left_arrow + 24;
top_dialog = top_arrow - 20; top_dialog = top_arrow - 20;
arrowDiv.css("border-color", "transparent #ccd transparent transparent"); arrowDiv.css("border-color", "transparent #ccd transparent transparent");
...@@ -78,7 +78,7 @@ function OpenPopupText(posX, posY, content, dialogDiv, arrowDiv) { ...@@ -78,7 +78,7 @@ function OpenPopupText(posX, posY, content, dialogDiv, arrowDiv) {
dialogDiv.css("-webkit-box-shadow", "3px 3px 3px #777"); dialogDiv.css("-webkit-box-shadow", "3px 3px 3px #777");
dialogDiv.css("box-shadow", "3px 3px 3px #777"); dialogDiv.css("box-shadow", "3px 3px 3px #777");
break; break;
case 3: left_dialog = left_arrow + 40; case 3: left_dialog = left_arrow + 24;
top_dialog = top_arrow - dialogDiv.height() + 30; top_dialog = top_arrow - dialogDiv.height() + 30;
arrowDiv.css("border-color", "transparent #ccd transparent transparent"); arrowDiv.css("border-color", "transparent #ccd transparent transparent");
......
...@@ -106,93 +106,132 @@ function abapi(name, param, method, callback){ ...@@ -106,93 +106,132 @@ function abapi(name, param, method, callback){
avwCmsApiSync(ClientData.userInfo_accountPath(), name, method, param, callback, null); avwCmsApiSync(ClientData.userInfo_accountPath(), name, method, param, callback, null);
} }
///Render Content ///Render Content
function renderContent(id, text, division, type, order, from, to, cateid, grpid){ function renderContent(id, text, division, type, order, from, to, cateid, grpid) {
var params = { var params = {
sid: id, sid: id,
searchText: text, searchText: text,
searchDivision: division, searchDivision: division,
sortType: type, sortType: type,
sortOrder: order, sortOrder: order,
//recordFrom: from, //recordFrom: from,
//recordTo: to, //recordTo: to,
categoryId: cateid, categoryId: cateid,
groupId: grpid 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);
abapi('webContentList', params, 'POST', function (data) { if (viewdate != null && viewdate != 'undefined' && viewdate != '') {
$('#content-grid').html('');
$.each(data.contentList, function (i, post) { //assign thumbnail to array
arrayTemp.push({ contentId: post.contentId, thumbnail: formatStringBase64(post.contentThumbnail) });
var outputDate = formatDeliveryDate(post.contentDeliveryDate);
//renderViewDate
var viewdate = renderViewDate(post.contentId);
if (viewdate != null && viewdate != 'undefined' && viewdate != '') {
$('#content-grid').append(
'<section>'
+ ' <div class="cnt_section">'
+ ' <a class="img">'
+ ' <canvas height="105px" width="150px" class="home_canvas" id="content-thumbnail' + post.contentId + '" contentid="' + post.contentId + '">'
+ ' </canvas>'
+ ' <img 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"> </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>'
);
$('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();
}
});
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()); //Check if user has read this content or not.
i18nReplaceText(); 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 //Handle language
...@@ -728,6 +767,7 @@ function checkUserHasReadContent(contId, resourceVer, metaVer){ ...@@ -728,6 +767,7 @@ function checkUserHasReadContent(contId, resourceVer, metaVer){
ctx.drawImage(imgThumb, c.width/2 - resizeImg[0]/2, 0, resizeImg[0], resizeImg[1]); ctx.drawImage(imgThumb, c.width/2 - resizeImg[0]/2, 0, resizeImg[0], resizeImg[1]);
imgIconNew.onload = function(){ imgIconNew.onload = function(){
ctx.drawImage(imgIconNew, c.width/2 - resizeImg[0]/2, 0); ctx.drawImage(imgIconNew, c.width/2 - resizeImg[0]/2, 0);
showContentThumbnail(contId);
}; };
imgIconNew.src = DEFAULT_IMG_CONTENT_NEW; imgIconNew.src = DEFAULT_IMG_CONTENT_NEW;
}; };
...@@ -742,6 +782,7 @@ function checkUserHasReadContent(contId, resourceVer, metaVer){ ...@@ -742,6 +782,7 @@ function checkUserHasReadContent(contId, resourceVer, metaVer){
imgThumb.onload = function(){ imgThumb.onload = function(){
var resizeImg = resizeResourceThumbnail(imgThumb, c.width, c.height); var resizeImg = resizeResourceThumbnail(imgThumb, c.width, c.height);
ctx.drawImage(imgThumb, c.width/2 - resizeImg[0]/2, 0, resizeImg[0], resizeImg[1]); ctx.drawImage(imgThumb, c.width/2 - resizeImg[0]/2, 0, resizeImg[0], resizeImg[1]);
showContentThumbnail(contId);
}; };
imgThumb.src = returnThumbnail(contId); imgThumb.src = returnThumbnail(contId);
readFlg = true; readFlg = true;
...@@ -751,6 +792,7 @@ function checkUserHasReadContent(contId, resourceVer, metaVer){ ...@@ -751,6 +792,7 @@ function checkUserHasReadContent(contId, resourceVer, metaVer){
imgThumb.onload = function(){ imgThumb.onload = function(){
var resizeImg = resizeResourceThumbnail(imgThumb, c.width, c.height); var resizeImg = resizeResourceThumbnail(imgThumb, c.width, c.height);
ctx.drawImage(imgThumb, c.width/2 - resizeImg[0]/2, 0, resizeImg[0], resizeImg[1]); ctx.drawImage(imgThumb, c.width/2 - resizeImg[0]/2, 0, resizeImg[0], resizeImg[1]);
showContentThumbnail(contId);
imgIconNew.onload = function(){ imgIconNew.onload = function(){
ctx.drawImage(imgIconNew, c.width/2 - resizeImg[0]/2, 0); ctx.drawImage(imgIconNew, c.width/2 - resizeImg[0]/2, 0);
}; };
...@@ -772,6 +814,7 @@ function checkUserHasReadContent(contId, resourceVer, metaVer){ ...@@ -772,6 +814,7 @@ function checkUserHasReadContent(contId, resourceVer, metaVer){
imgThumb.onload = function(){ imgThumb.onload = function(){
var resizeImg = resizeResourceThumbnail(imgThumb, c.width, c.height); var resizeImg = resizeResourceThumbnail(imgThumb, c.width, c.height);
ctx.drawImage(imgThumb, c.width/2 - resizeImg[0]/2, 0, resizeImg[0], resizeImg[1]); ctx.drawImage(imgThumb, c.width/2 - resizeImg[0]/2, 0, resizeImg[0], resizeImg[1]);
showContentThumbnail(contId);
imgIconEdit.onload = function(){ imgIconEdit.onload = function(){
ctx.drawImage(imgIconEdit, c.width/2 - resizeImg[0]/2, 0); ctx.drawImage(imgIconEdit, c.width/2 - resizeImg[0]/2, 0);
}; };
...@@ -793,6 +836,7 @@ function checkUserHasReadContent(contId, resourceVer, metaVer){ ...@@ -793,6 +836,7 @@ function checkUserHasReadContent(contId, resourceVer, metaVer){
imgThumb.onload = function(){ imgThumb.onload = function(){
var resizeImg = resizeResourceThumbnail(imgThumb, c.width, c.height); var resizeImg = resizeResourceThumbnail(imgThumb, c.width, c.height);
ctx.drawImage(imgThumb, c.width/2 - resizeImg[0]/2, 0, resizeImg[0], resizeImg[1]); ctx.drawImage(imgThumb, c.width/2 - resizeImg[0]/2, 0, resizeImg[0], resizeImg[1]);
showContentThumbnail(contId);
imgIconEdit.onload = function(){ imgIconEdit.onload = function(){
ctx.drawImage(imgIconEdit, c.width/2 - resizeImg[0]/2, 0); ctx.drawImage(imgIconEdit, c.width/2 - resizeImg[0]/2, 0);
}; };
...@@ -820,6 +864,7 @@ function drawEditImage(id){ ...@@ -820,6 +864,7 @@ function drawEditImage(id){
img.onload = function(){ img.onload = function(){
var resizeImg = resizeResourceThumbnail(img, c.width, c.height); var resizeImg = resizeResourceThumbnail(img, c.width, c.height);
ctx.drawImage(img, c.width/2 - resizeImg[0]/2, 0, resizeImg[0], resizeImg[1]); ctx.drawImage(img, c.width/2 - resizeImg[0]/2, 0, resizeImg[0], resizeImg[1]);
showContentThumbnail(id);
}; };
} }
...@@ -1031,7 +1076,8 @@ function refreshSortTypeOrder(){ ...@@ -1031,7 +1076,8 @@ function refreshSortTypeOrder(){
//refresh GridView //refresh GridView
function refreshGrid(){ function refreshGrid(){
$('#content-grid').html(''); //$('#content-grid').html('');
$('#content-grid').empty();
$('.pageNumControl').css('visibility','hidden'); $('.pageNumControl').css('visibility','hidden');
} }
...@@ -1106,9 +1152,10 @@ function addReadContentToArray(strContentId, strResourceVersion, strMetaVersion, ...@@ -1106,9 +1152,10 @@ function addReadContentToArray(strContentId, strResourceVersion, strMetaVersion,
} }
} }
function showContentThumbnail(){ function showContentThumbnail(conid) {
$('img.home_canvas').fadeOut('slow',function(){
$('canvas.home_canvas').fadeIn('slow'); $('img#imgloading'+conid).fadeOut('slow',function(){
$('canvas#content-thumbnail'+conid).fadeIn('slow');
}); });
} }
...@@ -1314,35 +1361,39 @@ function sortByTitleKanaDesc(){ ...@@ -1314,35 +1361,39 @@ function sortByTitleKanaDesc(){
function renderContentAfterSort(contentSortArr){ function renderContentAfterSort(contentSortArr){
refreshGrid(); refreshGrid();
var htmlTemp = "";
$.each(contentSortArr, function(i, post){ for(var i = 0; i < contentSortArr.length; i++) {
post = contentSortArr[i];
//$.each(contentSortArr, function(i, post){
var outputDeliveryDate = formatDeliveryDate(post.deliverydate); var outputDeliveryDate = formatDeliveryDate(post.deliverydate);
$('#content-grid').append( //$('#content-grid').append(
'<section>' htmlTemp += '<section>'
+' <div class="cnt_section">' + ' <div class="cnt_section">'
+' <a class="img">' + ' <a class="img">'
+' <canvas height="105px" width="150px" class="home_canvas" id="content-thumbnail'+post.contentid+'" contentid="'+post.contentid+'">' + ' <canvas style="display:none" height="105px" width="150px" class="home_canvas" id="content-thumbnail' + post.contentid + '" contentid="' + post.contentid + '">'
+' </canvas>' + ' </canvas>'
+' <img src="./img/data_loading.gif" height="25px" class="home_canvas" width="25px"/>' + ' <img id="imgloading'+ post.contentid +'" src="./img/data_loading.gif" height="25px" class="home_canvas" width="25px"/>'
+' </a>' + ' </a>'
+' <div class="text">' + ' <div class="text">'
+' <a id="title'+post.contentid+'" class="dialog name" contentid="'+post.contentid+'">'+ truncate(htmlEncode(post.contenttitle), 25)+'</a>' + ' <a id="title' + post.contentid + '" class="dialog name" contentid="' + post.contentid + '">' + truncate(htmlEncode(post.contenttitle), 25) + '</a>'
+' <div class="info">' + ' <div class="info">'
+' <ul class="date">' + ' <ul class="date">'
+' <li><span class="lang" lang="txtPubDt"> </span> : '+outputDeliveryDate +'</li>' + ' <li><span class="lang" lang="txtPubDt">' + i18nText("txtPubDt") + '</span> : ' + outputDeliveryDate + '</li>'
+' <li><span class="lang" lang="txtViewDt"> </span>:<span id="lblVdate'+post.contentid+'"> </span></li>' + ' <li><span class="lang" lang="txtViewDt">' + i18nText("txtViewDt") + '</span>:<span id="lblVdate' + post.contentid + '"> </span></li>'
+' </ul>' + ' </ul>'
+' <ul class="pic">' + ' <ul class="pic">'
+' <li><img src="'+DEFAULT_IMG_OPTION_MEMO+'" id="imgMemo'+post.contentid+'" class="sticker" /></li>' + ' <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><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>' + ' <li><a class="read lang button-details" contentid="' + post.contentid + '" lang="txtRead">' + i18nText("txtRead") + '</a></li>'
+' </ul>' + ' </ul>'
+' </div>' + ' </div>'
+' </div>' + ' </div>'
+' </div>' + ' </div>'
+'</section>' + '</section>'
); //);
;
/*
$('canvas.home_canvas').hide(); $('canvas.home_canvas').hide();
$('img.home_canvas').show(); $('img.home_canvas').show();
...@@ -1357,10 +1408,34 @@ function renderContentAfterSort(contentSortArr){ ...@@ -1357,10 +1408,34 @@ function renderContentAfterSort(contentSortArr){
$('#lblVdate' + post.contentid).html(viewdate); $('#lblVdate' + post.contentid).html(viewdate);
showContentThumbnail(); //showContentThumbnail();
i18nReplaceText(); 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){ function formatOriginalPublishDate(date){
......
...@@ -102,9 +102,9 @@ ...@@ -102,9 +102,9 @@
<label><input type=radio name="firstview" id="rdoOpt001" checked="checked" value="bookshelf" checked><label for="rdoOpt001" id="Label1" lang="txtHondana" class="lang">本棚</label></label>  <label><input type=radio name="firstview" id="rdoOpt001" checked="checked" value="bookshelf" checked><label for="rdoOpt001" id="Label1" lang="txtHondana" class="lang">本棚</label></label> 
<label><input type=radio name="firstview" id="rdoOpt0011" value="booklist"><label for="rdoOpt0011" id="Label2" lang="txtList" class="lang">リスト</label></label> <label><input type=radio name="firstview" id="rdoOpt0011" value="booklist"><label for="rdoOpt0011" id="Label2" lang="txtList" class="lang">リスト</label></label>
</li> </li>
<li><label><input type=checkbox name="repeat" value="repeat" class="chkbx" id="chkOpt002" checked="checked" /><label for="chk1" id="txtOpt002" lang="txtOpt002" class="lang">動画、音楽繰り返し</label></label></li> <li><label><input type=checkbox name="repeat" value="repeat" class="chkbx" id="chkOpt002" checked="checked" /><label for="chkOpt002" id="txtOpt002" lang="txtOpt002" class="lang">動画、音楽繰り返し</label></label></li>
<li><label><input type=checkbox name="marking" value="marking" class="chkbx" id="chkOpt003" checked="checked" /><label id="lblOpt003" for="chkOpt003" lang="txtOpt003" class="lang">マーキング(コンテンツを開いた時に表示する)</label></label><span class="notice lang" lang="txtOpt004" >※コンテンツを開いた時に表示する</span></li> <li><label><input type=checkbox name="marking" value="marking" class="chkbx" id="chkOpt003" checked="checked" /><label id="lblOpt003" for="chkOpt003" lang="txtOpt003" class="lang">マーキング(コンテンツを開いた時に表示する)</label></label><span class="notice lang" lang="txtOpt004" >※コンテンツを開いた時に表示する</span></li>
<li><label><input type=checkbox name="confirmClose" value="confirmClose" class="chkbx" id="chkOpt005" checked="checked" /><label for="chk1" id="txtOpt005" lang="txtOpt005" class="lang">タブ・ブラウザ終了・F5時のアラートが表示する</label></label></li> <li><label><input type=checkbox name="confirmClose" value="confirmClose" class="chkbx" id="chkOpt005" checked="checked" /><label for="chkOpt005" id="txtOpt005" lang="txtOpt005" class="lang">タブ・ブラウザ終了・F5時のアラートが表示する</label></label></li>
</ul> </ul>
<h3 id="txtBkResCap" lang="txtBkResCap" class="lang">サーバにバックアップ/リストア</h3> <h3 id="txtBkResCap" lang="txtBkResCap" class="lang">サーバにバックアップ/リストア</h3>
<p class="logout_backup"><label><input type=checkbox name="backup" value="backup" id="chkOptBkCfm" checked="checked"><label id="txtOptBkCfm" for="chkOptBkCfm" lang="txtOptBkCfm" class="lang">毎回ログアウトの時、バックアップするかどうかは必ず確認する</label></label></p> <p class="logout_backup"><label><input type=checkbox name="backup" value="backup" id="chkOptBkCfm" checked="checked"><label id="txtOptBkCfm" for="chkOptBkCfm" lang="txtOptBkCfm" class="lang">毎回ログアウトの時、バックアップするかどうかは必ず確認する</label></label></p>
......
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