' + a);
}
$("#PushMore").append('
');
}
//2021/11/20 最初にデータベースから取ってきた質問を表示するように変更
//2021/12/26 最初の質問の表示かどうかを判断する引数を追加
function textChoice(str,firstFLG){
var answer=[];
ButtonFlg = 0;
/*
var count = SQLList.length;
for(var num = 0; num <= count-1; num++){
answer.push(SQLList[num][0]);
}
*/
var count = 0;
if(str == ""){
count = SQLList.length;
for(var num = 0; num <= count-1; num++){
//console.log(SQLList[num][0]);
answer.push(SQLList[num][0]);
}
}else{
count = str.length;
for(var num = 0; num <= count-1; num++){
answer.push(str[num]);
}
}
//answerの中身が複数であるとき、それをボタンにして返す。
if(answer.length >= 1){
answer = makeButton(answer,firstFLG);
ButtonFlg=1;
}
return answer;
}
var GlobalIcount=0;
function makeButton(text,firstFLG){
var str=[];
var strtmp="";
for(var i = 0 ;i' + text[i] + '
';
// str[i]= '
' + text[i] + '
';
// str[i]= '
' + text[i] + '
';
}
}else{
if(text[i].substring(0,3) == "{q-"){
strtmp = tst.substring(3,tst.length-3);
text[i] = text[i].replaceAll("{q-","");
text[i] = text[i].replaceAll("-q}","");
// strtmp = text[i].substring(3,text[i].length-3);
str[i]= '
' + text[i] + '
';
}else{
str[i]= '
' + text[i] + '
';
}
}
//
}
GlobalIcount++;
return str;
}
//ボタンクリック時、テキスト送信時に選択ボタンをクリックできなくさせる。
function buttonStyleChange(){
let btn_list = document.getElementsByClassName("bms_message_btn");
for(var i = 0;i<= btn_list.length - 1;i++){
document.getElementsByClassName("bms_message_btn").item(i).style.color = "blue";
document.getElementsByClassName("bms_message_btn").item(i).onclick = "";
}
}
function gt(tmp){
// var ClickText = document.getElementById('botnum-' + tmp).innerHTML; // tmp;
var ClickText = tmp;
//var clickCount = tmp[1];
var ClickText = ClickText.replaceAll("sq-change-period",""");
ClickText = ClickText.replaceAll("dq-change-period","'");
ClickText = ClickText.replaceAll("flont-change-period","<");
ClickText = ClickText.replaceAll("another-change-period",">");
ClickText = ClickText.replaceAll("and-change-period","&");
var text = "";
text = "";//textChoice(ClickText);//"text";//
//選んだ質問を表示
$("#PushMore").append('
' + ClickText);
$("#PushMore").append('
');
var count = SQLList.length;
for(var num = 0; num <= count-1; num++){
if(SQLList[num][0] == ClickText){
text = SQLList[num][1];
//text = "test1
test2 test3 ";//SQLList[num][1] + SQLList[num][1] + SQLList[num][1];
//textにがあれば、x にする
//if(text.indexOf("l-") != -1){
let startlist = [];
let stoplist = [];
let Alllist = [];
let Arraystr = "";
if(text.indexOf("{l-") != -1){
startlist = text.split("{l-");
for(var i = 0; i < startlist.length; i++){
if(startlist[i].indexOf("-l}") != -1){
stoplist = startlist[i].split("-l}");
let list = [];
list = stoplist[0].split("(");
list[1] = list[1].substring(0,list[1].length-1)
Alllist.push("" + list[0] + " ");
Alllist.push(stoplist[1]);
}else{
Alllist.push(startlist[i]);
}
}
for(var i = 0; i < Alllist.length; i++){
Arraystr = Arraystr + Alllist[i]
}
text = Arraystr;
}
startlist = [];
Arraystr = [];
Alllist = [];
// 2022/03/06
if(text.indexOf("{i-") != -1){
startlist = text.split("{i-");
for(var i = 0; i < startlist.length; i++){
if(startlist[i].indexOf("-i}") != -1){
stoplist = startlist[i].split("-i}");
let list = [];
list = stoplist[0].split("(");
Alllist.push(" ");
Alllist.push(stoplist[1]);
}else{
Alllist.push(startlist[i]);
}
}
for(var i = 0; i < Alllist.length; i++){
Arraystr = Arraystr + Alllist[i]
}
text = Arraystr;
}
startlist = [];
Arraystr = [];
Alllist = [];
if(text.indexOf("{q-") != -1){
startlist = text.split("{q-");
for(var i = 0; i < startlist.length; i++){
Arraystr.push(startlist[i]);
if(startlist[i].indexOf("-q}") != -1){
let strlist = startlist[i].split("-q}");
for(var j = 0; j < strlist.length; j++){
//ボタン化したい文字と、-q}で区切られた最後の文が入る
if(strlist[j] != ""){
if(parseInt(strlist[j],10)){
Alllist.push("{q-" + faahrhhrqhrSWHREQEgQqfaqFege[parseInt(strlist[j],10)-1] + "-q}");
}else{
Alllist.push(strlist[j]);
}
}
}
}else{
if(startlist[i] != ""){
Alllist.push(startlist[i]);
}
}
}
text = Alllist;
}
startlist = [];
Arraystr = [];
Alllist = [];
/*
// 2022/03/19
if(text.indexOf("{m}") != -1){
startlist = text.split("{m}");
for(var i = 0; i < startlist.length; i++){
if(startlist[i].indexOf("-i}") != -1){
stoplist = startlist[i].split("-i}");
let list = [];
list = stoplist[0].split("(");
Alllist.push("送信 ");
Alllist.push(stoplist[1]);
}else{
Alllist.push(startlist[i]);
}
}
for(var i = 0; i < Alllist.length; i++){
Arraystr = Arraystr + Alllist[i]
}
text = Arraystr;
}
*/
// 2022/03/19
if(text.indexOf("{m}") != -1){
//startlist = text.split("{m}");
text = text.replaceAll("{m}","送信 ");
}
}
}
if(Array.isArray(text)){
Choice_ALL(text,1);
var Scroll_Bottom = document.getElementById("bms_messages");
Scroll_Bottom.scrollTop = Scroll_Bottom.scrollHeight;
}else{
//左側 回答要素
$("#PushMore").append('' + text);
$("#PushMore").append('
');
var Scroll_Bottom = document.getElementById("bms_messages");
Scroll_Bottom.scrollTop = Scroll_Bottom.scrollHeight;
Choice_ALL("",0);
}
answercount++;
}
function sendmessage(i){
var txt = document.getElementById("mailmessage-" + i).value;
var data = {
txt : txt,
address:"mT7A70mHx3bV+VdOJqqYK89s1EFsJMBVq61TF7Yr3yE=",
id:"8cf1fc47dc30cf3a911437a301916250",
};
$.ajax({
type: "post",
url: "./botmail.php",
data: data,
//Ajax通信が成功した場合
success: function(data, dataType)
{
alert('メールの送信に成功しました' + data);
},
error: function()
{
alert('メールの送信に失敗しました。時間をおいてから再度お試しください');
}
});
}
/*
function pagedown(){
//ボタンクリック時に『質問を追加』ボタンが表示できるようにスクロールする。
var element = document.documentElement;
var bottom = element.scrollHeight - element.clientHeight;
window.scrollTo({top: 100, left: 0, behavior: 'smooth'});
console.log("bottom : " + bottom);
}
*/