|
@@ -124,7 +124,7 @@ $(".next").click(function () {
|
|
|
button.setAttribute('disabled', '');
|
|
|
setTimeout(function () {
|
|
|
button.removeAttribute('disabled')
|
|
|
- }, 4000);
|
|
|
+ }, 6000);
|
|
|
avatar = $('.avatar').val();
|
|
|
name_title = $('.title_new').val();
|
|
|
txtARR = [];
|
|
@@ -142,7 +142,7 @@ $(".next").click(function () {
|
|
|
imgARR.push($(`.imgsrc${i}`).val())
|
|
|
}
|
|
|
}
|
|
|
- multiLang = 0
|
|
|
+ multiLang = 0;
|
|
|
if ($('#multiLang').prop("checked")) {multiLang = 1;}
|
|
|
dataOBJ = { "name": name_title, "text_content": txtARR, "image_urls": imgARR, "avatar": avatar,"multiLang":multiLang, "client_id": client_id }
|
|
|
objstr = JSON.stringify(dataOBJ);
|
|
@@ -156,20 +156,32 @@ $(".next").click(function () {
|
|
|
xhr.onreadystatechange = function () {
|
|
|
if (xhr.readyState === 4) {
|
|
|
responseOBJ = JSON.parse(xhr.responseText)
|
|
|
- if (responseOBJ.msg=='ok')
|
|
|
- {
|
|
|
+ if (responseOBJ.msg=='ok') {
|
|
|
+ let title = "資料已送出";
|
|
|
+ let text = '資料已傳送,請耐心等候';
|
|
|
+ if (lang == 'en') { // 英文版訊息
|
|
|
+ title = "Submitted Successfully!";
|
|
|
+ text = 'We are working on your video. You will get notfication in line group when your video is done.';
|
|
|
+ }
|
|
|
Swal.fire({
|
|
|
- title: "資料已送出",
|
|
|
+ title: title,
|
|
|
icon: 'success',
|
|
|
- text: '資料已傳送,請耐心等候',
|
|
|
+ text: text,
|
|
|
confirmButtonColor: '#3085d6',
|
|
|
});
|
|
|
- }
|
|
|
- else{
|
|
|
+ } else{
|
|
|
+ let title = '發生錯誤';
|
|
|
+ let text;
|
|
|
+ if(lang == 'en') {
|
|
|
+ title = 'Error';
|
|
|
+ text = responseOBJ.msg.eng;
|
|
|
+ } else {
|
|
|
+ text = responseOBJ.msg.zh;
|
|
|
+ }
|
|
|
Swal.fire({
|
|
|
- title: "發生錯誤",
|
|
|
+ title: title,
|
|
|
icon: 'error',
|
|
|
- text: responseOBJ.msg,
|
|
|
+ text: text,
|
|
|
confirmButtonColor: '#3085d6',
|
|
|
});
|
|
|
}
|
|
@@ -217,20 +229,32 @@ $("#sendBTN").click(function () {
|
|
|
xhr.onreadystatechange = function () {
|
|
|
if (xhr.readyState === 4) {
|
|
|
responseOBJ = JSON.parse(xhr.responseText)
|
|
|
- if (responseOBJ.msg=='ok')
|
|
|
- {
|
|
|
+ if (responseOBJ.msg=='ok'){
|
|
|
+ let title = "資料已送出";
|
|
|
+ let text = '資料已傳送,請耐心等候';
|
|
|
+ if (lang == 'en') { // 英文版訊息
|
|
|
+ title = "Submitted Successfully!";
|
|
|
+ text = 'We are working on your video. You will get notfication in line group when your video is done.';
|
|
|
+ }
|
|
|
Swal.fire({
|
|
|
- title: "資料已送出",
|
|
|
+ title: title,
|
|
|
icon: 'success',
|
|
|
- text: '資料已傳送,請耐心等候',
|
|
|
+ text: text,
|
|
|
confirmButtonColor: '#3085d6',
|
|
|
});
|
|
|
- }
|
|
|
- else{
|
|
|
+ } else {
|
|
|
+ let title = '發生錯誤';
|
|
|
+ let text;
|
|
|
+ if(lang == 'en') {
|
|
|
+ title = 'Error';
|
|
|
+ text = responseOBJ.msg.eng;
|
|
|
+ } else {
|
|
|
+ text = responseOBJ.msg.zh;
|
|
|
+ }
|
|
|
Swal.fire({
|
|
|
- title: "發生錯誤",
|
|
|
+ title: title,
|
|
|
icon: 'error',
|
|
|
- text: responseOBJ.msg,
|
|
|
+ text: text,
|
|
|
confirmButtonColor: '#3085d6',
|
|
|
});
|
|
|
}
|
|
@@ -262,10 +286,16 @@ $("#send_slide").click(function () {
|
|
|
xhr.setRequestHeader("Content-Type", "application/json");
|
|
|
xhr.onreadystatechange = function () {
|
|
|
if (xhr.readyState === 4) {
|
|
|
+ let title = "資料已送出";
|
|
|
+ let text = '資料已傳送,請耐心等候';
|
|
|
+ if (lang == 'en') { // 英文版訊息
|
|
|
+ title = "Submitted Successfully!";
|
|
|
+ text = 'We are working on your video. You will get notfication in line group when your video is done.';
|
|
|
+ }
|
|
|
Swal.fire({
|
|
|
- title: "資料已送出",
|
|
|
+ title: title,
|
|
|
icon: 'success',
|
|
|
- text: '資料已傳送,請耐心等候',
|
|
|
+ text: text,
|
|
|
confirmButtonColor: '#3085d6',
|
|
|
});
|
|
|
}
|
|
@@ -447,6 +477,9 @@ function load_data(tid, loaded_data, draft = false) {
|
|
|
imguploadlabel.setAttribute('for', `img${i + 1}`);
|
|
|
imguploadlabel.classList.add('upload-btn');
|
|
|
imguploadlabel.textContent = '上傳檔案';
|
|
|
+ if(lang == 'en') {
|
|
|
+ imguploadlabel.textContent = 'Upload';
|
|
|
+ }
|
|
|
imguploadlabel.setAttribute('set-lan', `html:upload_file`);
|
|
|
imgInputs.appendChild(imguploadlabel);
|
|
|
}
|
|
@@ -582,6 +615,9 @@ function renderimgBlock(i) {
|
|
|
imguploadlabel.setAttribute('for', `img${i}`);
|
|
|
imguploadlabel.classList.add('upload-btn');
|
|
|
imguploadlabel.textContent = '上傳檔案';
|
|
|
+ if(lang == 'en') {
|
|
|
+ imguploadlabel.textContent = 'Upload';
|
|
|
+ }
|
|
|
imguploadlabel.setAttribute('set-lan', `html:upload_file`);
|
|
|
imgInputs.appendChild(imguploadlabel);
|
|
|
$('input[type=file]').on('change', prepareUpload);
|
|
@@ -654,15 +690,19 @@ $('.draft-btn').click(() => {
|
|
|
}).then(res => {
|
|
|
console.log(res.data);
|
|
|
$('.draft-btn').text('存為草稿');
|
|
|
+ let title = "儲存完成";
|
|
|
+ if(lang == 'en') {
|
|
|
+ title = 'Saved!'
|
|
|
+ $('.draft-btn').text('Save as Draft');
|
|
|
+ }
|
|
|
Swal.fire({
|
|
|
- title: "儲存完成",
|
|
|
+ title: title,
|
|
|
icon: 'success',
|
|
|
confirmButtonColor: '#3085d6',
|
|
|
});
|
|
|
}).catch(err => {
|
|
|
console.log(err);
|
|
|
});
|
|
|
-
|
|
|
});
|
|
|
|
|
|
function getDraftData() {
|