Commit 70ab8d42 by NGUYEN HOANG SON

implement dummy message list json

parent b00b28e6
......@@ -13,7 +13,7 @@ PushMessageList.init = function() {
I18N.initi18n();
});
PushMessageList.getMessageList(function(messageList) {
PushMessageList.generateMessageListHtml(messageList);
PushMessageList.generateMessageListHtml(messageList.pushMessageList);
});
}
......@@ -33,7 +33,7 @@ PushMessageList.getMessageList = function (callback) {
}, function() {
console.log('PushMessageList.getMessageList error');
if (callback) {
callback(PushMessageList.dummyMessageList());
callback(PushMessageList.dummyMessageListJson);
}
});
};
......@@ -64,12 +64,11 @@ PushMessageList.generateMessageListHtml = function(messageList) {
var mTitle = message.pushMessage;
var mDate = message.pushSendDate;
var mSubtitle = message.operationName;
var unread = !message.readingFlg;
var messageLi = $('<li class="card mb-2" id="pushMessageId_' + messageId + '"/>');
if (unread) {
messageLi.addClass('unread');
} else {
if (message.readingFlg) {
messageLi.addClass('read');
} else {
messageLi.addClass('unread');
}
var messageA = $('<a class="d-block px-3 py-2 text-decoration-none text-dark"/>');
messageA.attr('href', "javascript:PushMessageList.clickMessage('" + messageId +"');");
......@@ -87,24 +86,20 @@ PushMessageList.generateMessageListHtml = function(messageList) {
};
/**
* dummy message list for test
* @returns message List
* dummy message list JSON for test
*/
PushMessageList.dummyMessageList = function() {
var messes = [];
messes.push({
PushMessageList.dummyMessageListJson = {
pushMessageList: [{
pushMessageId: 1,
pushMessage: 'メッセージ内容が入ります。',
pushSendDate: '2022/07/06 14:14',
operationName: '作業名が入ります。',
readingFlg: false,
});
messes.push({
readingFlg: 0,
}, {
pushMessageId: 2,
pushMessage: 'メッセージ内容が入ります。メッセージ内容が入ります。メッセージ内容が入ります。メッセージ内容が入ります。',
pushSendDate: 'xxxxxxxxxxxxxxxxxxxxxxxxxx',
operationName: '作業名が入ります。作業名が入ります。作業名が入ります。作業名が入ります。作業名が入ります。作業名が入ります。',
readingFlg: true,
});
return messes;
}
readingFlg: 1,
}]
};
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