Commit 6865932b by Motohisa Nakano

20121217-3

parent 5224d11b
......@@ -1857,15 +1857,11 @@ function unlockFunction(inputPass) {
errorCode = JSON.parse(xhr.responseText);
}
else {
// System error
showSystemError();
errorCode = { errorMessage: "E001" };
}
});
// Check error
if (avwHasError()) {
return;
}
if (result == true) {
if (window.onUnlock) {
onUnlock();
......
......@@ -64,7 +64,7 @@
"dspBkCancel":"Logout",
"txtSearchResult":"Result",
"dspHome":"Home",
"txtLoginUser":"(Ver.20121214-1)User:",
"txtLoginUser":"(Ver.20121217-3)User:",
"txtAll":"All",
"txtMkgSize":"Size",
"txtMkgS":"S",
......@@ -119,5 +119,6 @@
"txtMemoNew":"New",
"txtMemoPaste":"Paste",
"txtMemoClear":"Clear",
"txtMemo":"Memo"
"txtMemo":"Memo",
"msgBGMPlayConfirm":"EN:このコンテンツはBGMが流れるようになっています。BGMを再生してもよろしいですか?"
}
......@@ -64,7 +64,7 @@
"dspBkCancel":"バックアップせずにログアウト",
"txtSearchResult":"検索結果",
"dspHome":"ホーム",
"txtLoginUser":"(Ver.20121214-1)ログイン中:",
"txtLoginUser":"(Ver.20121217-3)ログイン中:",
"txtAll":"すべて",
"txtMkgSize":"太さ",
"txtMkgS":"小",
......@@ -119,5 +119,6 @@
"txtMemoNew":"新規",
"txtMemoPaste":"貼り付け",
"txtMemoClear":"クリア",
"txtMemo":"メモ"
"txtMemo":"メモ",
"msgBGMPlayConfirm":"このコンテンツはBGMが流れるようになっています。BGMを再生してもよろしいですか?"
}
......@@ -64,7 +64,7 @@
"dspBkCancel":"로그아웃",
"txtSearchResult":"검색 결과",
"dspHome":"홈",
"txtLoginUser":"(Ver.20121214-1)로그인 중:",
"txtLoginUser":"(Ver.20121217-3)로그인 중:",
"txtAll":"전체",
"txtMkgSize":"두께",
"txtMkgS":"소",
......@@ -119,5 +119,6 @@
"txtMemoNew":"신규",
"txtMemoPaste":"붙여 넣기",
"txtMemoClear":"클리어",
"txtMemo":"메모"
"txtMemo":"메모",
"msgBGMPlayConfirm":"KO:このコンテンツはBGMが流れるようになっています。BGMを再生してもよろしいですか?"
}
......@@ -40,7 +40,7 @@
<script src="./js/contentview_Marking.js"></script>
<script src="./js/contentview_PopupText.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/viewer.css" />
......@@ -141,7 +141,10 @@
var isPressLeftMouse = false;
var isMoveOutDrawCanvas = false;
var typeSelectMemo = 0;
var arrThumbnailsLoaded = [];
var arrThumbnailsLoaded = [];
var isSendingData = true;
/* get Json stored content info */
function getJsonContentInfo(){
avwGrabContentPageImage(ClientData.userInfo_accountPath(),
......@@ -1005,7 +1008,7 @@
isDrawing = false;
/* 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();
......@@ -1235,19 +1238,29 @@
// }
// }
$('#firstpage').unbind('click');
$('#prevpage').unbind('click');
$('#nextpage').unbind('click');
$('#lastpage').unbind('click');
$('#zoomfit').unbind('click');
$('#firstpage').unbind('click');
$('#firstpage').removeClass();
$('#firstpage').addClass('begin_off');
$('#prevpage').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').removeClass();
$('#zoomin').addClass('expansion_off');
$('#zoomout').unbind('click');
$('#zoomout').removeClass();
$('#zoomout').addClass('reduction_off');
if(avwUserEnvObj.os != "android"){
if(avwUserEnvObj.os != "android"){
$("#slider_page").slider("option", "disabled", true );
}
......@@ -1255,22 +1268,7 @@
$('#button_next_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 */
......@@ -1565,120 +1563,69 @@
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 */
function handleAPIWebContentPage(dataJson,pos){
var bmList = [];
bmList = ClientData.BookMarkData();
/* create data on dialog */
//$('#divListBookmark').append('<table id="tblBookmarkList" class="tblbookmarklist">');
var sPageNo = '';
for(var nIndex = 0; nIndex < bmList.length; nIndex ++){
if(bmList[nIndex].contentid == contentID){
if (checkDataLoaded(bmList[nIndex].pageNo) == false){ /* check if data not loaded */
if(dataJson.pages.length > 0){
var contentPage = dataJson.pages;
for(var nIndexJson = 0; nIndexJson < contentPage.length; nIndexJson++){
if(contentPage[nIndexJson].pageNo == bmList[nIndex].pageNo){
sPageNo += contentPage[nIndexJson].pageNo + ',';
break;
}
}
}
}
}
}
bmList = getBookMarkListByContentID();
var dataStored = arrThumbnailsLoaded;
var sPageNo = [];
var nIndexBookMark = -1;
var lstPageNoBookMark = [];
$('#bookmarkBoxHdBM').children().remove();
$('#bookmarkBoxHdBM').html('<a id="bookmarkClosing" class="delete" > </a>');
$("#bookmarkClosing").click(closeBookmarkBox);
$('#bookmarkBoxHdBM').append(i18nText('txtShioriCtnLs'));
if(sPageNo != ''){
sPageNo = sPageNo.substring(0,sPageNo.length - 1);
$('#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();
/* create loading on dialog */
$('#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;
}
}
$('#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();
for(var nIndex = 0; nIndex < bmList.length; nIndex ++){
nIndexBookMark = -1;
var contentPage = dataJson.pages;
for(var nIndexJson = 0; nIndexJson < contentPage.length; nIndexJson++){
if(contentPage[nIndexJson].pageNo == bmList[nIndex].pageNo){
nIndexBookMark = nIndexJson;
break;
}
}
if(isExistPage == true){ /* exist page */
$('#divListBookmark').append(
' <li id="'+changePageNo(bmList[nIndex].pageNo)+'">' +
' <img class="imgbox" src="' +sImage+ '"/>' +
' <span class="mdltext">' +
i18nText('txtPage') + (changePageNo(bmList[nIndex].pageNo) + 1) + '<br /> ' +
truncate(sTitle,20) +
' </span>' +
' </li>'
);
//Resize Image
if(nIndexBookMark != -1){ /* page exist */
var nStored = checkDataLoaded(bmList[nIndex].pageNo,dataStored);
if( nStored != -1){ /* data loaded */
$('#divListBookmark').append(
' <li id="'+changePageNo(bmList[nIndex].pageNo)+'">' +
' <img id="img_bookmark_' +bmList[nIndex].pageNo + '" class="imgbox" src="' +formatStringBase64(dataStored[nStored].pageThumbnail)+ '"/>' +
' <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(){
......@@ -1696,36 +1643,149 @@
}
};
imgTemp.src = sImage;
}else{ /* not exist page */
$('#divListBookmark').append(
' <li id="'+changePageNo(bmList[nIndex].pageNo)+'">' +
' <span class="mdltext">' +
imgTemp.src = formatStringBase64(dataStored[nStored].pageThumbnail);
}else{ /* data not loaded*/
$('#divListBookmark').append(
' <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>' +
' </li>' +
' <li>' +
' <span class="mdltext">' +
' <span style="color:red">' +i18nText('msgShioriDeleted')+ '</span>' +
' </span>' +
' </li>'
);
}
}
}
' <span>' + i18nText('txtPage') + bmList[nIndex].pageNo + '</span> <br /> ' +
' </span>' +
' </li>' +
' <li>' +
' <span class="mdltext">' +
' <span style="color:red">' +i18nText('msgShioriDeleted')+ '</span>' +
' </span>' +
' </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 */
function checkDataLoaded(nPageNo){
var isExist = false;
for(var n = 0; n < arrThumbnailsLoaded.length; n ++){
if(arrThumbnailsLoaded[n].pageNo == nPageNo){
isExist = true;
function checkDataLoaded(nPageNo,arrData){
var nIndex = -1;
for(var n = 0; n < arrData.length; n ++){
if(arrData[n].pageNo == nPageNo){
nIndex = n;
break;
}
}
return isExist;
return nIndex;
}
/* get data load*/
......@@ -1774,6 +1834,7 @@
/* event close list bookmark box */
function closeBookmarkBox(){
$("#divListBookmark").hide();
isSendingData = false;
$('#boxBookMark').css('display' , 'none');
isDisplayBookMarkList = false;
......@@ -2059,20 +2120,51 @@
}
/*event click show copy text */
function showCopyText(e){
isDisplayCopyText = true;
//change class
$('#copytext').removeClass();
$('#copytext').addClass('copy_hover');
/* display dialog overlay */
$("#overlay").show();
var array = [e.pageX, e.pageY];
var contentPage = dataWebContentPage.pages;
handleCopyTextData(contentPage,array)
function showCopyText(e) {
/* display dialog overlay */
if (avwUserEnvObj.os == "android") {
copyText();
} else {
isDisplayCopyText = true;
//change class
$('#copytext').removeClass();
$('#copytext').addClass('copy_hover');
$("#overlay").show();
var array = [e.pageX, e.pageY];
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 */
function closeCopyTextBox(){
isDisplayCopyText = false;
......@@ -2252,6 +2344,7 @@
/* event close searching result box */
function closeSearchingBox(){
isSendingData = false;
$("#divSearchResult").hide();
$('#boxSearching').css('display' , 'none');
......@@ -2286,27 +2379,21 @@
var pos = [w, marginY];
if($('#txtSearch').val() != '')
{
var dataStored = arrThumbnailsLoaded;
var contentPage = dataWebContentPage.pages;
var myRegExp = new RegExp($('#txtSearch').val());
var sPageNo = '';
var sPageNo = [];
var lstPageNo = [];
var isExistData = false;
//search content
for(var nIndex = 0; nIndex < contentPage.length; nIndex++){
if(myRegExp.test(contentPage[nIndex].pageText)){
if (checkDataLoaded(contentPage[nIndex].pageNo) == false){ /* check if data not loaded */
//searchResult.push(contentPage[nIndex]);
sPageNo += contentPage[nIndex].pageNo + ',';
}else{
isExistData = true;
}
if(myRegExp.test(contentPage[nIndex].pageText)){
//searchResult.push(contentPage[nIndex]);
sPageNo.push(contentPage[nIndex]);
}
}
if(sPageNo != ''){
sPageNo = sPageNo.substring(0,sPageNo.length - 1);
//title start
}
if(sPageNo.length > 0){
//title start
$('#bookmarkBoxHdSearching').children().remove();
$('#bookmarkBoxHdSearching').html('<a id="searchingResultClosing" class="delete" > </a>');
$("#searchingResultClosing").click(closeSearchingBox);
......@@ -2319,42 +2406,114 @@
$('#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)});
$("#divSearchResult").offset({left:pos[0],top:(pos[1] + $('#bookmarkBoxHdSearching').height() - 2)});
/* create loading on dialog */
$('#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)});
$('#divSearchResult').children().remove();
loadDataToDialogSearch(arrThumbnailsLoaded)
}else{
for(var i = 0; i < sPageNo.length; i ++){
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').append('<span class="last">' + i18nText('txtNoSearchResult') + '</span>');
......@@ -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 */
function loadDataToDialogSearch(searchResultTemp){
......@@ -2453,9 +2656,12 @@
function nextPage_click() {
if(getContent().hasNextPage()) {
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(),
{contentId: contentID,sid:ClientData.userInfo_sid(),pageNo:getPageIndex() + 2},
function(data){
......@@ -2520,6 +2726,9 @@
$('#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);
avwGrabContentPageImage(ClientData.userInfo_accountPath(),
{contentId: contentID,sid:ClientData.userInfo_sid(),pageNo:getPageIndex()},
......@@ -2549,6 +2758,9 @@
$('#divImageLoading').css('display','block');
// Clear canvas main
context_main.clearRect(0, 0, context_main.width, context_main.height);
avwGrabContentPageImage(ClientData.userInfo_accountPath(),
{contentId: contentID,sid:ClientData.userInfo_sid(),pageNo:1},
function(data){
......@@ -2577,6 +2789,9 @@
$('#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);
avwGrabContentPageImage(ClientData.userInfo_accountPath(),
{contentId: contentID,sid:ClientData.userInfo_sid(),pageNo:totalPage},
......@@ -2609,8 +2824,11 @@
if(page_index != getContent().pageIndex){
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(),
{contentId: contentID,sid:ClientData.userInfo_sid(),pageNo:page_index + 1},
......@@ -3163,16 +3381,15 @@
/* tablet [end]*/
}
function ev_canvas(ev) {
if (ev.offsetX || ev.offsetX == 0) { // Opera
ev._x = ev.offsetX;
ev._y = ev.offsetY;
} else if (ev.layerX || ev.layerX == 0) { // Firefox
ev._x = ev.layerX;
ev._y = ev.layerY;
}
function ev_canvas (ev) {
if (ev.offsetX || ev.offsetX == 0) { // Opera
ev._x = ev.offsetX;
ev._y = ev.offsetY;
} else if (ev.layerX || ev.layerX == 0) { // Firefox
ev._x = ev.layerX;
ev._y = ev.layerY;
}
// Call the event handler of the tool.
var func = tool[ev.type];
......@@ -3303,22 +3520,22 @@ function oldContent_Back(){
$("#draw_canvas").attr('height', destRect.bottom - destRect.top)
.attr('width', destRect.right - destRect.left)
.css('top', destRect.top)
.css('left',destRect.left + marginX - 1);
.css('left',destRect.left + marginX);
$("#marker_canvas").attr('height', destRect.bottom - destRect.top)
.attr('width', destRect.right - destRect.left)
.css('top', destRect.top)
.css('left',destRect.left + marginX - 1);
.css('left',destRect.left + marginX);
}else{
$("#draw_canvas").attr('height', destRect.bottom - destRect.top)
.attr('width', destRect.right - destRect.left)
.css('top', destRect.top + marginY - 1)
.css('left',destRect.left + marginX - 1);
.css('top', destRect.top + marginY)
.css('left',destRect.left + marginX);
$("#marker_canvas").attr('height', destRect.bottom - destRect.top)
.attr('width', destRect.right - destRect.left)
.css('top', destRect.top + marginY - 1)
.css('left',destRect.left + marginX - 1);
.css('top', destRect.top + marginY)
.css('left',destRect.left + marginX);
}
}
......@@ -3545,8 +3762,11 @@ function oldContent_Back(){
function changePageWithoutSlide(pageMove){
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(),
{contentId: contentID,sid:ClientData.userInfo_sid(),pageNo:pageMove + 1},
function(data){
......@@ -3709,86 +3929,110 @@ function oldContent_Back(){
sizingScreen();
/* close dialog popuptext */
closeDialogResize();
});
$(document).ajaxComplete(function(){
/*Init Page */
nAjaxLoad ++;
if(nAjaxLoad == 7){
/* handle from bookmark page */
//handleFromBookMarkPage();
/* check move content */
if(ClientData.bookmark_pageNo()){
//changePage(changePageNo(ClientData.bookmark_pageNo()));
changePageWithoutSlide(changePageNo(ClientData.bookmark_pageNo()));
ClientData.bookmark_pageNo(null)
}else if(ClientData.common_prePageNo()){
/* handle from jump content */
handleFromJumpContent();
}else if (ClientData.IsJumpBack() == true){
/* handle back */
oldContent_Back();
}else{
if(getPageIndex() == 0){
getContent().setPageImages(totalPage, pageImages)
});
$(document).ajaxComplete(function () {
/*Init Page */
nAjaxLoad++;
if (nAjaxLoad == 7) {
/* handle from bookmark page */
//handleFromBookMarkPage();
/* check move content */
if (ClientData.bookmark_pageNo()) {
//changePage(changePageNo(ClientData.bookmark_pageNo()));
changePageWithoutSlide(changePageNo(ClientData.bookmark_pageNo()));
ClientData.bookmark_pageNo(null)
} else if (ClientData.common_prePageNo()) {
/* handle from jump content */
handleFromJumpContent();
} else if (ClientData.IsJumpBack() == true) {
/* handle back */
oldContent_Back();
} else {
if (getPageIndex() == 0) {
getContent().setPageImages(totalPage, pageImages)
.setPageObjects(pageObjects)
.setUpPage(0);
/* set pageTitle*/
if(dataPageTitle[0]){
if(dataPageTitle[0] != ''){
document.title = contentName + '_' + dataPageTitle[0] + ' | ' + i18nText('sysAppTitle');
}else{
document.title = contentName + ' | ' + i18nText('sysAppTitle');
}
}else{
document.title = contentName + ' | ' + i18nText('sysAppTitle');
}
/* handle slider bar */
handleSliderBar();
}
}
/* window resize event */
$(window).resize(function() {
resizeScreen();
isChangeSizeScreen = false;
/* change position dialog */
changePosDialog()
/* close dialog popuptext */
closeDialogResize();
});
/* 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;
}
});
/* set pageTitle*/
if (dataPageTitle[0]) {
if (dataPageTitle[0] != '') {
document.title = contentName + '_' + dataPageTitle[0] + ' | ' + i18nText('sysAppTitle');
} else {
document.title = contentName + ' | ' + i18nText('sysAppTitle');
}
} else {
document.title = contentName + ' | ' + i18nText('sysAppTitle');
}
/* handle slider bar */
handleSliderBar();
}
}
if (isTouchDevice() == true) {
if (avwUserEnvObj.os == "android") {
startDetectZoom({ time: 500,
callbackFunction: function (oldRatio, newRatio, oldW, oldH, newW, newH) {
// Adjust position for toolbar and footer bar
var top = window.innerHeight - $("#footer_toolbar_1").height();
$("#header_toolbar").css("width", window.innerWidth);
$("#footer_toolbar_1").css("top", top + "px");
$("#footer_toolbar_2").css("top", top + "px");
}
});
}
}
/* window resize event */
$(window).resize(function () {
if (isTouchDevice() == true) {
if (avwUserEnvObj.os == "android") {
// Adjust position for toolbar and footer bar
var top = window.innerHeight - $("#footer_toolbar_1").height();
$("#header_toolbar").css("width", window.innerWidth);
$("#footer_toolbar_1").css("top", top + "px");
$("#footer_toolbar_2").css("top", top + "px");
}
}
resizeScreen();
isChangeSizeScreen = false;
/* change position dialog */
changePosDialog()
/* close dialog popuptext */
closeDialogResize();
});
/* 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 () {
......@@ -3915,12 +4159,12 @@ function oldContent_Back(){
</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">
<a id="memoClosing" class="delete" > </a>
<label class="lang" lang = "txtMemoMenu" ></label>
</h1>
<ul id="divAddMemo" class="bookmarkBoxBody_on" style="height:151px">
<ul id="divAddMemo" class="bookmarkBoxBody_on" style="height:156px">
<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 />
......
<!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 {
z-index: 102;
font-family: Verdana;
font-size: 10pt;
border-radius: 10px;
border-radius: 10px;
z-index: 101;
}
.popuptext_arrow {
......
......@@ -38,6 +38,7 @@
html,body{
width:100%;
height:100%;
}
body{
......@@ -51,8 +52,7 @@ body{
#wrapper {
max-width:none;
min-width:1000px;
height:100%;
min-width:1000px;
}
......@@ -74,8 +74,7 @@ header{
max-width:none;
min-width:1000px;
height:60px;
position:absolute;
width:100%;
/*position:absolute;*/
}
/*ヘッダー左カラム*/
......@@ -944,6 +943,7 @@ aside.bookmarkBox li .imgbox{
border:solid 1px #444;
background:#ccc;
margin:0 4px 0 0;
}
aside.bookmarkBox li .mdltext{
......@@ -1067,15 +1067,15 @@ aside.bookmarkBox .last{
.transition .last {width:56px;background-position:-174px 0;}
.transition a:hover.last {background-position:-174px -33px;}
.transition .begin_device {width:59px;background-position:0 -33px;}
.transition .prev_device {width:57px;background-position:-59px -33px;}
.transition .next_device {width:58px;background-position:-116px -33px;}
.transition .last_device {width:56px;background-position:-174px -33px;}
.transition .begin_device {width:59px;background-position:0 0;}
.transition .prev_device {width:57px;background-position:-59px 0;}
.transition .next_device {width:58px;background-position:-116px 0;}
.transition .last_device {width:56px;background-position:-174px 0;}
.transition .begin_off {width:59px;background-position:0 0;}
.transition .prev_off {width:57px;background-position:-59px 0;}
.transition .next_off {width:58px;background-position:-116px 0;}
.transition .last_off {width:56px;background-position:-174px 0;}
.transition .begin_off {width:59px;background-position:0 -66px;}
.transition .prev_off {width:57px;background-position:-59px -66px;}
.transition .next_off {width:58px;background-position:-116px -66px;}
.transition .last_off {width:56px;background-position:-174px -66px;}
/*----------------------------*/
......@@ -1111,13 +1111,13 @@ aside.bookmarkBox .last{
.sizing .reduction {width:56px;background-position:-117px 0;}
.sizing a:hover.reduction {background-position:-117px -33px;}
.sizing .expansion_device {width:59px;background-position:0 -33px;}
.sizing .fit_device {width:58px;background-position:-59px -33px;}
.sizing .reduction_device {width:56px;background-position:-117px -33px;}
.sizing .expansion_device {width:59px;background-position:0 0;}
.sizing .fit_device {width:58px;background-position:-59px 0;}
.sizing .reduction_device {width:56px;background-position:-117px 0;}
.sizing .expansion_off {width:59px;background-position:0 0;}
.sizing .fit_off {width:58px;background-position:-59px 0;}
.sizing .reduction_off {width:56px;background-position:-117px 0;}
.sizing .expansion_off {width:59px;background-position:0 -66px;}
.sizing .fit_off {width:58px;background-position:-59px -66px;}
.sizing .reduction_off {width:56px;background-position:-117px -66px;}
/*----------------------------*/
/* 14. toolbar setting */
/*----------------------------*/
......
......@@ -842,7 +842,8 @@ function SyncContent() {
}
}
else {
// Skip this case
arrBookmarks.splice(nIndex, 1);
ClientData.isChangedBookmark(true);
}
}
......
......@@ -836,7 +836,8 @@ Transition.prototype.flipNextPage = function() {
var w = $('#main').attr('width');
removeObject();
if(getContent().hasNextPage()) {
if(getContent().hasNextPage()) {
context_main.clearRect(0, 0, canvas_main.width, canvas_main.height);
$('#main').animate(
{left : '-' + w + 'px'},
{
......@@ -886,6 +887,7 @@ Transition.prototype.flipPreviousPage = function() {
removeObject();
if(getContent().hasPreviousPage()) {
context_main.clearRect(0, 0, canvas_main.width, canvas_main.height);
$('#main').animate(
{left : w + 'px'},
{
......@@ -934,6 +936,7 @@ Transition.prototype.flipToPage = function(index) {
/* init image had draw */
initDisplayMarking();
}else if(index < getContent().pageIndex){
context_main.clearRect(0, 0, canvas_main.width, canvas_main.height);
removeObject();
$('#main').animate(
{left : w + 'px'},
......@@ -971,8 +974,9 @@ Transition.prototype.flipToPage = function(index) {
}
}
);
}else{
removeObject();
}else{
context_main.clearRect(0, 0, canvas_main.width, canvas_main.height);
removeObject();
$('#main').animate(
{left : '-' + w + 'px'},
{
......@@ -1026,6 +1030,7 @@ function removeObject(){
$("#boxIndex").hide();
$("#boxBookMark").hide();
$('#pop_up_memo').hide();
isSendingData = false;
isDisplayBookMarkList = false;
......@@ -1145,22 +1150,27 @@ function onClick_CanvasMain(event){
posXPopupMemo = event.pageX;
posYPopupMemo = event.pageY;
if((event.pageX - marginX) >= destRect.left && (event.pageX - marginX) <= destRect.right){
if(isCopyMemo == true){
CopyMemo(objEditMemo.text,contentID,changePageIndex(getPageIndex()),$('#divDialogMemo'),event.pageX,event.pageY,function(){
if((event.pageX - marginX) >= destRect.left && (event.pageX - marginX) <= destRect.right){
/* click add memo */
if(ClientData.IsAddingMemo() == true){
if(!ClientData.memo_copyText()){
AddMemo(contentID,changePageIndex(getPageIndex()),$('#divDialogMemo'),event.pageX,event.pageY,function(){
//set flag change memo
ClientData.isChangedMemo(true);
ClientData.isChangedMemo(true);
ClientData.IsAddingMemo(false);
/* refresh draw memo */
drawMemoOnScreen();
});
}else{
/* click add memo */
if(ClientData.IsAddingMemo() == true){
if(!ClientData.memo_copyText()){
AddMemo(contentID,changePageIndex(getPageIndex()),$('#divDialogMemo'),event.pageX,event.pageY,function(){
drawMemoOnScreen();
//change image
$('#imgaddmemo').removeClass();
$('#imgaddmemo').addClass('memoAdd');
});
}else{
if(typeSelectMemo == 1){ /* add new */
AddMemo(contentID,changePageIndex(getPageIndex()),$('#divDialogMemo'),posXPopupMemo,posYPopupMemo,function(){
//set flag change memo
ClientData.isChangedMemo(true);
ClientData.IsAddingMemo(false);
......@@ -1170,129 +1180,114 @@ function onClick_CanvasMain(event){
//change image
$('#imgaddmemo').removeClass();
$('#imgaddmemo').removeClass();
$('#imgaddmemo').addClass('memoAdd');
});
}else{
if(typeSelectMemo == 1){ /* add new */
AddMemo(contentID,changePageIndex(getPageIndex()),$('#divDialogMemo'),posXPopupMemo,posYPopupMemo,function(){
}else if(typeSelectMemo == 2){ /* copy */
CopyMemo(ClientData.memo_copyText(),contentID,changePageIndex(getPageIndex()),$('#divDialogMemo'),posXPopupMemo,posYPopupMemo,function(){
//set flag change memo
ClientData.isChangedMemo(true);
ClientData.IsAddingMemo(false);
ClientData.isChangedMemo(true);
ClientData.IsAddingMemo(false);
/* refresh draw memo */
drawMemoOnScreen();
drawMemoOnScreen();
//change image
$('#imgaddmemo').removeClass();
$('#imgaddmemo').addClass('memoAdd');
});
}else if(typeSelectMemo == 2){ /* copy */
CopyMemo(ClientData.memo_copyText(),contentID,changePageIndex(getPageIndex()),$('#divDialogMemo'),posXPopupMemo,posYPopupMemo,function(){
//set flag change memo
ClientData.isChangedMemo(true);
ClientData.IsAddingMemo(false);
/* refresh draw memo */
drawMemoOnScreen();
//change image
$('#imgaddmemo').removeClass();
$('#imgaddmemo').addClass('memoAdd');
});
$('#imgaddmemo').addClass('memoAdd');
});
}
}
}else{
var isClickMemo = false;
if(isOpenPopUpText == true){
isOpenPopUpText = false;
ClosePopupText();
}
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){
isOpenPopUpMemo = false;
$("#pop_up_memo").hide();
}
/* check exist object in mouse position */
var hitPageObj = getContent().currentPage.hitTest(imagePt.x, imagePt.y);
/* 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();
}
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();
/*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;
isClickLinkList = 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{
if(ClientData.IsAddingMarking() == false && isCopyMemo == false){
var cwMain = $('#main').width();
......@@ -1578,10 +1573,18 @@ function disableControlsCopyMemo(){
$('#imgmarkingtoolbar').removeClass();
$('#imgmarkingtoolbar').addClass('markingToolbar_off');
$('#firstpage').unbind('click');
$('#firstpage').unbind('click');
$('#firstpage').removeClass();
$('#firstpage').addClass('begin_off');
$('#prevpage').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');
if(avwUserEnvObj.os != "android"){
$("#slider_page").slider("option", "disabled", true );
......@@ -2161,13 +2164,13 @@ function flip() {
$("#draw_canvas").attr('height', destRect.bottom - destRect.top)
.attr('width', destRect.right - destRect.left)
.css('top', destRect.top + marginY - 1)
.css('left',destRect.left + marginX - 1);
.css('top', destRect.top + marginY )
.css('left',destRect.left + marginX );
$("#marker_canvas").attr('height', destRect.bottom - destRect.top)
.attr('width', destRect.right - destRect.left)
.css('top', destRect.top + marginY - 1)
.css('left',destRect.left + marginX - 1);
.css('top', destRect.top + marginY )
.css('left',destRect.left + marginX );
isFirstLoad = false;
}
......@@ -3264,9 +3267,9 @@ function showEditMemo(){
/*click copyMemo() */
function copyMemo(){
isCopyMemo = true;
//isCopyMemo = true;
ClientData.memo_copyText(objEditMemo.text);
disableControlsCopyMemo();
//disableControlsCopyMemo();
$("#pop_up_memo").hide();
}
......
......@@ -54,7 +54,7 @@ function OpenPopupText(posX, posY, content, dialogDiv, arrowDiv) {
// Ajust direction [ end ]
switch (direction) {
case 0: left_dialog = left_arrow - dialogDiv.outerWidth();
case 0: left_dialog = left_arrow - dialogDiv.outerWidth();
top_dialog = top_arrow - 20;
arrowDiv.css("border-color", "transparent transparent transparent #ccd");
......@@ -62,7 +62,7 @@ function OpenPopupText(posX, posY, content, dialogDiv, arrowDiv) {
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();
case 1: left_dialog = left_arrow - dialogDiv.outerWidth();
top_dialog = top_arrow - dialogDiv.height() + 30;
arrowDiv.css("border-color", "transparent transparent transparent #ccd");
......@@ -70,7 +70,7 @@ function OpenPopupText(posX, posY, content, dialogDiv, arrowDiv) {
dialogDiv.css("-webkit-box-shadow", "-3px 3px 3px #777");
dialogDiv.css("box-shadow", "-3px 3px 3px #777");
break;
case 2: left_dialog = left_arrow + 40;
case 2: left_dialog = left_arrow + 24;
top_dialog = top_arrow - 20;
arrowDiv.css("border-color", "transparent #ccd transparent transparent");
......@@ -78,7 +78,7 @@ function OpenPopupText(posX, posY, content, dialogDiv, arrowDiv) {
dialogDiv.css("-webkit-box-shadow", "3px 3px 3px #777");
dialogDiv.css("box-shadow", "3px 3px 3px #777");
break;
case 3: left_dialog = left_arrow + 40;
case 3: left_dialog = left_arrow + 24;
top_dialog = top_arrow - dialogDiv.height() + 30;
arrowDiv.css("border-color", "transparent #ccd transparent transparent");
......
......@@ -106,93 +106,132 @@ 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
};
///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);
abapi('webContentList', params, 'POST', function (data) {
$('#content-grid').html('');
$.each(data.contentList, function (i, post) {
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);
if (viewdate != null && viewdate != 'undefined' && viewdate != '') {
//assign thumbnail to array
arrayTemp.push({ contentId: post.contentId, thumbnail: formatStringBase64(post.contentThumbnail) });
//changeLanguage(ClientData.userInfo_language());
i18nReplaceText();
});
//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
......@@ -728,6 +767,7 @@ function checkUserHasReadContent(contId, resourceVer, metaVer){
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;
};
......@@ -742,6 +782,7 @@ function checkUserHasReadContent(contId, resourceVer, 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);
};
imgThumb.src = returnThumbnail(contId);
readFlg = true;
......@@ -751,6 +792,7 @@ function checkUserHasReadContent(contId, resourceVer, 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);
imgIconNew.onload = function(){
ctx.drawImage(imgIconNew, c.width/2 - resizeImg[0]/2, 0);
};
......@@ -772,6 +814,7 @@ function checkUserHasReadContent(contId, resourceVer, 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);
};
......@@ -793,6 +836,7 @@ function checkUserHasReadContent(contId, resourceVer, 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);
};
......@@ -820,6 +864,7 @@ function drawEditImage(id){
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);
};
}
......@@ -1031,7 +1076,8 @@ function refreshSortTypeOrder(){
//refresh GridView
function refreshGrid(){
$('#content-grid').html('');
//$('#content-grid').html('');
$('#content-grid').empty();
$('.pageNumControl').css('visibility','hidden');
}
......@@ -1106,9 +1152,10 @@ function addReadContentToArray(strContentId, strResourceVersion, strMetaVersion,
}
}
function showContentThumbnail(){
$('img.home_canvas').fadeOut('slow',function(){
$('canvas.home_canvas').fadeIn('slow');
function showContentThumbnail(conid) {
$('img#imgloading'+conid).fadeOut('slow',function(){
$('canvas#content-thumbnail'+conid).fadeIn('slow');
});
}
......@@ -1314,35 +1361,39 @@ function sortByTitleKanaDesc(){
function renderContentAfterSort(contentSortArr){
refreshGrid();
$.each(contentSortArr, function(i, post){
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(
'<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 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"> </span> : '+outputDeliveryDate +'</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>'
);
//$('#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();
......@@ -1357,10 +1408,34 @@ function renderContentAfterSort(contentSortArr){
$('#lblVdate' + post.contentid).html(viewdate);
showContentThumbnail();
//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){
......
......@@ -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="rdoOpt0011" value="booklist"><label for="rdoOpt0011" id="Label2" lang="txtList" class="lang">リスト</label></label>
</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="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>
<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>
......
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