1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
function doCheck() {
var word = $("#word").val();
if (word==null || word.length < 1) {
alert ("请输入单词");
return false;
}
var hira_kana = $("#hira_kana").val();
if (hira_kana==null || hira_kana.length < 1) {
alert ("请输入平假名");
return false;
}
var chinese = $("#chinese").val();
if (chinese==null || chinese.length < 1) {
alert ("请输入中文翻译");
return false;
}
document.word_data_edit.submit();
}
function doCheckCsv() {
var csv_file = $("#csv_file").val();
if (csv_file==null || csv_file.length < 1) {
alert ("请输入CSV文件");
return false;
}
document.word_data_batch.submit();
}
function doCheckWordTheme() {
var theme_type = $("#theme_type").val();
if (theme_type==null || theme_type.length < 1) {
alert ("请选择词集类型");
return false;
}
var title = $("#title").val();
if (title==null || title.length < 1) {
alert ("请输入词集名称");
return false;
}
document.word_theme_edit.submit();
}
function checkUploadMp3File() {
$("#upload_thumbnail_preview").css("display", "");
setImagePreview("upload_thumbnail_file", "upload_thumbnail_preview", "upload_thumbnail");
}
//上传词集封面
function checkUploadThemeFront() {
$("#upload_thumbnail_preview").css("display", "");
setImagePreview("upload_thumbnail_file", "upload_thumbnail_preview", "upload_thumbnail");
}
function searchWordTheme() {
document.search_input.submit();
}
function searchWords(theme_id) {
var key_word = $("#key_word").val();
if (key_word==null || key_word.length < 1) {
return false;
}
$.ajax({
url: 'if/ajax_search_words.php',
type: 'post',
dataType: 'json',
data: {theme_id:theme_id, key_word:key_word},
async: false,
success: function (data) {
var html = data.html;
$("#search_word_list").html(html);
}
});
}
//词集添加单词
function addWord(theme_id, word_id) {
//提交获取验证码
$.ajax({
url: 'if/ajax_operate_theme_word.php',
type: 'post',
dataType: 'json',
data: {theme_id:theme_id, word_id:word_id, operate:'add'},
async: false,
success: function (data) {
var html = data.html;
$("#theme_word_list").html(html);
}
});
}
//词集删除单词
function removeWord(theme_id, word_id) {
//提交获取验证码
$.ajax({
url: 'if/ajax_operate_theme_word.php',
type: 'post',
dataType: 'json',
data: {theme_id:theme_id, word_id:word_id, operate:'remove'},
async: false,
success: function (data) {
var html = data.html;
$("#theme_word_list").html(html);
}
});
}