Commit 2fc626f3 by Ha Jonguk

課題34、35対応

parent 377a8325
...@@ -687,9 +687,9 @@ HOME_CHECK.returnProjectType = function(projectId) { ...@@ -687,9 +687,9 @@ HOME_CHECK.returnProjectType = function(projectId) {
}; };
// Call API // Call API
HOME_CHECK.checkApi = function(name, params, method, callback) { HOME_CHECK.checkApi = function(name, params, method, callback, errorCallback) {
var checkApiUrl = AVWEB.getCheckApiUrl(ClientData.userInfo_accountPath()) var checkApiUrl = AVWEB.getCheckApiUrl(ClientData.userInfo_accountPath())
AVWEB.avwCmsApiWithUrl(checkApiUrl, ClientData.userInfo_accountPath(), name, method, params, callback, null); AVWEB.avwCmsApiWithUrl(checkApiUrl, ClientData.userInfo_accountPath(), name, method, params, callback, errorCallback);
}; };
// Call API // Call API
...@@ -790,13 +790,13 @@ HOME_CHECK.showPushMessageList = function() { ...@@ -790,13 +790,13 @@ HOME_CHECK.showPushMessageList = function() {
var params = { var params = {
sid : ClientData.userInfo_sid() sid : ClientData.userInfo_sid()
}; };
$("#recept_push_message_list").empty();
HOME_CHECK.checkApi('webPushMessageList', params, 'POST', function(data) { HOME_CHECK.checkApi('webPushMessageList', params, 'POST', function(data) {
$("#recept_push_message_list").empty();
$.each(data.pushMessageList, function(i, json) { $.each(data.pushMessageList, function(i, json) {
var li = $("<li/>", { style: "height:auto;border-bottom:1px solid black;width:560px;display:inline-block;position:relative;" }); var li = $("<li/>", { style: "height:auto;border-bottom:1px solid black;width:560px;display:inline-block;position:relative;" });
var leftDiv = $("<div/>", { style: "text-align:left;margin: 20px 5px 20px 20px;width:290px;" }); var leftDiv = $("<div/>", { style: "text-align:left;margin: 20px 5px 20px 20px;width:290px;" });
leftDiv.append($("<div/>", { style: "font-size:20px;overflow:hidden;width:100%;margin:10px 0;" }).text(json.pushMessage)); leftDiv.append($("<div/>", { style: "font-size:20px;overflow:hidden;width:100%;margin:10px 0;" }).html(json.pushMessage.replace(/\n/ig, "<br>")));
leftDiv.append($("<div/>", { style: "font-size:16px;overflow:hidden;width:100%;" }).text(json.pushSendDate)); leftDiv.append($("<div/>", { style: "font-size:16px;overflow:hidden;width:100%;" }).text(json.pushSendDate));
var rightDiv = $("<div/>", { style: "text-align:right;width:200px;position:absolute;bottom:0;right:20px;" }); var rightDiv = $("<div/>", { style: "text-align:right;width:200px;position:absolute;bottom:0;right:20px;" });
if (json.projectName) { if (json.projectName) {
...@@ -925,6 +925,19 @@ HOME_CHECK.sendPushMessage = function() { ...@@ -925,6 +925,19 @@ HOME_CHECK.sendPushMessage = function() {
setTimeout(function () { setTimeout(function () {
$('.notification-pushmessage').slideUp(); $('.notification-pushmessage').slideUp();
}, 5000); }, 5000);
}, function(xmlHttpRequest, txtStatus, errorThrown) {
/* call custom error process */
if(xmlHttpRequest.status == 400) {
/* show messages */
$().toastmessage({ position: 'middle-center' });
$().toastmessage('showToast', {
type: 'error',
sticky: true,
text: "プッシュメッセージの送信に失敗しました。"
});
} else {
AVWEB.showSystemError();
}
}); });
} }
......
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