Commit 0f78c21c by Masaru Abe

バックアップ対応

parent 38bf701c
...@@ -162,6 +162,8 @@ COMMON.Keys = { ...@@ -162,6 +162,8 @@ COMMON.Keys = {
// Local // Local
MemoData: 'MemoData', MemoData: 'MemoData',
// Local // Local
ContentStatusData: 'ContentStatusData',
// Local
ResourceVersion: 'ResourceVersion', ResourceVersion: 'ResourceVersion',
// Local // Local
MetaVersion: 'MetaVersion', MetaVersion: 'MetaVersion',
...@@ -178,6 +180,8 @@ COMMON.Keys = { ...@@ -178,6 +180,8 @@ COMMON.Keys = {
isChangedMarkingData: 'isChangedMarkingData', isChangedMarkingData: 'isChangedMarkingData',
// Local: isChangedBookmark: boolean (true: changed, false: not change) // Local: isChangedBookmark: boolean (true: changed, false: not change)
isChangedBookmark: 'isChangedBookmark', isChangedBookmark: 'isChangedBookmark',
// Local: isChangedContentStatus: boolean (true: changed, false: not change)
isChangedContentStatus: 'isChangedContentStatus',
// Session:パスワード要変更(requirePasswordChange):String (0:不要, 1:初回, 2:定期変更) // Session:パスワード要変更(requirePasswordChange):String (0:不要, 1:初回, 2:定期変更)
requirePasswordChange: 'requirePasswordChange', requirePasswordChange: 'requirePasswordChange',
...@@ -346,6 +350,8 @@ COMMON.Keys = { ...@@ -346,6 +350,8 @@ COMMON.Keys = {
userOpt_bkMemoFlag: 'userOpt_bkMemoFlag', userOpt_bkMemoFlag: 'userOpt_bkMemoFlag',
// Local :ユーザオプション(userOpt)_バックアップデフォルト_しおり:Interger // Local :ユーザオプション(userOpt)_バックアップデフォルト_しおり:Interger
userOpt_bkShioriFlag: 'userOpt_bkShioriFlag', userOpt_bkShioriFlag: 'userOpt_bkShioriFlag',
// Local :ユーザオプション(userOpt)_バックアップデフォルト_コンテンツ状態:Interger
userOpt_bkContentStatusFlag: 'userOpt_bkContentStatusFlag',
// Local :ユーザオプション(userOpt)_ビューのアニメーション種類:Interger // Local :ユーザオプション(userOpt)_ビューのアニメーション種類:Interger
userOpt_pageTransition: 'userOpt_pageTransition', userOpt_pageTransition: 'userOpt_pageTransition',
// Local :ユーザオプション(userOpt)_アニメーション時間:Float // Local :ユーザオプション(userOpt)_アニメーション時間:Float
...@@ -404,6 +410,13 @@ function MarkingEntity() { ...@@ -404,6 +410,13 @@ function MarkingEntity() {
this.markingid = ""; this.markingid = "";
this.registerDate = new Date(); this.registerDate = new Date();
}; };
//Entity for ContentStatus
function ContentStatusEntity() {
this.contentId = "";
this.status = 0;
};
// Entity for log // Entity for log
function LogEntity() { function LogEntity() {
this.contentid = ""; this.contentid = "";
...@@ -548,6 +561,24 @@ COMMON.getDataBookmark = function(jsonString) { ...@@ -548,6 +561,24 @@ COMMON.getDataBookmark = function(jsonString) {
ClientData.BookMarkData(arrBookmark); ClientData.BookMarkData(arrBookmark);
}; };
COMMON.getDataContentStatus = function(jsonString) {
var data = jsonString.data;
var arr = ClientData.ContentStatusData();
arr.clear();
ClientData.ContentStatusData(arr);
var arrContentStatus = [];
for (var nIndex1 = 0; nIndex1 < data.length; nIndex1++) {
var obj = new ContentStatusEntity();
obj.contentId = data[nIndex1].contentId;
obj.status = data[nIndex1].status;
// Add object to client
arrContentStatus.push(obj);
}
ClientData.ContentStatusData(arrContentStatus);
};
/* /*
Get data from localstorage and sessionstorage synchronization Get data from localstorage and sessionstorage synchronization
If has any param (args.length > 0) -> setter If has any param (args.length > 0) -> setter
...@@ -700,7 +731,15 @@ var ClientData = { ...@@ -700,7 +731,15 @@ var ClientData = {
return COMMON.operateData(arguments, COMMON.Keys.MarkingData, []); return COMMON.operateData(arguments, COMMON.Keys.MarkingData, []);
} }
}, },
// Local: ContentStatus collection
ContentStatusData: function (data) {
if (arguments.length > 0) {
COMMON.operateData(arguments, COMMON.Keys.ContentStatusData, []);
}
else {
return COMMON.operateData(arguments, COMMON.Keys.ContentStatusData, []);
}
},
// Local: content log collection // Local: content log collection
ContentLogData: function (data) { ContentLogData: function (data) {
if (arguments.length > 0) { if (arguments.length > 0) {
...@@ -830,6 +869,16 @@ var ClientData = { ...@@ -830,6 +869,16 @@ var ClientData = {
} }
}, },
// Local: isChangedContentStatus: boolean (true: changed, false: not change)
isChangedContentStatus: function (data) {
if (arguments.length > 0) {
COMMON.operateData(arguments, COMMON.Keys.isChangedContentStatus, undefined);
}
else {
return COMMON.operateData(arguments, COMMON.Keys.isChangedContentStatus, undefined);
}
},
// Local :共通(common)_コンテンツID:Integer // Local :共通(common)_コンテンツID:Integer
common_preContentId: function (data) { common_preContentId: function (data) {
if (arguments.length > 0) { if (arguments.length > 0) {
...@@ -1071,6 +1120,17 @@ var ClientData = { ...@@ -1071,6 +1120,17 @@ var ClientData = {
} }
}, },
// Local :ユーザオプション(userOpt)_バックアップデフォルト_コンテンツ状態:Interger
userOpt_bkContentStatusFlag: function (data) {
if (arguments.length > 0) {
COMMON.operateData(arguments, COMMON.Keys.userOpt_bkContentStatuFlag, undefined);
}
else {
return COMMON.operateData(arguments, COMMON.Keys.userOpt_bkContentStatuFlag, undefined);
}
},
// Local :ユーザオプション(userOpt)_ビューのアニメーション種類:Interger // Local :ユーザオプション(userOpt)_ビューのアニメーション種類:Interger
userOpt_pageTransition: function (data) { userOpt_pageTransition: function (data) {
if (arguments.length > 0) { if (arguments.length > 0) {
......
...@@ -156,5 +156,6 @@ ...@@ -156,5 +156,6 @@
"txtUrlValidDate": "URL有効期間", "txtUrlValidDate": "URL有効期間",
"txtMaxDownloadCount": "最大DL回数", "txtMaxDownloadCount": "最大DL回数",
"msgShareUrlPassword": "パスワードを設定する場合、以下に入力して下さい。", "msgShareUrlPassword": "パスワードを設定する場合、以下に入力して下さい。",
"msgStreamingOpenError": "ストリーミングでは閲覧出来ないコンテンツです。" "msgStreamingOpenError": "ストリーミングでは閲覧出来ないコンテンツです。",
"txtBkContentStatus": "コンテンツ状態"
} }
...@@ -10,6 +10,7 @@ ...@@ -10,6 +10,7 @@
<input type="checkbox" name="chkBkAllMarking" id="chkBkAllMarking" class="chkbx" checked="checked" /><label for="chkBkAllMarking" lang="txtBkMarking" class="lang"><!--マーキング--></label> <input type="checkbox" name="chkBkAllMarking" id="chkBkAllMarking" class="chkbx" checked="checked" /><label for="chkBkAllMarking" lang="txtBkMarking" class="lang"><!--マーキング--></label>
<input type="checkbox" name="chkBkAllMemo" id="chkBkAllMemo" class="chkbx" checked="checked" /><label for="chkBkAllMemo" lang="txtBkMemo" class="lang"><!--メモ--></label> <input type="checkbox" name="chkBkAllMemo" id="chkBkAllMemo" class="chkbx" checked="checked" /><label for="chkBkAllMemo" lang="txtBkMemo" class="lang"><!--メモ--></label>
<input type="checkbox" name="chkBkAllShiori" id="chkBkAllShiori" class="chkbx" checked="checked" /><label for="chkBkAllShiori" lang="txtBkShiori" class="lang"><!--しおり--></label> <input type="checkbox" name="chkBkAllShiori" id="chkBkAllShiori" class="chkbx" checked="checked" /><label for="chkBkAllShiori" lang="txtBkShiori" class="lang"><!--しおり--></label>
<input type="checkbox" name="chkBkAllContentStatus" id="chkBkAllContentStatus" class="chkbx" checked="checked" /><label for="chkBkAllContentStatus" lang="txtBkContentStatus" class="lang"><!--コンテンツ状態--></label>
</p> </p>
<!--</label>--> <!--</label>-->
</p> </p>
......
...@@ -976,10 +976,10 @@ BOOKMARK.IsExistContent = function(strContentId) { ...@@ -976,10 +976,10 @@ BOOKMARK.IsExistContent = function(strContentId) {
result["contentType"] = contentType; result["contentType"] = contentType;
// save content type // save content type
//BOOKMARK.contentTypes[strContentId] = contentType; BOOKMARK.contentTypes[strContentId] = contentType;
//BOOKMARK.contentName[strContentId] = data.contentData.contentName; BOOKMARK.contentName[strContentId] = data.contentData.contentName;
// save alert message level // save alert message level
//LIMIT_ACCESS_CONTENT.messageLevel[strContentId] = { alertMessageLevel: data.contentData.alertMessageLevel, alertMessage: data.contentData.alertMessage }; LIMIT_ACCESS_CONTENT.messageLevel[strContentId] = { alertMessageLevel: data.contentData.alertMessageLevel, alertMessage: data.contentData.alertMessage };
}, },
function (xmlHttpRequest, txtStatus, errorThrown) { function (xmlHttpRequest, txtStatus, errorThrown) {
......
...@@ -1096,7 +1096,11 @@ CONTENTSEARCH.drawEditImage = function(id) { ...@@ -1096,7 +1096,11 @@ CONTENTSEARCH.drawEditImage = function(id) {
ctx.drawImage(img, (c.width / 2) - (resizeImg[0] / 2) + 4, c.height - resizeImg[1] + 4, resizeImg[0], resizeImg[1]); ctx.drawImage(img, (c.width / 2) - (resizeImg[0] / 2) + 4, c.height - resizeImg[1] + 4, resizeImg[0], resizeImg[1]);
$("#loadingIcon" + id).fadeOut('slow', function () { $("#loadingIcon" + id).fadeOut('slow', function () {
$('#content-thumbnail' + id).fadeIn('slow'); $('#content-thumbnail' + id).fadeIn('slow');
}); });
//バックアップデータのステータス更新
HEADER.setContentStatus(id,0);
}; };
img.src = imgSrc; img.src = imgSrc;
......
...@@ -761,15 +761,33 @@ HISTORY.checkUserHasReadContent = function(contId, resourceVer, metaVer){ ...@@ -761,15 +761,33 @@ HISTORY.checkUserHasReadContent = function(contId, resourceVer, metaVer){
var contentType = HISTORY.returnContentType(contId); var contentType = HISTORY.returnContentType(contId);
//End Function : No.12 -- Editor : Le Long -- Date : 07/31/2013 -- Summary : Declare variable handle contentType and Thumbnail of content. //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 == 3 ){
contentStatus = 1; //NEW
} else if(bkContentStatus == 5){
contentStatus = 2; //UPDATE
}
if(readArr == null || readArr <= 0 || readArr == 'undefined'){ if(readArr == null || readArr <= 0 || readArr == 'undefined'){
imgThumb.onload = function(){ imgThumb.onload = function(){
var resizeImg = HISTORY.resizeResourceThumbnail(imgThumb, c.width, c.height); var resizeImg = HISTORY.resizeResourceThumbnail(imgThumb, c.width, c.height);
ctx.drawImage(imgThumb, c.width/2 - resizeImg[0]/2, 0, resizeImg[0], resizeImg[1]); ctx.drawImage(imgThumb, c.width/2 - resizeImg[0]/2, 0, resizeImg[0], resizeImg[1]);
imgIconNew.onload = function(){
ctx.drawImage(imgIconNew, c.width/2 - resizeImg[0]/2, 0); 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 {
HISTORY.showContentThumbnail(contId); HISTORY.showContentThumbnail(contId);
}; }
imgIconNew.src = COMMON.DEFAULT_IMG_CONTENT_NEW;
}; };
//Start Function : No.12 -- Editor : Le Long -- Date : 07/31/2013 -- Summary : Check contentType to set thumbnail. //Start Function : No.12 -- Editor : Le Long -- Date : 07/31/2013 -- Summary : Check contentType to set thumbnail.
...@@ -794,7 +812,22 @@ HISTORY.checkUserHasReadContent = function(contId, resourceVer, metaVer){ ...@@ -794,7 +812,22 @@ HISTORY.checkUserHasReadContent = function(contId, resourceVer, metaVer){
imgThumb.onload = function(){ imgThumb.onload = function(){
var resizeImg = HISTORY.resizeResourceThumbnail(imgThumb, c.width, c.height); var resizeImg = HISTORY.resizeResourceThumbnail(imgThumb, c.width, c.height);
ctx.drawImage(imgThumb, c.width/2 - resizeImg[0]/2, 0, resizeImg[0], resizeImg[1]); ctx.drawImage(imgThumb, c.width/2 - resizeImg[0]/2, 0, resizeImg[0], resizeImg[1]);
HISTORY.showContentThumbnail(contId);
if(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);
}
}; };
//Start Function : No.12 -- Editor : Le Long -- Date : 07/31/2013 -- Summary : Check contentType to set thumbnail. //Start Function : No.12 -- Editor : Le Long -- Date : 07/31/2013 -- Summary : Check contentType to set thumbnail.
if(contentThumbnail == '' || contentThumbnail == null){ if(contentThumbnail == '' || contentThumbnail == null){
...@@ -813,14 +846,20 @@ HISTORY.checkUserHasReadContent = function(contId, resourceVer, metaVer){ ...@@ -813,14 +846,20 @@ HISTORY.checkUserHasReadContent = function(contId, resourceVer, metaVer){
break; break;
} }
else{ else{
imgThumb.onload = function(){ imgThumb.onload = function(){
var resizeImg = HISTORY.resizeResourceThumbnail(imgThumb, c.width, c.height); var resizeImg = HISTORY.resizeResourceThumbnail(imgThumb, c.width, c.height);
ctx.drawImage(imgThumb, c.width/2 - resizeImg[0]/2, 0, resizeImg[0], resizeImg[1]); ctx.drawImage(imgThumb, c.width/2 - resizeImg[0]/2, 0, resizeImg[0], resizeImg[1]);
HISTORY.showContentThumbnail(contId);
imgIconNew.onload = function(){ if(contentStatus == null || contentStatus == 1){
ctx.drawImage(imgIconNew, c.width/2 - resizeImg[0]/2, 0); HISTORY.showContentThumbnail(contId);
}; imgIconNew.onload = function(){
imgIconNew.src = COMMON.DEFAULT_IMG_CONTENT_NEW; ctx.drawImage(imgIconNew, c.width/2 - resizeImg[0]/2, 0);
};
imgIconNew.src = COMMON.DEFAULT_IMG_CONTENT_NEW;
} else {
HISTORY.showContentThumbnail(contId);
}
}; };
//Start Function : No.12 -- Editor : Le Long -- Date : 07/31/2013 -- Summary : Check contentType to set thumbnail. //Start Function : No.12 -- Editor : Le Long -- Date : 07/31/2013 -- Summary : Check contentType to set thumbnail.
if(contentThumbnail == '' || contentThumbnail == null){ if(contentThumbnail == '' || contentThumbnail == null){
...@@ -850,11 +889,20 @@ HISTORY.checkUserHasReadContent = function(contId, resourceVer, metaVer){ ...@@ -850,11 +889,20 @@ HISTORY.checkUserHasReadContent = function(contId, resourceVer, metaVer){
imgThumb.onload = function(){ imgThumb.onload = function(){
var resizeImg = HISTORY.resizeResourceThumbnail(imgThumb, c.width, c.height); var resizeImg = HISTORY.resizeResourceThumbnail(imgThumb, c.width, c.height);
ctx.drawImage(imgThumb, c.width/2 - resizeImg[0]/2, 0, resizeImg[0], resizeImg[1]); ctx.drawImage(imgThumb, c.width/2 - resizeImg[0]/2, 0, resizeImg[0], resizeImg[1]);
HISTORY.showContentThumbnail(contId);
imgIconEdit.onload = function(){ if(contentStatus == 1){
ctx.drawImage(imgIconEdit, c.width/2 - resizeImg[0]/2, 0); HISTORY.showContentThumbnail(contId);
}; imgIconNew.onload = function(){
imgIconEdit.src = COMMON.DEFAULT_IMG_CONTENT_EDIT; ctx.drawImage(imgIconNew, c.width/2 - resizeImg[0]/2, 0);
};
imgIconNew.src = COMMON.DEFAULT_IMG_CONTENT_NEW;
} else {
HISTORY.showContentThumbnail(contId);
imgIconEdit.onload = function(){
ctx.drawImage(imgIconEdit, c.width/2 - resizeImg[0]/2, 0);
};
imgIconEdit.src = COMMON.DEFAULT_IMG_CONTENT_EDIT;
}
}; };
//Start Function : No.12 -- Editor : Le Long -- Date : 07/31/2013 -- Summary : Check contentType to set thumbnail. //Start Function : No.12 -- Editor : Le Long -- Date : 07/31/2013 -- Summary : Check contentType to set thumbnail.
if(contentThumbnail == '' || contentThumbnail == null){ if(contentThumbnail == '' || contentThumbnail == null){
...@@ -884,11 +932,20 @@ HISTORY.checkUserHasReadContent = function(contId, resourceVer, metaVer){ ...@@ -884,11 +932,20 @@ HISTORY.checkUserHasReadContent = function(contId, resourceVer, metaVer){
imgThumb.onload = function(){ imgThumb.onload = function(){
var resizeImg = HISTORY.resizeResourceThumbnail(imgThumb, c.width, c.height); var resizeImg = HISTORY.resizeResourceThumbnail(imgThumb, c.width, c.height);
ctx.drawImage(imgThumb, c.width/2 - resizeImg[0]/2, 0, resizeImg[0], resizeImg[1]); ctx.drawImage(imgThumb, c.width/2 - resizeImg[0]/2, 0, resizeImg[0], resizeImg[1]);
HISTORY.showContentThumbnail(contId);
imgIconEdit.onload = function(){ if(contentStatus == 1){
ctx.drawImage(imgIconEdit, c.width/2 - resizeImg[0]/2, 0); HISTORY.showContentThumbnail(contId);
}; imgIconNew.onload = function(){
imgIconEdit.src = COMMON.DEFAULT_IMG_CONTENT_EDIT; ctx.drawImage(imgIconNew, c.width/2 - resizeImg[0]/2, 0);
};
imgIconNew.src = COMMON.DEFAULT_IMG_CONTENT_NEW;
} else {
HISTORY.showContentThumbnail(contId);
imgIconEdit.onload = function(){
ctx.drawImage(imgIconEdit, c.width/2 - resizeImg[0]/2, 0);
};
imgIconEdit.src = COMMON.DEFAULT_IMG_CONTENT_EDIT;
}
}; };
//Start Function : No.12 -- Editor : Le Long -- Date : 07/31/2013 -- Summary : Check contentType to set thumbnail. //Start Function : No.12 -- Editor : Le Long -- Date : 07/31/2013 -- Summary : Check contentType to set thumbnail.
if(contentThumbnail == '' || contentThumbnail == null){ if(contentThumbnail == '' || contentThumbnail == null){
...@@ -940,7 +997,11 @@ HISTORY.drawEditImage = function(id) { ...@@ -940,7 +997,11 @@ HISTORY.drawEditImage = function(id) {
ctx.drawImage(img, (c.width / 2) - (resizeImg[0] / 2) + 4, c.height - resizeImg[1] + 4, resizeImg[0], resizeImg[1]); ctx.drawImage(img, (c.width / 2) - (resizeImg[0] / 2) + 4, c.height - resizeImg[1] + 4, resizeImg[0], resizeImg[1]);
$("#loadingIcon" + id).fadeOut('slow', function () { $("#loadingIcon" + id).fadeOut('slow', function () {
$('#content-thumbnail' + id).fadeIn('slow'); $('#content-thumbnail' + id).fadeIn('slow');
}); });
//バックアップデータのステータス更新
HEADER.setContentStatus(id,0);
}; };
img.src = imgSrc; img.src = imgSrc;
......
...@@ -40,7 +40,8 @@ $(document).ready(function () { ...@@ -40,7 +40,8 @@ $(document).ready(function () {
// Check to hide/show backup button // Check to hide/show backup button
if (ClientData.isChangedBookmark() == true if (ClientData.isChangedBookmark() == true
|| ClientData.isChangedMarkingData() == true || ClientData.isChangedMarkingData() == true
|| ClientData.isChangedMemo() == true) { || ClientData.isChangedMemo() == true
|| ClientData.isChangedContentStatus() == true) {
$("#dspOptBk").show(); $("#dspOptBk").show();
// check disabled button backup // check disabled button backup
...@@ -75,8 +76,9 @@ $(document).ready(function () { ...@@ -75,8 +76,9 @@ $(document).ready(function () {
var isExistMarking = SETTINGS.IsExistBackupFile('Marking.json', 2); var isExistMarking = SETTINGS.IsExistBackupFile('Marking.json', 2);
var isExistContentMemo = SETTINGS.IsExistBackupFile('ContentMemo.json', 1); var isExistContentMemo = SETTINGS.IsExistBackupFile('ContentMemo.json', 1);
var isExistBookmark = SETTINGS.IsExistBackupFile('Bookmark.json', 4); var isExistBookmark = SETTINGS.IsExistBackupFile('Bookmark.json', 4);
var isExistContentStatus = SETTINGS.IsExistBackupFile('ContentStatus.json', 8);
if (isExistMarking || isExistContentMemo || isExistBookmark) { if (isExistMarking || isExistContentMemo || isExistBookmark || isExistContentStatus) {
$("#dspOptRes").css('visibility', ''); $("#dspOptRes").css('visibility', '');
if (!isExistMarking) { if (!isExistMarking) {
...@@ -100,6 +102,13 @@ $(document).ready(function () { ...@@ -100,6 +102,13 @@ $(document).ready(function () {
$('#chkopResShiori').removeAttr('disabled'); $('#chkopResShiori').removeAttr('disabled');
} }
if (!isExistContentStatus) {
$('#chkopResContentStatus').attr('disabled', 'disabled').removeAttr('checked');
}
else {
$('#chkopResContentStatus').removeAttr('disabled');
}
// check disabled button restore // check disabled button restore
HEADER.checkDisabledButton('#dlgConfirmRestore .option_backup input', '#dspOptRes_OK'); HEADER.checkDisabledButton('#dlgConfirmRestore .option_backup input', '#dspOptRes_OK');
...@@ -267,15 +276,16 @@ SETTINGS.dspOptBk_OK_Click = function(e) { ...@@ -267,15 +276,16 @@ SETTINGS.dspOptBk_OK_Click = function(e) {
var isBackupMarking = $('#chkopBkMarking').attr('checked') == 'checked'; var isBackupMarking = $('#chkopBkMarking').attr('checked') == 'checked';
var isBackupMemo = $('#chkopBkMemo').attr('checked') == 'checked'; var isBackupMemo = $('#chkopBkMemo').attr('checked') == 'checked';
var isBackupBookmark = $('#chkopBkShiori').attr('checked') == 'checked'; var isBackupBookmark = $('#chkopBkShiori').attr('checked') == 'checked';
var isBackupContentStatus = $('#chkopBkContentStatus').attr('checked') == 'checked';
if (!isBackupMarking && !isBackupMemo && !isBackupBookmark) if (!isBackupMarking && !isBackupMemo && !isBackupBookmark && !isBackupContentStatus)
{ {
SETTINGS.closeBackup(); SETTINGS.closeBackup();
return; return;
} }
// call backup file at header // call backup file at header
HEADER.DoBackup(isBackupMarking, isBackupMemo, isBackupBookmark, false, HEADER.DoBackup(isBackupMarking, isBackupMemo, isBackupBookmark, isBackupContentStatus, false,
function () { function () {
// Check to hide/show backup button // Check to hide/show backup button
...@@ -291,7 +301,10 @@ SETTINGS.dspOptBk_OK_Click = function(e) { ...@@ -291,7 +301,10 @@ SETTINGS.dspOptBk_OK_Click = function(e) {
if (isBackupBookmark && !ClientData.isChangedBookmark()) { if (isBackupBookmark && !ClientData.isChangedBookmark()) {
$('#chkopResShiori').removeAttr('disabled'); $('#chkopResShiori').removeAttr('disabled');
} }
if (isBackupContentStatus && !ClientData.isChangedContentStatus()) {
$('#chkopResContentStatus').removeAttr('disabled');
}
SETTINGS.closeBackup(); SETTINGS.closeBackup();
}); });
...@@ -299,7 +312,7 @@ SETTINGS.dspOptBk_OK_Click = function(e) { ...@@ -299,7 +312,7 @@ SETTINGS.dspOptBk_OK_Click = function(e) {
// set status button backup and checkbox option // set status button backup and checkbox option
SETTINGS.setStatusButtonBackup = function() { SETTINGS.setStatusButtonBackup = function() {
if (ClientData.isChangedBookmark() == true || ClientData.isChangedMarkingData() == true || ClientData.isChangedMemo() == true) { if (ClientData.isChangedBookmark() == true || ClientData.isChangedMarkingData() == true || ClientData.isChangedMemo() == true || ClientData.isChangedContentStatus() == true) {
if (ClientData.isChangedBookmark() != true) { if (ClientData.isChangedBookmark() != true) {
$('#chkopBkShiori').attr('disabled', 'disabled').removeAttr('checked'); $('#chkopBkShiori').attr('disabled', 'disabled').removeAttr('checked');
...@@ -310,6 +323,10 @@ SETTINGS.setStatusButtonBackup = function() { ...@@ -310,6 +323,10 @@ SETTINGS.setStatusButtonBackup = function() {
if (ClientData.isChangedMemo() != true) { if (ClientData.isChangedMemo() != true) {
$('#chkopBkMemo').attr('disabled', 'disabled').removeAttr('checked'); $('#chkopBkMemo').attr('disabled', 'disabled').removeAttr('checked');
} }
if (ClientData.isChangedContentStatus() != true) {
$('#chkopBkContentStatus').attr('disabled', 'disabled').removeAttr('checked');
}
$("#dspOptBk").show(); $("#dspOptBk").show();
} }
else { else {
...@@ -341,9 +358,10 @@ SETTINGS.dspOptRes_OK_Click = function(e) { ...@@ -341,9 +358,10 @@ SETTINGS.dspOptRes_OK_Click = function(e) {
var isRestoreMarking = $('#chkopResMarking').attr('checked') == 'checked'; var isRestoreMarking = $('#chkopResMarking').attr('checked') == 'checked';
var isRestoreMemo = $('#chkopResMemo').attr('checked') == 'checked'; var isRestoreMemo = $('#chkopResMemo').attr('checked') == 'checked';
var isRestoreBookmark = $('#chkopResShiori').attr('checked') == 'checked'; var isRestoreBookmark = $('#chkopResShiori').attr('checked') == 'checked';
if (!isRestoreMarking && !isRestoreMemo && !isRestoreBookmark) { var isRestoreContentStatus = $('#chkopResContentStatus').attr('checked') == 'checked';
if (!isRestoreMarking && !isRestoreMemo && !isRestoreBookmark && !isRestoreContentStatus) {
SETTINGS.closeRestore(); SETTINGS.closeRestore();
return; return;
} }
$().toastmessage({ position: 'middle-center' }); $().toastmessage({ position: 'middle-center' });
...@@ -391,6 +409,20 @@ SETTINGS.dspOptRes_OK_Click = function(e) { ...@@ -391,6 +409,20 @@ SETTINGS.dspOptRes_OK_Click = function(e) {
} }
} }
if (isRestoreContentStatus) {
// restore ContentStatus data
var res = SETTINGS.restoreContentStatus();
if (!res) {
$('#divResultMessage').append("<div class='toast-item-image-error toast-item-message'>" + I18N.i18nText('txtBkContentStatus') + " " + I18N.i18nText('msgRestoreFailed') + "</div>");
}
else {
$('#divResultMessage').append("<div class='toast-item-image-success toast-item-message'>" + I18N.i18nText('txtBkContentStatus') + " " + I18N.i18nText('msgRestoreSuccess') + "</div>");
}
}
// set status button backup // set status button backup
//SETTINGS.setStatusButtonBackup(); //SETTINGS.setStatusButtonBackup();
...@@ -471,6 +503,28 @@ SETTINGS.restoreMarkingData = function() ...@@ -471,6 +503,28 @@ SETTINGS.restoreMarkingData = function()
return result; return result;
}; };
/*
* Call api to restore ContentStatus data
*/
SETTINGS.restoreContentStatus = function()
{
var result = false;
AVWEB.avwCmsApiSync(ClientData.userInfo_accountPath(), "getBackupFile", "post",
{ sid: ClientData.userInfo_sid(), filename: "ContentStatus.json" }, // deviceType: '4',
function (data) {
if (data) {
COMMON.getDataContentStatus(data);
ClientData.isChangedContentStatus(false);
result = true;
}
}
,
function (xhr, b, c) {
}
);
return result;
};
// Cancel for restore // Cancel for restore
SETTINGS.dspOptRes_Cancel_Click = function(e) { SETTINGS.dspOptRes_Cancel_Click = function(e) {
...@@ -553,6 +607,13 @@ SETTINGS.dspSave_Click = function(e) { ...@@ -553,6 +607,13 @@ SETTINGS.dspSave_Click = function(e) {
ClientData.userOpt_bkShioriFlag(0); ClientData.userOpt_bkShioriFlag(0);
} }
if ($("#chkBkContentStatus").attr('checked') == 'checked') {
ClientData.userOpt_bkContentStatusFlag(1);
}
else {
ClientData.userOpt_bkContentStatusFlag(0);
}
// save config page transition No.4 // save config page transition No.4
ClientData.userOpt_pageTransition($('#cboAnimation').val()); ClientData.userOpt_pageTransition($('#cboAnimation').val());
...@@ -680,13 +741,18 @@ SETTINGS.dspOptBk_Click = function(e) { ...@@ -680,13 +741,18 @@ SETTINGS.dspOptBk_Click = function(e) {
else { else {
$("#chkopBkMemo").attr('checked', 'checked'); $("#chkopBkMemo").attr('checked', 'checked');
} }
if (ClientData.userOpt_bkShioriFlag() == 0) { if (ClientData.userOpt_bkShioriFlag() == 0) {
$("#chkopBkShiori").removeAttr('checked'); $("#chkopBkShiori").removeAttr('checked');
} }
else { else {
$("#chkopBkShiori").attr('checked', 'checked'); $("#chkopBkShiori").attr('checked', 'checked');
} }
if (ClientData.userOpt_bkContentStatusFlag() == 0) {
$("#chkopBkContentStatus").removeAttr('checked');
}
else {
$("#chkopBkContentStatus").attr('checked', 'checked');
}
// check content is changed // check content is changed
...@@ -710,6 +776,12 @@ SETTINGS.dspOptBk_Click = function(e) { ...@@ -710,6 +776,12 @@ SETTINGS.dspOptBk_Click = function(e) {
else { else {
$('#chkopBkMarking').removeAttr('disabled'); $('#chkopBkMarking').removeAttr('disabled');
} }
if (!ClientData.isChangedContentStatus()) {
$('#chkopBkContentStatus').attr('disabled', 'disabled').removeAttr('checked');
}
else {
$('#chkopBkContentStatus').removeAttr('disabled');
}
HEADER.setDisabledButton('#dlgConfirmBackup .option_backup input', '#dspOptBk_OK'); HEADER.setDisabledButton('#dlgConfirmBackup .option_backup input', '#dspOptBk_OK');
......
...@@ -158,6 +158,7 @@ ...@@ -158,6 +158,7 @@
<input type="checkbox" id="chkBkMarking" class="chkbx" checked="checked" /><label id="txtBkMarking" for="chkBkMarking" lang="txtBkMarking" 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="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="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> </label>
</p> </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="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>
...@@ -193,6 +194,25 @@ ...@@ -193,6 +194,25 @@
<div id="inc_backup"></div> <div id="inc_backup"></div>
<section class="sectionbackup" id="dlgConfirmBackup">
<h1><label class="title lang" lang="txtBackupTitle">バックアップ確認</label></h1>
<!--<p class="message"><label id="txtBkMsg" lang="txtBkMsg" class="lang">サーバにバックアップしますか?</label></p>-->
<p class="message">
<label lang="txtBkSelectData" class="lang">バックアップするデータを選択してください。</label>
</p>
<p class="message-options">
<!--<label class="option_backup">-->
<p class="option_backup" style="font-size: 13px;margin-left:50px">
<input type="checkbox" name="chkopBkMarking" id="chkopBkMarking" class="chkopbx" checked="checked" /><label for="chkopBkMarking" lang="txtBkMarking" class="lang">マーキング</label>
<input type="checkbox" name="chkopBkMemo" id="chkopBkMemo" class="chkopbx" checked="checked" /><label for="chkopBkMemo" lang="txtBkMemo" class="lang">メモ</label>
<input type="checkbox" name="chkopBkShiori" id="chkopBkShiori" class="chkopbx" checked="checked" /><label for="chkopBkShiori" lang="txtBkShiori" class="lang">しおり</label>
<input type="checkbox" name="chkopBkContentStatus" id="chkopBkContentStatus" class="chkopbx" checked="checked" /><label for="chkopBkContentStatus" lang="txtBkContentStatus" class="lang">コンテンツ状態</label>
</P>
<!--</label>-->
</p>
<p class="backupbtn"><a class="ok lang" href="#" id="dspOptBk_OK" lang="dspOK">OK</a><a class="cancel lang" href="#" lang="dspCancel" id="dspOptBk_Cancel">キャンセル</a></p>
</section>
<section class="sectionrestore" id="dlgConfirmRestore"> <section class="sectionrestore" id="dlgConfirmRestore">
<h1 class="title lang" lang="txtRestoreTitle"><!--リストア確認--></h1> <h1 class="title lang" lang="txtRestoreTitle"><!--リストア確認--></h1>
<p class="message"> <p class="message">
...@@ -202,9 +222,10 @@ ...@@ -202,9 +222,10 @@
<p class="message-options"> <p class="message-options">
<!--<label class="option_backup">--> <!--<label class="option_backup">-->
<p class="option_backup" style="font-size: 13px;margin-left:50px"> <p class="option_backup" style="font-size: 13px;margin-left:50px">
<input type="checkbox" name="chkopBkMarking" id="chkopBkMarking" class="chkopbx" checked="checked" /><label for="chkopBkMarking" lang="txtBkMarking" class="lang">マーキング</label> <input type="checkbox" name="chkopResMarking" id="chkopResMarking" class="chkopbx" checked="checked" /><label for="chkopResMarking" lang="txtBkMarking" class="lang">マーキング</label>
<input type="checkbox" name="chkopBkMemo" id="chkopBkMemo" class="chkopbx" checked="checked" /><label for="chkopBkMemo" lang="txtBkMemo" class="lang">メモ</label> <input type="checkbox" name="chkopResMemo" id="chkopResMemo" class="chkopbx" checked="checked" /><label for="chkopResMemo" lang="txtBkMemo" class="lang">メモ</label>
<input type="checkbox" name="chkopBkShiori" id="chkopBkShiori" class="chkopbx" checked="checked" /><label for="chkopBkShiori" lang="txtBkShiori" class="lang">しおり</label> <input type="checkbox" name="chkopResShiori" id="chkopResShiori" class="chkopbx" checked="checked" /><label for="chkopResShiori" lang="txtBkShiori" class="lang">しおり</label>
<input type="checkbox" name="chkopResContentStatus" id="chkopResContentStatus" class="chkopbx" checked="checked" /><label for="chkopResContentStatus" lang="txtBkContentStatus" class="lang">コンテンツ状態</label>
</P> </P>
<!--</label>--> <!--</label>-->
</p> </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