Commit 3b0d015a by Masaru Abe

隠しグループ対応

parent 308675b5
...@@ -42,7 +42,8 @@ $(document).ready(function () { ...@@ -42,7 +42,8 @@ $(document).ready(function () {
BOOKMARK.ClearGrid(); BOOKMARK.ClearGrid();
if (ClientData.BookMarkData().length == 0) { //if (ClientData.BookMarkData().length == 0) {
if(BOOKMARK.collection_contents.length == 0){
// Show error // Show error
$("#msgShioriNotExists").show(); $("#msgShioriNotExists").show();
$("#dspDelete").hide(); $("#dspDelete").hide();
...@@ -273,7 +274,7 @@ BOOKMARK.dspDelete_Click = function() { ...@@ -273,7 +274,7 @@ BOOKMARK.dspDelete_Click = function() {
}; };
// Show detail content // Show detail content
BOOKMARK.ShowBookmark = function() { BOOKMARK.ShowBookmark = function(showList) {
if (AVWEB.avwHasError()) { if (AVWEB.avwHasError()) {
return; return;
} }
...@@ -283,17 +284,17 @@ BOOKMARK.ShowBookmark = function() { ...@@ -283,17 +284,17 @@ BOOKMARK.ShowBookmark = function() {
var contentid = ""; var contentid = "";
var pageNo = 0; var pageNo = 0;
if (ClientData.BookMarkData().length > 0) { if (showList.length > 0) {
$("#dspDelete").show(); $("#dspDelete").show();
$("#dspDelete1").show(); $("#dspDelete1").show();
} }
//TotalThread = ClientData.BookMarkData().length; //TotalThread = ClientData.BookMarkData().length;
for (var nIndex = ClientData.BookMarkData().length - 1; nIndex >= 0; nIndex--) { for (var nIndex = showList.length - 1; nIndex >= 0; nIndex--) {
hasMarking = false; hasMarking = false;
hasMemo = false; hasMemo = false;
contentid = ClientData.BookMarkData()[nIndex].contentid; contentid = showList[nIndex].contentid;
pageNo = ClientData.BookMarkData()[nIndex].pageNo; pageNo = showList[nIndex].pageNo;
// Check if contentid has marking // Check if contentid has marking
for (var nIndex1 = 0; nIndex1 < ClientData.MarkingData().length; nIndex1++) { for (var nIndex1 = 0; nIndex1 < ClientData.MarkingData().length; nIndex1++) {
...@@ -373,6 +374,7 @@ BOOKMARK.SortTitleName = function(isAsc) { ...@@ -373,6 +374,7 @@ BOOKMARK.SortTitleName = function(isAsc) {
var arrSource = ClientData.BookMarkData(); var arrSource = ClientData.BookMarkData();
var arrTarget = []; var arrTarget = [];
var arrShowList = [];
var strTemp = ""; var strTemp = "";
var nTempIndex = 0; var nTempIndex = 0;
var isStop = false; var isStop = false;
...@@ -403,6 +405,15 @@ BOOKMARK.SortTitleName = function(isAsc) { ...@@ -403,6 +405,15 @@ BOOKMARK.SortTitleName = function(isAsc) {
} }
// Add to target array // Add to target array
arrTarget.push(arrSource[nTempIndex]); arrTarget.push(arrSource[nTempIndex]);
//表示対象なら表示用リストにプッシュ
for (var nIndex2 = 0; nIndex2 < BOOKMARK.collection_contents.length; nIndex2++) {
if (BOOKMARK.collection_contents[nIndex2].contentid == arrSource[nTempIndex].contentid) {
arrShowList.push(arrSource[nTempIndex]);
break;
}
}
// Remove min item from source array // Remove min item from source array
arrSource.splice(nTempIndex, 1); arrSource.splice(nTempIndex, 1);
} }
...@@ -412,7 +423,7 @@ BOOKMARK.SortTitleName = function(isAsc) { ...@@ -412,7 +423,7 @@ BOOKMARK.SortTitleName = function(isAsc) {
} }
BOOKMARK.ClearGrid(); BOOKMARK.ClearGrid();
ClientData.BookMarkData(arrTarget); ClientData.BookMarkData(arrTarget);
BOOKMARK.ShowBookmark(); BOOKMARK.ShowBookmark(arrShowList);
}; };
// Clear all rows of grid // Clear all rows of grid
BOOKMARK.ClearGrid = function() { BOOKMARK.ClearGrid = function() {
...@@ -430,6 +441,7 @@ BOOKMARK.SortTitleNameKana = function(isAsc) { ...@@ -430,6 +441,7 @@ BOOKMARK.SortTitleNameKana = function(isAsc) {
var arrSource = ClientData.BookMarkData(); var arrSource = ClientData.BookMarkData();
var arrTarget = []; var arrTarget = [];
var arrShowList = [];
var strTemp = ""; var strTemp = "";
var nTempIndex = 0; var nTempIndex = 0;
var isStop = false; var isStop = false;
...@@ -460,6 +472,15 @@ BOOKMARK.SortTitleNameKana = function(isAsc) { ...@@ -460,6 +472,15 @@ BOOKMARK.SortTitleNameKana = function(isAsc) {
} }
// Add to target array // Add to target array
arrTarget.push(arrSource[nTempIndex]); arrTarget.push(arrSource[nTempIndex]);
//表示対象なら表示用リストにプッシュ
for (var nIndex2 = 0; nIndex2 < BOOKMARK.collection_contents.length; nIndex2++) {
if (BOOKMARK.collection_contents[nIndex2].contentid == arrSource[nTempIndex].contentid) {
arrShowList.push(arrSource[nTempIndex]);
break;
}
}
// Remove min item from source array // Remove min item from source array
arrSource.splice(nTempIndex, 1); arrSource.splice(nTempIndex, 1);
} }
...@@ -469,7 +490,7 @@ BOOKMARK.SortTitleNameKana = function(isAsc) { ...@@ -469,7 +490,7 @@ BOOKMARK.SortTitleNameKana = function(isAsc) {
} }
BOOKMARK.ClearGrid(); BOOKMARK.ClearGrid();
ClientData.BookMarkData(arrTarget); ClientData.BookMarkData(arrTarget);
BOOKMARK.ShowBookmark(); BOOKMARK.ShowBookmark(arrShowList);
}; };
// Sort by publish date // Sort by publish date
BOOKMARK.SortPubDate = function(isAsc) { BOOKMARK.SortPubDate = function(isAsc) {
...@@ -478,6 +499,7 @@ BOOKMARK.SortPubDate = function(isAsc) { ...@@ -478,6 +499,7 @@ BOOKMARK.SortPubDate = function(isAsc) {
var arrSource = ClientData.BookMarkData(); var arrSource = ClientData.BookMarkData();
var arrTarget = []; var arrTarget = [];
var arrShowList = [];
var dateTemp = undefined; var dateTemp = undefined;
var nTempIndex = 0; var nTempIndex = 0;
var isStop = false; var isStop = false;
...@@ -508,6 +530,15 @@ BOOKMARK.SortPubDate = function(isAsc) { ...@@ -508,6 +530,15 @@ BOOKMARK.SortPubDate = function(isAsc) {
} }
// Add to target array // Add to target array
arrTarget.push(arrSource[nTempIndex]); arrTarget.push(arrSource[nTempIndex]);
//表示対象なら表示用リストにプッシュ
for (var nIndex2 = 0; nIndex2 < BOOKMARK.collection_contents.length; nIndex2++) {
if (BOOKMARK.collection_contents[nIndex2].contentid == arrSource[nTempIndex].contentid) {
arrShowList.push(arrSource[nTempIndex]);
break;
}
}
// Remove min item from source array // Remove min item from source array
arrSource.splice(nTempIndex, 1); arrSource.splice(nTempIndex, 1);
} }
...@@ -517,7 +548,7 @@ BOOKMARK.SortPubDate = function(isAsc) { ...@@ -517,7 +548,7 @@ BOOKMARK.SortPubDate = function(isAsc) {
} }
BOOKMARK.ClearGrid(); BOOKMARK.ClearGrid();
ClientData.BookMarkData(arrTarget); ClientData.BookMarkData(arrTarget);
BOOKMARK.ShowBookmark(); BOOKMARK.ShowBookmark(arrShowList);
}; };
/* /*
Update information of specified bookmark Update information of specified bookmark
...@@ -647,7 +678,6 @@ BOOKMARK.insertRow = function(contentid, pageThumbnail, pageTitle, pageText, pag ...@@ -647,7 +678,6 @@ BOOKMARK.insertRow = function(contentid, pageThumbnail, pageTitle, pageText, pag
newRow +='<li>'; newRow +='<li>';
newRow += "<a class='read read_open lang' name='dspRead' value='{\"contentid\":\"" + contentid + "\", \"pageNo\":\"" + pageNo + "\", \"contentType\":\"" + contentType + "\" }' lang='txtRead'>" + I18N.i18nText('txtRead') + "</a>"; newRow += "<a class='read read_open lang' name='dspRead' value='{\"contentid\":\"" + contentid + "\", \"pageNo\":\"" + pageNo + "\", \"contentType\":\"" + contentType + "\" }' lang='txtRead'>" + I18N.i18nText('txtRead') + "</a>";
//console.log("BOOKMARK.download[contentid]:" + BOOKMARK.download[contentid]);
if( BOOKMARK.download[contentid] == '1' ){ if( BOOKMARK.download[contentid] == '1' ){
newRow += "<a class='read read_download' name='dspDownload' contentid='" + contentid + "'>ダウンロード</a>"; newRow += "<a class='read read_download' name='dspDownload' contentid='" + contentid + "'>ダウンロード</a>";
} }
...@@ -865,7 +895,10 @@ BOOKMARK.SyncContent = function() { ...@@ -865,7 +895,10 @@ BOOKMARK.SyncContent = function() {
// ================================== // ==================================
else { else {
// Add nromal content // Add nromal content
BOOKMARK.AddContent(oneBookMark.contentid, BOOKMARK.IsExistContent(oneBookMark.contentid)["contentType"]); var result = BOOKMARK.IsExistContentAuthGroup(oneBookMark.contentid);
if( result["isExisted"] == true ){
BOOKMARK.AddContent(oneBookMark.contentid, result["contentType"]);
}
} }
} }
} }
...@@ -891,9 +924,55 @@ BOOKMARK.IsExistContent = function(strContentId) { ...@@ -891,9 +924,55 @@ BOOKMARK.IsExistContent = function(strContentId) {
sid: ClientData.userInfo_sid(), sid: ClientData.userInfo_sid(),
getType: '1', getType: '1',
contentId: strContentId, contentId: strContentId,
authCode: "0"
};
result["isExisted"] = isExisted;
AVWEB.avwCmsApiSync(ClientData.userInfo_accountPath(), "webGetContent", 'GET', params,
function (data) {
isExisted = true;
contentType = data.contentData.contentType;
result["isExisted"] = isExisted;
result["contentType"] = contentType;
// save content type
//BOOKMARK.contentTypes[strContentId] = contentType;
//BOOKMARK.contentName[strContentId] = data.contentData.contentName;
//BOOKMARK.download[strContentId] = data.download;
// save alert message level
//LIMIT_ACCESS_CONTENT.messageLevel[strContentId] = { alertMessageLevel: data.contentData.alertMessageLevel, alertMessage: data.contentData.alertMessage };
},
function (xmlHttpRequest, txtStatus, errorThrown) {
if (xmlHttpRequest.status == 404) {
isExisted = false;
}
else {
// Show system error
isExisted = true; // Mark this flag to prevent bookmarks from deleting
AVWEB.showSystemError();
}
});
return result;
};
/*
Check content whether existed or not
*/
BOOKMARK.IsExistContentAuthGroup = function(strContentId) {
var isExisted = false;
var contentType = '';
var result = [];
var params = {
sid: ClientData.userInfo_sid(),
getType: '1',
contentId: strContentId,
authCode: ClientData.authCode() authCode: ClientData.authCode()
}; };
result["isExisted"] = isExisted;
AVWEB.avwCmsApiSync(ClientData.userInfo_accountPath(), "webGetContent", 'GET', params, AVWEB.avwCmsApiSync(ClientData.userInfo_accountPath(), "webGetContent", 'GET', params,
function (data) { function (data) {
isExisted = true; isExisted = true;
...@@ -902,8 +981,6 @@ BOOKMARK.IsExistContent = function(strContentId) { ...@@ -902,8 +981,6 @@ BOOKMARK.IsExistContent = function(strContentId) {
result["isExisted"] = isExisted; result["isExisted"] = isExisted;
result["contentType"] = contentType; result["contentType"] = contentType;
//console.log("API BOOKMARK.download:" + strContentId + ":" + data.download);
// 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;
...@@ -926,6 +1003,7 @@ BOOKMARK.IsExistContent = function(strContentId) { ...@@ -926,6 +1003,7 @@ BOOKMARK.IsExistContent = function(strContentId) {
return result; return result;
}; };
/* /*
---------------------------------------------------------------------------- ----------------------------------------------------------------------------
Setting dialog [ end ] Setting dialog [ end ]
......
...@@ -865,7 +865,10 @@ HEADER.getPushMessageNew = function() ...@@ -865,7 +865,10 @@ HEADER.getPushMessageNew = function()
} }
} }
//$('.notification-pushmessage').hide(); //$('.notification-pushmessage').hide();
var params = { "sid": ClientData.userInfo_sid()}; var params = {
"sid": ClientData.userInfo_sid(),
"authCode": ClientData.authCode()
};
AVWEB.avwCmsApi( AVWEB.avwCmsApi(
ClientData.userInfo_accountPath(), ClientData.userInfo_accountPath(),
"webPushMessageNew", "webPushMessageNew",
...@@ -924,21 +927,28 @@ HEADER.getPushMessageList = function() { ...@@ -924,21 +927,28 @@ HEADER.getPushMessageList = function() {
var from = (HEADER.currentPagePushMessage - 1) * pushPageCount + 1; var from = (HEADER.currentPagePushMessage - 1) * pushPageCount + 1;
var to = HEADER.currentPagePushMessage * pushPageCount; var to = HEADER.currentPagePushMessage * pushPageCount;
var params = { "sid": ClientData.userInfo_sid(), "recordFrom": from, "recordTo": to }; var params = {
AVWEB.avwCmsApiSync(ClientData.userInfo_accountPath(), "webPushMessageList", "post", params, "sid": ClientData.userInfo_sid(),
function (data) { "recordFrom": from,
"recordTo": to,
// reset number message "authCode": ClientData.authCode()
ClientData.pushInfo_newMsgNumber(0); };
AVWEB.avwCmsApiSync(
// hide number new message ClientData.userInfo_accountPath(),
$('#numbermessage').html(''); "webPushMessageList",
"post",
HEADER.showListPushMessage(data); params,
}, function (data) {
function (xhr, b, c) { // reset number message
AVWEB.showSystemError(); ClientData.pushInfo_newMsgNumber(0);
}); // hide number new message
$('#numbermessage').html('');
HEADER.showListPushMessage(data);
},
function (xhr, b, c) {
AVWEB.showSystemError();
}
);
}; };
// get string from date crate pushmessage // get string from date crate pushmessage
......
...@@ -1228,7 +1228,7 @@ HISTORY.IsExistContent = function(strContentId) { ...@@ -1228,7 +1228,7 @@ HISTORY.IsExistContent = function(strContentId) {
sid: ClientData.userInfo_sid(), sid: ClientData.userInfo_sid(),
getType: '1', getType: '1',
contentId: strContentId, contentId: strContentId,
authCode: ClientData.authCode() authCode: "0"
}; };
AVWEB.avwCmsApiSync(ClientData.userInfo_accountPath(), "webGetContent", 'GET', params, AVWEB.avwCmsApiSync(ClientData.userInfo_accountPath(), "webGetContent", 'GET', params,
function (data) { function (data) {
......
...@@ -2338,7 +2338,7 @@ HOME.IsExistContent = function(strContentId) { ...@@ -2338,7 +2338,7 @@ HOME.IsExistContent = function(strContentId) {
sid: ClientData.userInfo_sid(), sid: ClientData.userInfo_sid(),
getType: '1', getType: '1',
contentId: strContentId, contentId: strContentId,
authCode: ClientData.authCode() authCode: "0"
}; };
AVWEB.avwCmsApiSync(ClientData.userInfo_accountPath(), "webGetContent", 'GET', params, AVWEB.avwCmsApiSync(ClientData.userInfo_accountPath(), "webGetContent", 'GET', params,
function (data) { function (data) {
......
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