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