Commit 9c26b25f by Takumi Imai

Merge branch 'feature/1.0_check_web_dev_son' into 'feature/1.0_check_web_dev'

Feature/1.0 check web dev son

See merge request !70
parents df5d8bd6 ff605114
...@@ -98,7 +98,10 @@ COMMON.showConfirmModal = function (data, confirmCallback) { ...@@ -98,7 +98,10 @@ COMMON.showConfirmModal = function (data, confirmCallback) {
$('#confirm-modal #confirmYes').click(function() { $('#confirm-modal #confirmYes').click(function() {
$('#confirm-modal .close').click(); $('#confirm-modal .close').click();
if (confirmCallback) { if (confirmCallback) {
confirmCallback(); //timeout for animation modal close
setTimeout(function() {
confirmCallback();
}, 500);
} }
}); });
} else { } else {
...@@ -144,17 +147,21 @@ COMMON.showConfirm = function (messageCode, confirmCallback, options = {}) { ...@@ -144,17 +147,21 @@ COMMON.showConfirm = function (messageCode, confirmCallback, options = {}) {
/** /**
* show alert message by confirm modal html * show alert message by confirm modal html
* @param {String} messageCode * @param {String} messageCode
* @param {string} titleCode
* @param {Object} options - Data Options {message, titleCode, confirmNoCode} * @param {Object} options - Data Options {message, titleCode, confirmNoCode}
*/ */
COMMON.showAlert = function (messageCode, options = {}) { COMMON.showAlert = function (messageCode, titleCode = 'error', options = {}) {
const defaultParams = { const defaultParams = {
titleCode: 'error', titleCode: titleCode ? titleCode : 'error',
confirmNoCode: 'close' confirmNoCode: 'close'
} }
const params = Object.assign(options, defaultParams); const params = Object.assign(options, defaultParams);
let message = ''; let message = '';
if (messageCode) { if (messageCode) {
message = I18N.i18nText(messageCode); message = I18N.i18nText(messageCode);
if (typeof message === 'undefined') {
message = messageCode;
}
} else if (params.message) { } else if (params.message) {
message = params.message; message = params.message;
} }
......
...@@ -37,11 +37,12 @@ HEADER.goToHomePage = function (pageId) { ...@@ -37,11 +37,12 @@ HEADER.goToHomePage = function (pageId) {
*/ */
HEADER.logoutFunction = function () { HEADER.logoutFunction = function () {
console.log('clicked logout'); console.log('clicked logout');
$('#modalTitle').text(I18N.i18nText("confirmation")); COMMON.showConfirm('msgLogoutConfirm', HEADER.processLogout);
$('#msgModel').text(I18N.i18nText('msgLogoutConfirm')); // $('#modalTitle').text(I18N.i18nText("confirmation"));
$('#confirmYes').show(); // $('#msgModel').text(I18N.i18nText('msgLogoutConfirm'));
$('#confirmYes').click(HEADER.processLogout); // $('#confirmYes').show();
$('#confirmNo').text(I18N.i18nText("confirmNo")); // $('#confirmYes').click(HEADER.processLogout);
// $('#confirmNo').text(I18N.i18nText("confirmNo"));
}; };
/** /**
......
...@@ -120,5 +120,6 @@ ...@@ -120,5 +120,6 @@
"error": "Error", "error": "Error",
"msgSendPushMessageConfirm": "Do you want to send message?", "msgSendPushMessageConfirm": "Do you want to send message?",
"close":"Close", "close":"Close",
"success":"Success",
"dateError": "Set the start date before the end date." "dateError": "Set the start date before the end date."
} }
\ No newline at end of file
...@@ -118,5 +118,6 @@ ...@@ -118,5 +118,6 @@
"error": "エラー", "error": "エラー",
"msgSendPushMessageConfirm": "プッシュメッセージを送信しますか?", "msgSendPushMessageConfirm": "プッシュメッセージを送信しますか?",
"close":"閉じる", "close":"閉じる",
"success":"成功",
"dateError": "開始日は終了日の前に設定してください。" "dateError": "開始日は終了日の前に設定してください。"
} }
\ No newline at end of file
...@@ -117,5 +117,6 @@ ...@@ -117,5 +117,6 @@
"error": "에러", "error": "에러",
"msgSendPushMessageConfirm": "Do you want to send message?", "msgSendPushMessageConfirm": "Do you want to send message?",
"close":"Close", "close":"Close",
"success":"Success",
"dateError": "시작일은 종료일 이전에 설정하십시오." "dateError": "시작일은 종료일 이전에 설정하십시오."
} }
\ No newline at end of file
...@@ -26,20 +26,21 @@ PushMessageDetail.init = function () { ...@@ -26,20 +26,21 @@ PushMessageDetail.init = function () {
COMMON.checkAuth(false); COMMON.checkAuth(false);
//load common html //load common html
TEMPLATE.loadHeader('#includedHeader'); TEMPLATE.loadHeader('#includedHeader');
TEMPLATE.loadConfirmModal();
const navs = [ const navs = [
{ {
titleLang: 'dashboard', titleLang: 'dashboard',
href: 'dashboard.html', href: 'dashboard.html',
}, },
{ {
titleLang: 'messageListTitle', titleLang: 'pushMessageList',
href: 'pushMessageList.html', href: 'pushMessageList.html',
}, },
{ {
titleLang: 'messageDetail', titleLang: 'pushMessageDetail',
}, },
]; ];
TEMPLATE.loadMainNavsTitle('#includedMainTitle', 'messageDetail', navs, null); TEMPLATE.loadMainNavsTitle('#includedMainTitle', 'pushMessageDetail', navs, null);
//request message detail data //request message detail data
let urlParam = COMMON.getUrlParameter(); let urlParam = COMMON.getUrlParameter();
if (typeof urlParam !== 'object' || typeof urlParam.pushMessageId === 'undefined') { if (typeof urlParam !== 'object' || typeof urlParam.pushMessageId === 'undefined') {
......
...@@ -12,6 +12,7 @@ PushMessageList.init = function () { ...@@ -12,6 +12,7 @@ PushMessageList.init = function () {
//Check if user is logged in //Check if user is logged in
COMMON.checkAuth(false); COMMON.checkAuth(false);
TEMPLATE.loadHeader('#includedHeader'); TEMPLATE.loadHeader('#includedHeader');
TEMPLATE.loadConfirmModal();
const navs = [ const navs = [
{ {
titleLang: 'dashboard', titleLang: 'dashboard',
......
...@@ -43,7 +43,7 @@ SendMessage.checkValidation = function () { ...@@ -43,7 +43,7 @@ SendMessage.checkValidation = function () {
return false; return false;
} }
if (!ValidationUtil.CheckMaxLengthForByte(message, SendMessage.contentMaxLength)) { if (!ValidationUtil.CheckMaxLengthForByte(message, SendMessage.contentMaxLength)) {
COMMON.showAlert(null, {message: COMMON.format(I18N.i18nText('msgContentInvalidLength'), SendMessage.contentMaxLength)}); COMMON.showAlert(COMMON.format(I18N.i18nText('msgContentInvalidLength'), SendMessage.contentMaxLength));
return false; return false;
} }
const operationId = SendMessage.getCurrentOperationId(); const operationId = SendMessage.getCurrentOperationId();
...@@ -94,7 +94,7 @@ SendMessage.postMessage = function (message, operationId, sendType) { ...@@ -94,7 +94,7 @@ SendMessage.postMessage = function (message, operationId, sendType) {
false, false,
function (json) { function (json) {
COMMON.closeLoading(); COMMON.closeLoading();
COMMON.showAlert('msgSendPushMessageSuccess'); COMMON.showAlert('msgSendPushMessageSuccess', 'success');
}, },
function () { function () {
console.log('SendMessage.postMessage error'); console.log('SendMessage.postMessage error');
......
...@@ -28,7 +28,7 @@ SETTINGS.getToken = function () { ...@@ -28,7 +28,7 @@ SETTINGS.getToken = function () {
if (data.token) { if (data.token) {
$('#getToken').val(data.token); $('#getToken').val(data.token);
} else { } else {
COMMON.showAlert("token error..", true); COMMON.showAlert("token error..");
} }
}, },
function(data) { function(data) {
...@@ -134,7 +134,7 @@ SETTINGS.avwCmsApi_passwordChange_success = function (data) { ...@@ -134,7 +134,7 @@ SETTINGS.avwCmsApi_passwordChange_success = function (data) {
$('#txtPwdNew').val(''); $('#txtPwdNew').val('');
$('#txtPwdNewRe').val(''); $('#txtPwdNewRe').val('');
/* show messages */ /* show messages */
COMMON.showAlert('msgPwdChangeOK'); COMMON.showAlert('msgPwdChangeOK', 'success');
} }
}; };
......
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