Commit 3b0d015a by Masaru Abe

隠しグループ対応

parent 308675b5
......@@ -42,7 +42,8 @@ $(document).ready(function () {
BOOKMARK.ClearGrid();
if (ClientData.BookMarkData().length == 0) {
//if (ClientData.BookMarkData().length == 0) {
if(BOOKMARK.collection_contents.length == 0){
// Show error
$("#msgShioriNotExists").show();
$("#dspDelete").hide();
......@@ -273,7 +274,7 @@ BOOKMARK.dspDelete_Click = function() {
};
// Show detail content
BOOKMARK.ShowBookmark = function() {
BOOKMARK.ShowBookmark = function(showList) {
if (AVWEB.avwHasError()) {
return;
}
......@@ -283,17 +284,17 @@ BOOKMARK.ShowBookmark = function() {
var contentid = "";
var pageNo = 0;
if (ClientData.BookMarkData().length > 0) {
if (showList.length > 0) {
$("#dspDelete").show();
$("#dspDelete1").show();
}
//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;
hasMemo = false;
contentid = ClientData.BookMarkData()[nIndex].contentid;
pageNo = ClientData.BookMarkData()[nIndex].pageNo;
contentid = showList[nIndex].contentid;
pageNo = showList[nIndex].pageNo;
// Check if contentid has marking
for (var nIndex1 = 0; nIndex1 < ClientData.MarkingData().length; nIndex1++) {
......@@ -373,6 +374,7 @@ BOOKMARK.SortTitleName = function(isAsc) {
var arrSource = ClientData.BookMarkData();
var arrTarget = [];
var arrShowList = [];
var strTemp = "";
var nTempIndex = 0;
var isStop = false;
......@@ -403,6 +405,15 @@ BOOKMARK.SortTitleName = function(isAsc) {
}
// Add to target array
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
arrSource.splice(nTempIndex, 1);
}
......@@ -412,7 +423,7 @@ BOOKMARK.SortTitleName = function(isAsc) {
}
BOOKMARK.ClearGrid();
ClientData.BookMarkData(arrTarget);
BOOKMARK.ShowBookmark();
BOOKMARK.ShowBookmark(arrShowList);
};
// Clear all rows of grid
BOOKMARK.ClearGrid = function() {
......@@ -430,6 +441,7 @@ BOOKMARK.SortTitleNameKana = function(isAsc) {
var arrSource = ClientData.BookMarkData();
var arrTarget = [];
var arrShowList = [];
var strTemp = "";
var nTempIndex = 0;
var isStop = false;
......@@ -460,6 +472,15 @@ BOOKMARK.SortTitleNameKana = function(isAsc) {
}
// Add to target array
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
arrSource.splice(nTempIndex, 1);
}
......@@ -469,7 +490,7 @@ BOOKMARK.SortTitleNameKana = function(isAsc) {
}
BOOKMARK.ClearGrid();
ClientData.BookMarkData(arrTarget);
BOOKMARK.ShowBookmark();
BOOKMARK.ShowBookmark(arrShowList);
};
// Sort by publish date
BOOKMARK.SortPubDate = function(isAsc) {
......@@ -478,6 +499,7 @@ BOOKMARK.SortPubDate = function(isAsc) {
var arrSource = ClientData.BookMarkData();
var arrTarget = [];
var arrShowList = [];
var dateTemp = undefined;
var nTempIndex = 0;
var isStop = false;
......@@ -508,6 +530,15 @@ BOOKMARK.SortPubDate = function(isAsc) {
}
// Add to target array
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
arrSource.splice(nTempIndex, 1);
}
......@@ -517,7 +548,7 @@ BOOKMARK.SortPubDate = function(isAsc) {
}
BOOKMARK.ClearGrid();
ClientData.BookMarkData(arrTarget);
BOOKMARK.ShowBookmark();
BOOKMARK.ShowBookmark(arrShowList);
};
/*
Update information of specified bookmark
......@@ -647,7 +678,6 @@ BOOKMARK.insertRow = function(contentid, pageThumbnail, pageTitle, pageText, pag
newRow +='<li>';
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' ){
newRow += "<a class='read read_download' name='dspDownload' contentid='" + contentid + "'>ダウンロード</a>";
}
......@@ -865,7 +895,10 @@ BOOKMARK.SyncContent = function() {
// ==================================
else {
// 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) {
sid: ClientData.userInfo_sid(),
getType: '1',
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()
};
result["isExisted"] = isExisted;
AVWEB.avwCmsApiSync(ClientData.userInfo_accountPath(), "webGetContent", 'GET', params,
function (data) {
isExisted = true;
......@@ -902,8 +981,6 @@ BOOKMARK.IsExistContent = function(strContentId) {
result["isExisted"] = isExisted;
result["contentType"] = contentType;
//console.log("API BOOKMARK.download:" + strContentId + ":" + data.download);
// save content type
BOOKMARK.contentTypes[strContentId] = contentType;
BOOKMARK.contentName[strContentId] = data.contentData.contentName;
......@@ -926,6 +1003,7 @@ BOOKMARK.IsExistContent = function(strContentId) {
return result;
};
/*
----------------------------------------------------------------------------
Setting dialog [ end ]
......
......@@ -865,7 +865,10 @@ HEADER.getPushMessageNew = function()
}
}
//$('.notification-pushmessage').hide();
var params = { "sid": ClientData.userInfo_sid()};
var params = {
"sid": ClientData.userInfo_sid(),
"authCode": ClientData.authCode()
};
AVWEB.avwCmsApi(
ClientData.userInfo_accountPath(),
"webPushMessageNew",
......@@ -924,21 +927,28 @@ HEADER.getPushMessageList = function() {
var from = (HEADER.currentPagePushMessage - 1) * pushPageCount + 1;
var to = HEADER.currentPagePushMessage * pushPageCount;
var params = { "sid": ClientData.userInfo_sid(), "recordFrom": from, "recordTo": to };
AVWEB.avwCmsApiSync(ClientData.userInfo_accountPath(), "webPushMessageList", "post", params,
function (data) {
// reset number message
ClientData.pushInfo_newMsgNumber(0);
// hide number new message
$('#numbermessage').html('');
HEADER.showListPushMessage(data);
},
function (xhr, b, c) {
AVWEB.showSystemError();
});
var params = {
"sid": ClientData.userInfo_sid(),
"recordFrom": from,
"recordTo": to,
"authCode": ClientData.authCode()
};
AVWEB.avwCmsApiSync(
ClientData.userInfo_accountPath(),
"webPushMessageList",
"post",
params,
function (data) {
// reset number message
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
......
......@@ -1228,7 +1228,7 @@ HISTORY.IsExistContent = function(strContentId) {
sid: ClientData.userInfo_sid(),
getType: '1',
contentId: strContentId,
authCode: ClientData.authCode()
authCode: "0"
};
AVWEB.avwCmsApiSync(ClientData.userInfo_accountPath(), "webGetContent", 'GET', params,
function (data) {
......
......@@ -2338,7 +2338,7 @@ HOME.IsExistContent = function(strContentId) {
sid: ClientData.userInfo_sid(),
getType: '1',
contentId: strContentId,
authCode: ClientData.authCode()
authCode: "0"
};
AVWEB.avwCmsApiSync(ClientData.userInfo_accountPath(), "webGetContent", 'GET', params,
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