Commit a355c43b by NGUYEN HOANG SON

implement lang, send event js

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