Commit e3e221f1 by Masaru Abe

バックアップリストア対応

parent 0f78c21c
SetEnvIf Referer "^http://web3\.agentec\.jp/web_test/" RefererCheck
Order deny,allow
Deny from all
Allow from env=RefererCheck
#SetEnvIf Referer "^http://web3\.agentec\.jp/web_test/" RefererCheck
#Order deny,allow
#Deny from all
#Allow from env=RefererCheck
<Files ~ "\.(js|json)$">
Header add Pragma "no-cache"
Header set Cache-Control no-cache
......
......@@ -156,5 +156,6 @@
"txtUrlValidDate": "validated period",
"txtMaxDownloadCount": "number of max dl",
"msgShareUrlPassword": "When you set a password, please input below.",
"msgStreamingOpenError": "It is the contents that I cannot read in the streaming."
"msgStreamingOpenError": "It is the contents that I cannot read in the streaming.",
"txtBkContentStatus": "Content Status"
}
......@@ -156,5 +156,6 @@
"txtUrlValidDate": "URL유효기간",
"txtMaxDownloadCount": "최대DL횟수",
"msgShareUrlPassword": "암호를 설정할경우 다음의 입력란에 입력하십시오.",
"msgStreamingOpenError": "스트리밍에서는 열람 할 수 없는 컨텐츠입니다."
"msgStreamingOpenError": "스트리밍에서는 열람 할 수 없는 컨텐츠입니다.",
"txtBkContentStatus": "콘텐츠 상태"
}
......@@ -903,11 +903,23 @@ CONTENTSEARCH.checkUserHasReadContent = function(contId, resourceVer, metaVer) {
var contentType = CONTENTSEARCH.returnContentType(contId);
//End Function : No.12 -- Editor : Le Long -- Date : 07/31/2013 -- Summary : Declare variable handle contentType and Thumbnail of content.
//コンテンツ状態バックアップ対応
var bkContentStatus = HEADER.getContentStatus(contId);
var contentStatus = null;
if( bkContentStatus == 0){
contentStatus = 0; //READ
} else if( bkContentStatus == 1 || bkContentStatus == 2 || bkContentStatus == 4 ){
contentStatus = 1; //NEW
} else if(bkContentStatus == 3){
contentStatus = 2; //UPDATE
}
if (readArr == null || readArr <= 0 || readArr == 'undefined') {
imgThumb.onload = function () {
var resizeImg = CONTENTSEARCH.resizeResourceThumbnail(imgThumb, c.width, c.height);
ctx.drawImage(imgThumb, (c.width / 2) - (resizeImg[0] / 2) + 4, c.height - resizeImg[1] + 4, resizeImg[0], resizeImg[1]);
if(contentStatus == null || contentStatus == 1){
imgIconNew.onload = function () {
ctx.drawImage(imgIconNew, c.width / 2 - resizeImg[0] / 2, c.height - resizeImg[1]);
$("#loadingIcon" + contId).fadeOut('slow', function () {
......@@ -915,9 +927,13 @@ CONTENTSEARCH.checkUserHasReadContent = function(contId, resourceVer, metaVer) {
});
};
imgIconNew.src = COMMON.DEFAULT_IMG_CONTENT_NEW;
} else {
$("#loadingIcon" + contId).fadeOut('slow', function () {
$('#content-thumbnail' + contId).fadeIn('slow');
});
}
};
//Start Function : No.12 -- Editor : Le Long -- Date : 07/31/2013 -- Summary : Check contentType to set thumbnail.
if(contentThumbnail == '' || contentThumbnail == null){
if(!COMMON.isPdfContent(contentType)){
var src = HEADER.getThumbnailForOtherType(contentType);
......@@ -929,21 +945,39 @@ CONTENTSEARCH.checkUserHasReadContent = function(contId, resourceVer, metaVer) {
imgThumb.src = contentThumbnail;
}
//End Function : No.12 -- Editor : Le Long -- Date : 07/31/2013 -- Summary : Check contentType to set thumbnail.
}
else {
//未読はここで終了
return;
} else {
//Check if user has read this content or not
for (var nIndex1 = 0; nIndex1 < ClientData.ReadingContentIds().length; nIndex1++) {
if (ClientData.ReadingContentIds()[nIndex1].contentid == contId) {
for (var nIndex1 = 0; nIndex1 < readArr.length; nIndex1++) {
if (readArr[nIndex1].contentid == contId) {
imgThumb.onload = function () {
var resizeImg = CONTENTSEARCH.resizeResourceThumbnail(imgThumb, c.width, c.height);
ctx.drawImage(imgThumb, (c.width / 2) - (resizeImg[0] / 2) + 4, c.height - resizeImg[1] + 4, resizeImg[0], resizeImg[1]);
if(contentStatus == 1){
imgIconNew.onload = function () {
ctx.drawImage(imgIconNew, c.width / 2 - resizeImg[0] / 2, c.height - resizeImg[1]);
$("#loadingIcon" + contId).fadeOut('slow', function () {
$('#content-thumbnail' + contId).fadeIn('slow');
});
};
imgIconNew.src = COMMON.DEFAULT_IMG_CONTENT_NEW;
} else if(contentStatus == 2){
imgIconEdit.onload = function () {
ctx.drawImage(imgIconEdit, c.width / 2 - resizeImg[0] / 2, c.height - resizeImg[1]);
$("#loadingIcon" + contId).fadeOut('slow', function () {
$('#content-thumbnail' + contId).fadeIn('slow');
});
};
imgIconEdit.src = COMMON.DEFAULT_IMG_CONTENT_EDIT;
} else {
$("#loadingIcon" + contId).fadeOut('slow', function () {
$('#content-thumbnail' + contId).fadeIn('slow');
});
}
};
//Start Function : No.12 -- Editor : Le Long -- Date : 07/31/2013 -- Summary : Check contentType to set thumbnail.
if(contentThumbnail == '' || contentThumbnail == null){
if(!COMMON.isPdfContent(contentType)){
var src = HEADER.getThumbnailForOtherType(contentType);
......@@ -954,15 +988,16 @@ CONTENTSEARCH.checkUserHasReadContent = function(contId, resourceVer, metaVer) {
}else{
imgThumb.src = contentThumbnail;
}
//End Function : No.12 -- Editor : Le Long -- Date : 07/31/2013 -- Summary : Check contentType to set thumbnail.
readFlg = true;
break;
}
else {
} else {
/*
imgThumb.onload = function () {
var resizeImg = CONTENTSEARCH.resizeResourceThumbnail(imgThumb, c.width, c.height);
ctx.drawImage(imgThumb, (c.width / 2) - (resizeImg[0] / 2) + 4, c.height - resizeImg[1] + 4, resizeImg[0], resizeImg[1]);
if(contentStatus == null || contentStatus == 1){
imgIconNew.onload = function () {
ctx.drawImage(imgIconNew, c.width / 2 - resizeImg[0] / 2, c.height - resizeImg[1]);
$("#loadingIcon" + contId).fadeOut('slow', function () {
......@@ -970,9 +1005,13 @@ CONTENTSEARCH.checkUserHasReadContent = function(contId, resourceVer, metaVer) {
});
};
imgIconNew.src = COMMON.DEFAULT_IMG_CONTENT_NEW;
} else {
$("#loadingIcon" + contId).fadeOut('slow', function () {
$('#content-thumbnail' + contId).fadeIn('slow');
});
}
};
//Start Function : No.12 -- Editor : Le Long -- Date : 07/31/2013 -- Summary : Check contentType to set thumbnail.
if(contentThumbnail == '' || contentThumbnail == null){
if(!COMMON.isPdfContent(contentType)){
var src = HEADER.getThumbnailForOtherType(contentType);
......@@ -983,8 +1022,8 @@ CONTENTSEARCH.checkUserHasReadContent = function(contId, resourceVer, metaVer) {
}else{
imgThumb.src = contentThumbnail;
}
//End Function : No.12 -- Editor : Le Long -- Date : 07/31/2013 -- Summary : Check contentType to set thumbnail.
*/
}
}
}
......@@ -992,25 +1031,37 @@ CONTENTSEARCH.checkUserHasReadContent = function(contId, resourceVer, metaVer) {
//Check if resource version has change
if (readFlg) {
if (versionArr == null || versionArr <= 0 || versionArr == 'undefined') {
}
else {
} else {
for (var nIndex2 = 0; nIndex2 < versionArr.length; nIndex2++) {
if (versionArr[nIndex2].contentid == contId) {
if (versionArr[nIndex2].resourceversion != resourceVer) {
imgThumb.onload = function () {
var resizeImg = CONTENTSEARCH.resizeResourceThumbnail(imgThumb, c.width, c.height);
ctx.drawImage(imgThumb, (c.width / 2) - (resizeImg[0] / 2) + 4, c.height - resizeImg[1] + 4, resizeImg[0], resizeImg[1]);
if(contentStatus == 1){
imgIconNew.onload = function () {
ctx.drawImage(imgIconNew, c.width / 2 - resizeImg[0] / 2, c.height - resizeImg[1]);
$("#loadingIcon" + contId).fadeOut('slow', function () {
$('#content-thumbnail' + contId).fadeIn('slow');
});
};
imgIconNew.src = COMMON.DEFAULT_IMG_CONTENT_NEW;
} else {
imgIconEdit.onload = function () {
ctx.drawImage(imgIconEdit, c.width / 2 - resizeImg[0] / 2, c.height - resizeImg[1]);
$("#loadingIcon" + contId).fadeOut('slow', function () {
$('#content-thumbnail' + contId).fadeIn('slow');
});
};
imgIconEdit.src = COMMON.DEFAULT_IMG_CONTENT_EDIT;
//バックアップデータのステータス更新
HEADER.setContentStatus(contId,3);
}
};
//Start Function : No.12 -- Editor : Le Long -- Date : 07/31/2013 -- Summary : Check contentType to set thumbnail.
if(contentThumbnail == '' || contentThumbnail == null){
if(!COMMON.isPdfContent(contentType)){
var src = HEADER.getThumbnailForOtherType(contentType);
......@@ -1021,10 +1072,10 @@ CONTENTSEARCH.checkUserHasReadContent = function(contId, resourceVer, metaVer) {
}else{
imgThumb.src = contentThumbnail;
}
//End Function : No.12 -- Editor : Le Long -- Date : 07/31/2013 -- Summary : Check contentType to set thumbnail.
break;
//break;
}
break;
}
}
}
......@@ -1038,6 +1089,16 @@ CONTENTSEARCH.checkUserHasReadContent = function(contId, resourceVer, metaVer) {
imgThumb.onload = function () {
var resizeImg = CONTENTSEARCH.resizeResourceThumbnail(imgThumb, c.width, c.height);
ctx.drawImage(imgThumb, (c.width / 2) - (resizeImg[0] / 2) + 4, c.height - resizeImg[1] + 4, resizeImg[0], resizeImg[1]);
if(contentStatus == 1){
imgIconNew.onload = function () {
ctx.drawImage(imgIconNew, c.width / 2 - resizeImg[0] / 2, c.height - resizeImg[1]);
$("#loadingIcon" + contId).fadeOut('slow', function () {
$('#content-thumbnail' + contId).fadeIn('slow');
});
};
imgIconNew.src = COMMON.DEFAULT_IMG_CONTENT_NEW;
} else {
imgIconEdit.onload = function () {
ctx.drawImage(imgIconEdit, c.width / 2 - resizeImg[0] / 2, c.height - resizeImg[1]);
$("#loadingIcon" + contId).fadeOut('slow', function () {
......@@ -1045,9 +1106,13 @@ CONTENTSEARCH.checkUserHasReadContent = function(contId, resourceVer, metaVer) {
});
};
imgIconEdit.src = COMMON.DEFAULT_IMG_CONTENT_EDIT;
//バックアップデータのステータス更新
HEADER.setContentStatus(contId,3);
}
};
//Start Function : No.12 -- Editor : Le Long -- Date : 07/31/2013 -- Summary : Check contentType to set thumbnail.
if(contentThumbnail == '' || contentThumbnail == null){
if(!COMMON.isPdfContent(contentType)){
var src = HEADER.getThumbnailForOtherType(contentType);
......@@ -1058,14 +1123,51 @@ CONTENTSEARCH.checkUserHasReadContent = function(contId, resourceVer, metaVer) {
}else{
imgThumb.src = contentThumbnail;
}
//End Function : No.12 -- Editor : Le Long -- Date : 07/31/2013 -- Summary : Check contentType to set thumbnail.
//break;
}
break;
}
}
}
//readFlg = false;
} else {
imgThumb.onload = function () {
var resizeImg = CONTENTSEARCH.resizeResourceThumbnail(imgThumb, c.width, c.height);
ctx.drawImage(imgThumb, (c.width / 2) - (resizeImg[0] / 2) + 4, c.height - resizeImg[1] + 4, resizeImg[0], resizeImg[1]);
if(contentStatus == null || contentStatus == 1){
imgIconNew.onload = function () {
ctx.drawImage(imgIconNew, c.width / 2 - resizeImg[0] / 2, c.height - resizeImg[1]);
$("#loadingIcon" + contId).fadeOut('slow', function () {
$('#content-thumbnail' + contId).fadeIn('slow');
});
};
imgIconNew.src = COMMON.DEFAULT_IMG_CONTENT_NEW;
} else if(contentStatus == 2){
imgIconEdit.onload = function () {
ctx.drawImage(imgIconEdit, c.width / 2 - resizeImg[0] / 2, c.height - resizeImg[1]);
$("#loadingIcon" + contId).fadeOut('slow', function () {
$('#content-thumbnail' + contId).fadeIn('slow');
});
};
imgIconEdit.src = COMMON.DEFAULT_IMG_CONTENT_EDIT;
} else {
$("#loadingIcon" + contId).fadeOut('slow', function () {
$('#content-thumbnail' + contId).fadeIn('slow');
});
}
};
if(contentThumbnail == '' || contentThumbnail == null){
if(!COMMON.isPdfContent(contentType)){
var src = HEADER.getThumbnailForOtherType(contentType);
if( src != '' ){
imgThumb.src = src;
}
}
}else{
imgThumb.src = contentThumbnail;
}
readFlg = false;
}
};
......
......@@ -620,7 +620,8 @@ HEADER.DoBackup = function(isBackupMarking, isBackupMemo, isBackupBookmark, isBa
//READステータス追加
if(ClientData.ReadingContentIds().length > 0){
for(var nIndex = 0; nIndex < ClientData.ReadingContentIds().length; nIndex++){
HEADER.setContentStatus(ClientData.ReadingContentIds()[nIndex].contentid, 0 );
//存在しない場合追加
HEADER.addContentStatusRead(ClientData.ReadingContentIds()[nIndex].contentid);
}
}
......@@ -1218,8 +1219,39 @@ HEADER.setContentStatus = function(contentId, status) {
var newArray = [];
ClientData.ContentStatusData(newArray);
ClientData.ContentStatusData(arrContentStatus);
};
//JSONバックアップ前にWebでリード済のステータスがJSONになければ追加
HEADER.addContentStatusRead = function(contentId) {
var arr = ClientData.ContentStatusData();
var hitFlg = false;
for (var nIndex1 = 0; nIndex1 < arr.length; nIndex1++) {
if(arr[nIndex1].contentId == contentId){
hitFlg = true;
break;
}
}
if(hitFlg == false ){
var obj = new ContentStatusEntity();
obj.contentId = contentId;
obj.status = 0; //read
// Add object to client
arr.push(obj);
//バックアップ対象フラグセット
ClientData.isChangedContentStatus(true);
//初期化したほうが良い?
var newArray = [];
ClientData.ContentStatusData(newArray);
ClientData.ContentStatusData(arr);
}
};
HEADER.getContentStatus = function(contentId) {
var arr = ClientData.ContentStatusData();
for (var nIndex1 = 0; nIndex1 < arr.length; nIndex1++) {
......
......@@ -140,9 +140,12 @@ HISTORY.renderContent = function(id, text, division, type, order, from, to, cate
groupId: grpid
};
AVWEB.avwCmsApiSync(ClientData.userInfo_accountPath(), 'webContentList', 'POST', params,
AVWEB.avwCmsApiSync(
ClientData.userInfo_accountPath(),
'webContentList',
'POST',
params,
function (data) {
$('#content-grid').html('');
//var htmlTemp = "";
for (var i = 0; i < data.contentList.length; i++) {
......@@ -152,7 +155,11 @@ HISTORY.renderContent = function(id, text, division, type, order, from, to, cate
//renderViewDate
var viewdate = HISTORY.renderViewDate(post.contentId);
// save alert message level
LIMIT_ACCESS_CONTENT.messageLevel[post.contentId] = { alertMessageLevel:post.alertMessageLevel, alertMessage:post.alertMessage};
if (viewdate != null && viewdate != 'undefined' && viewdate != '') {
/*
var htmlTemp = '<section class="sectionhistory">'
+ ' <div class="cnt_section_list">'
+ ' <a class="img">'
......@@ -184,20 +191,9 @@ HISTORY.renderContent = function(id, text, division, type, order, from, to, cate
shareHtml ='<li><a class="read lang button-share" contentid="' + post.contentId + '" lang="txtShare">'+I18N.i18nText("txtShare")+'</a></li>';
}
htmlTemp = htmlTemp.replace(/\{share\}/g, shareHtml);
*/
//効率化
//$('#content-grid').append(htmlTemp);
}
}
for (var i = 0; i < data.contentList.length; i++) {
post = data.contentList[i];
var viewdate = HISTORY.renderViewDate(post.contentId);
// save alert message level
LIMIT_ACCESS_CONTENT.messageLevel[post.contentId] = { alertMessageLevel:post.alertMessageLevel, alertMessage:post.alertMessage};
if (viewdate != null && viewdate != 'undefined' && viewdate != '') {
//assign thumbnail to array
var formatThumbnail = post.contentThumbnail;
......@@ -207,14 +203,7 @@ HISTORY.renderContent = function(id, text, division, type, order, from, to, cate
HISTORY.thumbnailArr.push({ contentId: post.contentId, thumbnail: formatThumbnail});
//Start Function : No.12 -- Editor : Le Long -- Date : 07/31/2013 -- Summary : Assign content type to array to manage.
//assign content type to array
HISTORY.contentTypeArr.push({ contentId: post.contentId, contentType: post.contentType });
//End Function : No.12 -- Editor : Le Long -- Date : 07/31/2013 -- Summary : Assign content type to array to manage.
//効率化
//Check if user has read this content or not.
//HISTORY.checkUserHasReadContent(post.contentId, post.resourceVersion, post.metaVersion);
//assign version to array
COMMON.resourceVersionArr.push({ contentid: post.contentId, resourceversion: post.resourceVersion });
......@@ -225,13 +214,10 @@ HISTORY.renderContent = function(id, text, division, type, order, from, to, cate
//Check if content has marking or memo
HISTORY.checkContentMarkingMemoOption(post.contentId);
//効率化
//$('#lblVdate' + post.contentId).html(viewdate);
HISTORY.addReadContentToArray(post.contentId, post.resourceVersion, post.metaVersion, post.contentThumbnail, post.contentTitle, HISTORY.returnContentTitleKana(post.contentId), post.contentDeliveryDate,post.contentType, post.readerShare );
//HISTORY.showContentThumbnail();
}
}
if (data.recordFrom) {
......@@ -244,7 +230,8 @@ HISTORY.renderContent = function(id, text, division, type, order, from, to, cate
//Render Page number
HISTORY.reRenderPageNumber(HISTORY.totalPage, HISTORY.totalPage);
}, null);
}, null
);
};
//Handle language
......@@ -766,13 +753,12 @@ HISTORY.checkUserHasReadContent = function(contId, resourceVer, metaVer){
var contentStatus = null;
if( bkContentStatus == 0){
contentStatus = 0; //READ
} else if( bkContentStatus == 1 || bkContentStatus == 2 || bkContentStatus == 3 ){
} else if( bkContentStatus == 1 || bkContentStatus == 2 || bkContentStatus == 4 ){
contentStatus = 1; //NEW
} else if(bkContentStatus == 5){
} else if(bkContentStatus == 3){
contentStatus = 2; //UPDATE
}
if(readArr == null || readArr <= 0 || readArr == 'undefined'){
imgThumb.onload = function(){
var resizeImg = HISTORY.resizeResourceThumbnail(imgThumb, c.width, c.height);
......@@ -790,7 +776,6 @@ HISTORY.checkUserHasReadContent = function(contId, resourceVer, metaVer){
};
//Start Function : No.12 -- Editor : Le Long -- Date : 07/31/2013 -- Summary : Check contentType to set thumbnail.
if(contentThumbnail == '' || contentThumbnail == null){
if(!COMMON.isPdfContent(contentType)){
var src = HEADER.getThumbnailForOtherType(contentType);
......@@ -802,13 +787,13 @@ HISTORY.checkUserHasReadContent = function(contId, resourceVer, metaVer){
imgThumb.src = contentThumbnail;
}
//End Function : No.12 -- Editor : Le Long -- Date : 07/31/2013 -- Summary : Check contentType to set thumbnail.
//未読はここで終了
return;
}
else{
} else {
//Check if user has read this content or not
for (var nIndex1 = 0; nIndex1 < ClientData.ReadingContentIds().length; nIndex1++) {
if(ClientData.ReadingContentIds()[nIndex1].contentid == contId){
for (var nIndex1 = 0; nIndex1 < readArr.length; nIndex1++) {
if(readArr[nIndex1].contentid == contId){
imgThumb.onload = function(){
var resizeImg = HISTORY.resizeResourceThumbnail(imgThumb, c.width, c.height);
ctx.drawImage(imgThumb, c.width/2 - resizeImg[0]/2, 0, resizeImg[0], resizeImg[1]);
......@@ -829,7 +814,6 @@ HISTORY.checkUserHasReadContent = function(contId, resourceVer, metaVer){
HISTORY.showContentThumbnail(contId);
}
};
//Start Function : No.12 -- Editor : Le Long -- Date : 07/31/2013 -- Summary : Check contentType to set thumbnail.
if(contentThumbnail == '' || contentThumbnail == null){
if(!COMMON.isPdfContent(contentType)){
var src = HEADER.getThumbnailForOtherType(contentType);
......@@ -840,12 +824,10 @@ HISTORY.checkUserHasReadContent = function(contId, resourceVer, metaVer){
}else{
imgThumb.src = contentThumbnail;
}
//End Function : No.12 -- Editor : Le Long -- Date : 07/31/2013 -- Summary : Check contentType to set thumbnail.
readFlg = true;
break;
}
else{
} else {
/*
imgThumb.onload = function(){
var resizeImg = HISTORY.resizeResourceThumbnail(imgThumb, c.width, c.height);
ctx.drawImage(imgThumb, c.width/2 - resizeImg[0]/2, 0, resizeImg[0], resizeImg[1]);
......@@ -872,8 +854,8 @@ HISTORY.checkUserHasReadContent = function(contId, resourceVer, metaVer){
}else{
imgThumb.src = contentThumbnail;
}
//End Function : No.12 -- Editor : Le Long -- Date : 07/31/2013 -- Summary : Check contentType to set thumbnail.
*/
}
}
}
......@@ -881,8 +863,7 @@ HISTORY.checkUserHasReadContent = function(contId, resourceVer, metaVer){
//Check if resource version has change
if(readFlg){
if(versionArr == null || versionArr <= 0 || versionArr == 'undefined'){
}
else{
} else {
for(var nIndex2 = 0; nIndex2 < versionArr.length; nIndex2++){
if(versionArr[nIndex2].contentid == contId){
if(versionArr[nIndex2].resourceversion != resourceVer){
......@@ -891,17 +872,21 @@ HISTORY.checkUserHasReadContent = function(contId, resourceVer, metaVer){
ctx.drawImage(imgThumb, c.width/2 - resizeImg[0]/2, 0, resizeImg[0], resizeImg[1]);
if(contentStatus == 1){
HISTORY.showContentThumbnail(contId);
imgIconNew.onload = function(){
ctx.drawImage(imgIconNew, c.width/2 - resizeImg[0]/2, 0);
HISTORY.showContentThumbnail(contId);
};
imgIconNew.src = COMMON.DEFAULT_IMG_CONTENT_NEW;
} else {
HISTORY.showContentThumbnail(contId);
imgIconEdit.onload = function(){
ctx.drawImage(imgIconEdit, c.width/2 - resizeImg[0]/2, 0);
HISTORY.showContentThumbnail(contId);
};
imgIconEdit.src = COMMON.DEFAULT_IMG_CONTENT_EDIT;
//バックアップデータのステータス更新
HEADER.setContentStatus(contId,3);
}
};
//Start Function : No.12 -- Editor : Le Long -- Date : 07/31/2013 -- Summary : Check contentType to set thumbnail.
......@@ -915,17 +900,16 @@ HISTORY.checkUserHasReadContent = function(contId, resourceVer, metaVer){
}else{
imgThumb.src = contentThumbnail;
}
//End Function : No.12 -- Editor : Le Long -- Date : 07/31/2013 -- Summary : Check contentType to set thumbnail.
break;
//break;
}
break;
}
}
}
if(metaArr == null || metaArr <= 0 || metaArr == 'undefined'){
}
else{
} else{
for(var nIndex2 = 0; nIndex2 < metaArr.length; nIndex2++){
if(metaArr[nIndex2].contentid == contId){
if(metaArr[nIndex2].metaversion != metaVer){
......@@ -934,17 +918,21 @@ HISTORY.checkUserHasReadContent = function(contId, resourceVer, metaVer){
ctx.drawImage(imgThumb, c.width/2 - resizeImg[0]/2, 0, resizeImg[0], resizeImg[1]);
if(contentStatus == 1){
HISTORY.showContentThumbnail(contId);
imgIconNew.onload = function(){
ctx.drawImage(imgIconNew, c.width/2 - resizeImg[0]/2, 0);
HISTORY.showContentThumbnail(contId);
};
imgIconNew.src = COMMON.DEFAULT_IMG_CONTENT_NEW;
} else {
HISTORY.showContentThumbnail(contId);
imgIconEdit.onload = function(){
ctx.drawImage(imgIconEdit, c.width/2 - resizeImg[0]/2, 0);
HISTORY.showContentThumbnail(contId);
};
imgIconEdit.src = COMMON.DEFAULT_IMG_CONTENT_EDIT;
//バックアップデータのステータス更新
HEADER.setContentStatus(contId,3);
}
};
//Start Function : No.12 -- Editor : Le Long -- Date : 07/31/2013 -- Summary : Check contentType to set thumbnail.
......@@ -958,14 +946,47 @@ HISTORY.checkUserHasReadContent = function(contId, resourceVer, metaVer){
}else{
imgThumb.src = contentThumbnail;
}
//End Function : No.12 -- Editor : Le Long -- Date : 07/31/2013 -- Summary : Check contentType to set thumbnail.
//break;
}
break;
}
}
}
//readFlg = false;
} else {
imgThumb.onload = function(){
var resizeImg = HISTORY.resizeResourceThumbnail(imgThumb, c.width, c.height);
ctx.drawImage(imgThumb, c.width/2 - resizeImg[0]/2, 0, resizeImg[0], resizeImg[1]);
if(contentStatus == null || contentStatus == 1){
imgIconNew.onload = function(){
ctx.drawImage(imgIconNew, c.width/2 - resizeImg[0]/2, 0);
HISTORY.showContentThumbnail(contId);
};
imgIconNew.src = COMMON.DEFAULT_IMG_CONTENT_NEW;
} else if(contentStatus == 2){
imgIconEdit.onload = function(){
ctx.drawImage(imgIconEdit, c.width/2 - resizeImg[0]/2, 0);
HISTORY.showContentThumbnail(contId);
};
imgIconEdit.src = COMMON.DEFAULT_IMG_CONTENT_EDIT;
} else {
HISTORY.showContentThumbnail(contId);
}
};
if(contentThumbnail == '' || contentThumbnail == null){
if(!COMMON.isPdfContent(contentType)){
var src = HEADER.getThumbnailForOtherType(contentType);
if( src != '' ){
imgThumb.src = src;
}
}
}else{
imgThumb.src = contentThumbnail;
}
readFlg = false;
}
};
......@@ -1474,7 +1495,7 @@ HISTORY.renderContentAfterSort = function(contentSortArr){
$('#lblVdate' + post.contentid).html(viewdate);
HISTORY.showContentThumbnail();
//HISTORY.showContentThumbnail();
}
};
......
......@@ -1913,13 +1913,13 @@ HOME.checkUserHasReadContent = function(contId, resourceVer, metaVer) {
//コンテンツ状態バックアップ対応
var bkContentStatus = HEADER.getContentStatus(contId);
console.log("contId:" + contId + " bkStatus:" + bkContentStatus);
//console.log("contId:" + contId + " bkStatus:" + bkContentStatus);
var contentStatus = null;
if( bkContentStatus == 0){
contentStatus = 0; //READ
} else if( bkContentStatus == 1 || bkContentStatus == 2 || bkContentStatus == 3 ){
} else if( bkContentStatus == 1 || bkContentStatus == 2 || bkContentStatus == 4 ){
contentStatus = 1; //NEW
} else if(bkContentStatus == 5){
} else if(bkContentStatus == 3){
contentStatus = 2; //UPDATE
}
......@@ -1941,10 +1941,8 @@ HOME.checkUserHasReadContent = function(contId, resourceVer, metaVer) {
$('#content-thumbnail' + contId).fadeIn('slow');
});
}
};
//Start Function : No.12 -- Editor : Le Long -- Date : 07/31/2013 -- Summary : Check contentType to set thumbnail.
if(contentThumbnail == '' || contentThumbnail == null){
if(!COMMON.isPdfContent(contentType)){
var src = HEADER.getThumbnailForOtherType(contentType);
......@@ -1956,12 +1954,14 @@ HOME.checkUserHasReadContent = function(contId, resourceVer, metaVer) {
imgThumb.src = contentThumbnail;
}
//End Function : No.12 -- Editor : Le Long -- Date : 07/31/2013 -- Summary : Check contentType to set thumbnail.
}
else {
//未読はここで終了
return;
} else {
//Check if user has read this content or not
for (var nIndex1 = 0; nIndex1 < ClientData.ReadingContentIds().length; nIndex1++) {
if (ClientData.ReadingContentIds()[nIndex1].contentid == contId) {
for (var nIndex1 = 0; nIndex1 < readArr.length; nIndex1++) {
if (readArr[nIndex1].contentid == contId) {
//console.log("ClientData.ReadingContentIds:" + contId + " status:" + contentStatus);
imgThumb.onload = function () {
var resizeImg = HOME.resizeResourceThumbnail(imgThumb, c.width, c.height);
ctx.drawImage(imgThumb, (c.width / 2) - (resizeImg[0] / 2) + 4, c.height - resizeImg[1] + 4, resizeImg[0], resizeImg[1]);
......@@ -1987,10 +1987,8 @@ HOME.checkUserHasReadContent = function(contId, resourceVer, metaVer) {
$('#content-thumbnail' + contId).fadeIn('slow');
});
}
};
//Start Function : No.12 -- Editor : Le Long -- Date : 07/31/2013 -- Summary : Check contentType to set thumbnail.
if(contentThumbnail == '' || contentThumbnail == null){
if(!COMMON.isPdfContent(contentType)){
var src = HEADER.getThumbnailForOtherType(contentType);
......@@ -2001,12 +1999,11 @@ HOME.checkUserHasReadContent = function(contId, resourceVer, metaVer) {
}else{
imgThumb.src = contentThumbnail;
}
//End Function : No.12 -- Editor : Le Long -- Date : 07/31/2013 -- Summary : Check contentType to set thumbnail.
readFlg = true;
break;
}
else {
} else {
/*
imgThumb.onload = function () {
var resizeImg = HOME.resizeResourceThumbnail(imgThumb, c.width, c.height);
ctx.drawImage(imgThumb, (c.width / 2) - (resizeImg[0] / 2) + 4, c.height - resizeImg[1] + 4, resizeImg[0], resizeImg[1]);
......@@ -2024,10 +2021,8 @@ HOME.checkUserHasReadContent = function(contId, resourceVer, metaVer) {
$('#content-thumbnail' + contId).fadeIn('slow');
});
}
};
//Start Function : No.12 -- Editor : Le Long -- Date : 07/31/2013 -- Summary : Check contentType to set thumbnail.
if(contentThumbnail == '' || contentThumbnail == null){
if(!COMMON.isPdfContent(contentType)){
var src = HEADER.getThumbnailForOtherType(contentType);
......@@ -2040,6 +2035,7 @@ HOME.checkUserHasReadContent = function(contId, resourceVer, metaVer) {
}
break;
//End Function : No.12 -- Editor : Le Long -- Date : 07/31/2013 -- Summary : Check contentType to set thumbnail.
*/
}
}
}
......@@ -2047,8 +2043,7 @@ HOME.checkUserHasReadContent = function(contId, resourceVer, metaVer) {
//Check if resource version has change
if (readFlg) {
if (versionArr == null || versionArr <= 0 || versionArr == 'undefined') {
}
else {
} else {
for (var nIndex2 = 0; nIndex2 < versionArr.length; nIndex2++) {
if (versionArr[nIndex2].contentid == contId) {
if (versionArr[nIndex2].resourceversion != resourceVer) {
......@@ -2072,6 +2067,10 @@ HOME.checkUserHasReadContent = function(contId, resourceVer, metaVer) {
});
};
imgIconEdit.src = COMMON.DEFAULT_IMG_CONTENT_EDIT;
//バックアップデータのステータス更新
HEADER.setContentStatus(contId,3);
}
};
//Start Function : No.12 -- Editor : Le Long -- Date : 07/31/2013 -- Summary : Check contentType to set thumbnail.
......@@ -2086,17 +2085,16 @@ HOME.checkUserHasReadContent = function(contId, resourceVer, metaVer) {
}else{
imgThumb.src = contentThumbnail;
}
//End Function : No.12 -- Editor : Le Long -- Date : 07/31/2013 -- Summary : Check contentType to set thumbnail.
break;
//break;
}
break;
}
}
}
if (metaArr == null || metaArr <= 0 || metaArr == 'undefined') {
}
else {
} else {
for (var nIndex2 = 0; nIndex2 < metaArr.length; nIndex2++) {
if (metaArr[nIndex2].contentid == contId) {
if (metaArr[nIndex2].metaversion != metaVer) {
......@@ -2120,6 +2118,10 @@ HOME.checkUserHasReadContent = function(contId, resourceVer, metaVer) {
});
};
imgIconEdit.src = COMMON.DEFAULT_IMG_CONTENT_EDIT;
//バックアップデータのステータス更新
HEADER.setContentStatus(contId,3);
}
};
//Start Function : No.12 -- Editor : Le Long -- Date : 07/31/2013 -- Summary : Check contentType to set thumbnail.
......@@ -2136,12 +2138,55 @@ HOME.checkUserHasReadContent = function(contId, resourceVer, metaVer) {
}
//End Function : No.12 -- Editor : Le Long -- Date : 07/31/2013 -- Summary : Check contentType to set thumbnail.
//break;
}
break;
}
}
}
//readFlg = false;
} else {
imgThumb.onload = function () {
var resizeImg = HOME.resizeResourceThumbnail(imgThumb, c.width, c.height);
ctx.drawImage(imgThumb, (c.width / 2) - (resizeImg[0] / 2) + 4, c.height - resizeImg[1] + 4, resizeImg[0], resizeImg[1]);
if(contentStatus == null || contentStatus == 1){
imgIconNew.onload = function () {
ctx.drawImage(imgIconNew, c.width / 2 - resizeImg[0] / 2, c.height - resizeImg[1]);
$("#loadingIcon" + contId).fadeOut('slow', function () {
$('#content-thumbnail' + contId).fadeIn('slow');
});
};
imgIconNew.src = COMMON.DEFAULT_IMG_CONTENT_NEW;
} else if(contentStatus == 2){
imgIconEdit.onload = function () {
ctx.drawImage(imgIconEdit, c.width / 2 - resizeImg[0] / 2, c.height - resizeImg[1]);
$("#loadingIcon" + contId).fadeOut('slow', function () {
$('#content-thumbnail' + contId).fadeIn('slow');
});
};
imgIconEdit.src = COMMON.DEFAULT_IMG_CONTENT_EDIT;
} else {
$("#loadingIcon" + contId).fadeOut('slow', function () {
$('#content-thumbnail' + contId).fadeIn('slow');
});
}
};
//Start Function : No.12 -- Editor : Le Long -- Date : 07/31/2013 -- Summary : Check contentType to set thumbnail.
if(contentThumbnail == '' || contentThumbnail == null){
if(!COMMON.isPdfContent(contentType)){
var src = HEADER.getThumbnailForOtherType(contentType);
if( src != '' ){
imgThumb.src = src;
}
}
}else{
imgThumb.src = contentThumbnail;
}
readFlg = false;
//break;
//End Function : No.12 -- Editor : Le Long -- Date : 07/31/2013 -- Summary : Check contentType to set thumbnail.
}
};
......
......@@ -713,6 +713,8 @@ SETTINGS.dspOptReset_Click = function(e) {
$('#chkBkMemo').attr('checked', 'checked');
// set default backup bookmark
$('#chkBkShiori').attr('checked', 'checked');
// set default backup contentStatus
$('#chkBkContentStatus').attr('checked', 'checked');
// reset page transition no.4
$('#txtValueAnimation').val(1);
......@@ -1044,6 +1046,13 @@ SETTINGS.initScreen = function() {
$("#chkBkShiori").attr('checked', 'checked');
}
if (ClientData.userOpt_bkContentStatusFlag() == 0) {
$("#chkBkContentStatus").removeAttr('checked');
}
else {
$("#chkBkContentStatus").attr('checked', 'checked');
}
// load config page transition & page transition period No.4
$('#cboAnimation').val(ClientData.userOpt_pageTransition());
......
......@@ -153,13 +153,15 @@
<label id="txtOptBkCfm" for="chkOptBkCfm" lang="txtOptBkCfm" class="lang"><!--毎回ログアウトの時、バックアップするかどうかは必ず確認する--></label>
</label>
<br />
<label class="option_backup">
<!--<label class="option_backup">-->
<p class="option_backup" style="font-size: 13px;margin-left:50px">
<label id="txtBkDefault" lang="txtBkDefault" class="lang"><!--バックアップのデフォルト : --></label>
<input type="checkbox" id="chkBkMarking" class="chkbx" checked="checked" /><label id="txtBkMarking" for="chkBkMarking" lang="txtBkMarking" class="lang"><!--マーキング--></label>
<input type="checkbox" id="chkBkMemo" class="chkbx" checked="checked" /><label id="txtBkMemo" for="chkBkMemo" lang="txtBkMemo" class="lang"><!--メモ--></label>
<input type="checkbox" id="chkBkShiori" class="chkbx" checked="checked" /><label id="txtBkShiori" for="chkBkShiori" lang="txtBkShiori" class="lang"><!--しおり--></label>
<input type="checkbox" id="chkBkContentStatus" class="chkbx" checked="checked" /><label id="txtBkContentStatus" for="chkBkContentStatus" lang="txtBkContentStatus" class="lang"><!--コンテンツ状態--></label>
</label>
</p>
<!--</label>-->
</p>
<p class="backupbtn"><a class="backup lang" lang="dspOptBk" id="dspOptBk" href="#" style="display:none;"><!--バックアップ--></a><a href="#" id="dspOptRes" lang="dspOptRes" class="lang" style="visibility:hidden;"><!--リストア--></a></p>
<p class="savebtn"><a class="save lang" href="#" id="dspSave" lang="dspSave"><!--保存する--></a><a class="default lang" href="#" id="dspOptReset" lang="dspOptReset"><!--初期設定に戻る--></a><div style="clear:both;"></div></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