Commit a355c43b by NGUYEN HOANG SON

implement lang, send event js

parent c6d89c17
...@@ -61,6 +61,12 @@ ...@@ -61,6 +61,12 @@
"msgNotFound":"There is no applicable work.", "msgNotFound":"There is no applicable work.",
"confirmation":"confirmation", "confirmation":"confirmation",
"confirmYes":"Yes", "confirmYes":"Yes",
"confirmNo":"No" "confirmNo":"No",
"buttonOperationSelect":"Operation",
"labelSendTypeTitle":"Type",
"labelSendTypeGroup":"Group",
"labelSendTypeAll":"All",
"txtMessageContent":"Message",
"buttonTemplateSelection":"Template",
"buttonSend":"Send"
} }
\ No newline at end of file
...@@ -61,6 +61,13 @@ ...@@ -61,6 +61,13 @@
"msgNotFound":"該当する作業がありません。", "msgNotFound":"該当する作業がありません。",
"confirmation":"確認", "confirmation":"確認",
"confirmYes":"はい", "confirmYes":"はい",
"confirmNo":"いいえ" "confirmNo":"いいえ",
"buttonOperationSelect":"作業名",
"labelSendTypeTitle":"送信先",
"labelSendTypeGroup":"グループ内",
"labelSendTypeAll":"作業全体",
"txtMessageContent":"メッセージ",
"buttonTemplateSelection":"テンプレート選択",
"buttonSend":"送信"
} }
\ No newline at end of file
...@@ -61,5 +61,12 @@ ...@@ -61,5 +61,12 @@
"msgNotFound":"There is no applicable work.", "msgNotFound":"There is no applicable work.",
"confirmation":"confirmation", "confirmation":"confirmation",
"confirmYes":"Yes", "confirmYes":"Yes",
"confirmNo":"No" "confirmNo":"No",
"buttonOperationSelect":"Operation",
"labelSendTypeTitle":"Type",
"labelSendTypeGroup":"Group",
"labelSendTypeAll":"All",
"txtMessageContent":"Message",
"buttonTemplateSelection":"Template",
"buttonSend":"Send"
} }
\ No newline at end of file
...@@ -24,6 +24,7 @@ ...@@ -24,6 +24,7 @@
<script src="../common/js/constant.js?__UPDATEID__"></script> <script src="../common/js/constant.js?__UPDATEID__"></script>
<script src="../common/js/common.js?__UPDATEID__"></script> <script src="../common/js/common.js?__UPDATEID__"></script>
<script type="text/javascript" src="../js/template/template.js"></script>
<script type="text/javascript" src="../js/sendMessage/send-message.js"></script> <script type="text/javascript" src="../js/sendMessage/send-message.js"></script>
</head> </head>
...@@ -53,37 +54,35 @@ ...@@ -53,37 +54,35 @@
<form action="#"> <form action="#">
<div class="form-group form-row"> <div class="form-group form-row">
<div class="col-lg-1 col-md-2 col-3 control-label"> <div class="col-lg-1 col-md-2 col-3 control-label">
<button type="button" class="btn btn-sm btn-tertiary" data-toggle="modal" data-target="#task-list-modal">作業名</button> <button type="button" class="btn btn-sm btn-tertiary lang" lang="buttonOperationSelect" data-toggle="modal" data-target="#task-list-modal"></button>
</div> </div>
<div class="col-lg-11 col-md-10 col-9"> <div class="col-lg-11 col-md-10 col-9">
<div>作業を選択してください。</div> <div id="operationName"></div>
</div> </div>
</div> </div>
<div class="form-group form-row"> <div class="form-group form-row">
<label for="address" class="col-lg-1 col-md-2 col-3 control-label">送信先</label> <label for="address" class="col-lg-1 col-md-2 col-3 control-label lang" lang="labelSendTypeTitle"></label>
<div class="col-lg-11 col-md-10 col-9"> <div class="col-lg-11 col-md-10 col-9">
<div class="btn-group btn-group-toggle" data-toggle="buttons"> <div class="btn-group btn-group-toggle" data-toggle="buttons">
<label class="btn btn-sm btn-primary custom active"> <label class="btn btn-sm btn-primary custom active lang" lang="labelSendTypeGroup">
<input type="radio" name="options" id="option1" autocomplete="off" checked>グループ内 <input type="radio" name="options" id="option1" autocomplete="off" checked></label>
</label> <label class="btn btn-sm btn-primary custom lang" lang="labelSendTypeAll">
<label class="btn btn-sm btn-primary custom"> <input type="radio" name="options" id="option2" autocomplete="off"></label>
<input type="radio" name="options" id="option2" autocomplete="off">作業全体
</label>
</div> </div>
</div> </div>
</div> </div>
<div class="form-group mb-4"> <div class="form-group mb-4">
<div class="d-flex justify-content-between"> <div class="d-flex justify-content-between">
<label for="message-content">メッセージ</label> <label for="message-content" class="lang" lang="txtMessageContent"></label>
<a href="#" data-toggle="modal" data-target="#select-template-modal">テンプレート選択</a> <a href="#" data-toggle="modal" data-target="#select-template-modal" class="lang" lang="buttonTemplateSelection"></a>
</div> </div>
<textarea name="message-content" class="form-control" id="message-content" cols="30" rows="10"></textarea> <textarea name="message-content" class="form-control" id="messageContent" cols="30" rows="10"></textarea>
</div> </div>
</form> </form>
</div> </div>
</div> </div>
<button type="submit" class="btn btn-primary">送信</button> <button type="submit" class="btn btn-primary lang" lang="buttonSend" onclick="SendMessage.onClickSend();"></button>
</div> </div>
</div> </div>
......
...@@ -5,7 +5,7 @@ ...@@ -5,7 +5,7 @@
*/ */
var SendMessage = {}; var SendMessage = {};
SendMessage.baseApiUrl = CONSTANT.URL.CMS.BASE + ClientData.userInfo_accountPath() + CONSTANT.URL.CMS.API.BASE + 'sendMessage/'; SendMessage.baseApiUrl = CONSTANT.URL.CMS.BASE + ClientData.userInfo_accountPath() + CONSTANT.URL.CMS.API.BASE + 'sendPushMessage/';
/** /**
* default JSON * default JSON
...@@ -15,23 +15,34 @@ SendMessage.baseApiUrl = CONSTANT.URL.CMS.BASE + ClientData.userInfo_accountPath ...@@ -15,23 +15,34 @@ SendMessage.baseApiUrl = CONSTANT.URL.CMS.BASE + ClientData.userInfo_accountPath
} }
/** /**
* get data from cms * handle click event of send button
* @param {function} callback
*/ */
SendMessage.getData = function (callback) { SendMessage.onClickSend = function() {
const message = $('#messageContent').val();
const operationId = 1;
const sendType = 0;
SendMessage.postMessage(message, operationId, sendType);
};
/**
* post message data to cms
* @param {string} message
* @param {long} operationId
* @param {int} sendType - 0: Group, 1: All
*/
SendMessage.postMessage = function(message, operationId, sendType) {
let param = { let param = {
sid: COMMON.getSid(), sid: COMMON.getSid(),
message: message,
operationId: operationId,
sendType: sendType
}; };
const url = SendMessage.baseApiUrl; console.log(param);
COMMON.cmsAjax(url, param, false, function (json) { COMMON.cmsAjax(SendMessage.baseApiUrl, param, false, function (json) {
if (callback) {
callback(json);
}
}, function() { }, function() {
console.log('SendMessage.getData error'); console.log('SendMessage.postMessage error');
if (callback) {
callback(SendMessage.dummyJson);
}
}); });
}; };
...@@ -39,7 +50,5 @@ SendMessage.baseApiUrl = CONSTANT.URL.CMS.BASE + ClientData.userInfo_accountPath ...@@ -39,7 +50,5 @@ SendMessage.baseApiUrl = CONSTANT.URL.CMS.BASE + ClientData.userInfo_accountPath
* init data, action when screen onload * init data, action when screen onload
*/ */
SendMessage.init = function () { SendMessage.init = function () {
$("#includedHeader").load("../common/header.html" , function() { TEMPLATE.loadHearder();
I18N.initi18n();
});
}; };
\ No newline at end of file
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