' );
20 | /*$( '' ).text().appendTo( trow );*/
21 | $( ' | ' ).html('['+ getMyDate(content[0]) +'] '+content[1]).appendTo( trow );
22 | trow.appendTo( table );
23 | }
24 | );
25 | $( '#notice' ).html( table.html() );
26 | },
27 | error: function(data) {
28 | debugLog(data);
29 | }
30 | });
31 | return false;
32 | }
33 | $(document).ready(function(){
34 | getNotice();
35 | });
--------------------------------------------------------------------------------
/js/register.js:
--------------------------------------------------------------------------------
1 | /*判断是否进行了邮件传输情况*/
2 | function mailSendCheck()
3 | {
4 | debugLog("load_reg run-->");
5 | if(loggedin){
6 | Materialize.toast("您已登陆!", 4000);
7 | window.location.href="account.html";
8 | return false;
9 | }
10 | $.ajax({
11 | type:'post',
12 | url:'ajax.php?m=mailSendCheck',
13 | data: {"token":token},
14 | dataType:'json',
15 | success:function(data){
16 | debugLog(data);
17 | errorCheck(data);
18 | if(data[0][0]=="2"){
19 | $('#verify_regone').hide();
20 | $('#verify_regtwo').show();
21 | }
22 | else{
23 | $('#verify_regone').show();
24 | $('#verify_regtwo').hide();
25 | }
26 | },
27 | error:function(data){
28 | debugLog(data);
29 | }
30 | });
31 | return false;
32 | }
33 |
34 | function regVerifyCheck(){
35 | if(loggedin){
36 | Materialize.toast("您已登陆!",4000);
37 | window.location.href="account.html";
38 | return false;
39 | }
40 | debugLog("verify run"+token);
41 | $.ajax({
42 | type:'post',
43 | url:'ajax.php?m=getEmailVerify',
44 | data:{'token':token},
45 | dataType:'json',
46 | success:function(data){
47 | debugLog(data);
48 | errorCheck(data);
49 | if(data[1][0]=='0'){
50 | $('.no-verify').show();
51 | $('#no-captcha').attr('src','/ajax.php?m=getCaptcha&1');
52 | $('.on-verify').hide();
53 | }
54 | else{
55 | $('.on-verify').show();
56 | $('#on-captcha').attr('src','/ajax.php?m=getCaptcha&2');
57 | $('.no-verify').hide();
58 | }
59 | },
60 | error:function(data){
61 | debugLog(data);
62 | }
63 | });
64 | return false;
65 | }
66 |
67 | $('.no-verify').submit(function(){
68 | debugLog($("form").serializeArray());
69 | $.ajax({
70 | type:'post',
71 | url:'ajax.php?m=noVerifyRegister',
72 | data:$('form').serialize()+'&token='+token,
73 | dataType:'json',
74 | success:function(data){
75 | debugLog(data);
76 | if(errorCheck(data)){
77 | $("#no-captcha").click();
78 | return false;
79 | }
80 | Materialize.toast(data[0][1],2000,"",function(){window.location.href="./account.html"});
81 | },
82 | error:function(data){
83 | debugLog(data);
84 | }
85 | });
86 | /*$("#no-captcha").click();*/
87 | return false;
88 | })
89 |
90 | $(document).ready(function(){
91 | /*邮件验证是否开启*/
92 | regVerifyCheck();
93 | /*对于开启情况的邮件发送检测*/
94 | mailSendCheck();
95 |
96 | $("#sendmail").click(function(){
97 | $.ajax({
98 | type:'post',
99 | url:'ajax.php?m=sendRegMail',
100 | data:{
101 | 'captcha':$('#verify_captcha').val(),
102 | 'email':$('#verify_email').val(),
103 | 'username':$('#verify_username').val(),
104 | 'token':token
105 | },
106 | dataType:'json',
107 | success: function(data) {
108 | debugLog(data);
109 | if(errorCheck(data)){
110 | $("#on-captcha").click();
111 | return false;
112 | }
113 | Materialize.toast(data[0][1], 4000);
114 | if(data[0][0]=='1'){
115 | mailSendCheck();
116 | }
117 | },
118 | error: function(data){
119 | debugLog(data);
120 | }
121 | });
122 | $("#on-captcha").click();
123 | return false;
124 | });
125 |
126 | $('#regaccount').click(function(){
127 | debugLog("click this!");
128 | return false;
129 | if(!$( '[name="verify_agree"]' ).prop( 'checked' )){
130 | Materialize.toast("请同意注册协议!", 4000);
131 | return false;
132 | }
133 | else{
134 | $('#regaccount').html('提交中...');
135 | $.ajax({
136 | type: 'post',
137 | url: 'ajax.php?m=register',
138 | data: {'password':$('#verify_password').val(),'repeat':$('#verify_repeat').val(),'regkey':$('#verify_regkey').val(),'token':token},
139 | dataType:'json',
140 | success: function(data){
141 | debugLog(data);
142 | if(errorCheck(data)){
143 | $('#regaccount').html('注册');
144 | return false;
145 | }
146 | Materialize.toast(data[0][1],4000);
147 | if(data[0][0]=="1"){
148 | setTimeout(function(){
149 | window.location.href="./account.html";
150 | },2000);
151 | }
152 | if(data[0][0]=='2'){
153 | setTimeout(function(){
154 | window.location.href="./register.html";
155 | },2000);
156 | }
157 | $('#regaccount').html('注册');
158 | },
159 | error: function(data){
160 | debugLog(data);
161 | }
162 | });
163 | return false;
164 | }
165 | });
166 | });
167 |
--------------------------------------------------------------------------------
/js/resetpwd.js:
--------------------------------------------------------------------------------
1 | /*判断是否进行了邮件传输情况*/
2 | function mailSendCheck()
3 | {
4 | debugLog("load_reset run-->");
5 | if(loggedin){
6 | Materialize.toast("您已登陆!", 4000);
7 | window.location.href="account.html";
8 | return false;
9 | }
10 | $.ajax({
11 | type:'post',
12 | url:'ajax.php?m=mailSendCheck',
13 | data:"token="+token,
14 | dataType:'json',
15 | success:function(data){
16 | debugLog(data);
17 | errorCheck(data);
18 | if(data[0][0]=="2"){
19 | $('#resetone').hide();
20 | $('#resettwo').show();
21 | }
22 | else{
23 | $('#resetone').show();
24 | $('#resettwo').hide();
25 | }
26 | },
27 | error:function(data){
28 | debugLog(data);
29 | }
30 | });
31 | return false;
32 | }
33 |
34 | $(document).ready(function(){
35 |
36 | mailSendCheck();
37 | getCaptcha();
38 | $("#sendmail").click(function(){
39 | $.ajax({
40 | type:'post',
41 | url:'ajax.php?m=sendResetMail',
42 | data:{'captcha':$('#captcha').val(),'email':$('#email').val(),'token':token},
43 | dataType:'json',
44 | success: function(data) {
45 | debugLog(data);
46 | if(errorCheck(data)){
47 | getCaptcha();
48 | return false;
49 | }
50 | Materialize.toast(data[0][1], 4000);
51 | getCaptcha();
52 | if(data[0][0]=='1'){
53 | mailSendCheck();
54 | }
55 | },
56 | error: function(data){
57 | debugLog(data);
58 | }
59 | });
60 | return false;
61 | });
62 |
63 | $('#resetaccount').click(function(){
64 | $('#resetaccount').html('提交中...');
65 | $.ajax({
66 | type: 'post',
67 | url: 'ajax.php?m=resetPassword',
68 | data: {'password':$('#password').val(),'repeat':$('#repeat').val(),'resetkey':$('#resetkey').val(),'token':token},
69 | dataType:'json',
70 | success: function(data){
71 | debugLog(data);
72 | if(errorCheck(data)){
73 | return false;
74 | }
75 | Materialize.toast(data[0][1],4000);
76 | if(data[0][0]=="1"){
77 | setTimeout(function(){
78 | window.location.href="./account.html";
79 | },2000);
80 | }
81 | if(data[0][0]=='2'){
82 | setTimeout(function(){
83 | window.location.href="./register.html";
84 | },2000);
85 | }
86 | $('#resetaccount').html('重置密码');
87 | },
88 | error: function(data){
89 | debugLog(data);
90 | }
91 | });
92 | return false;
93 | })
94 | });
95 |
--------------------------------------------------------------------------------
/js/scoreboard.js:
--------------------------------------------------------------------------------
1 | function getRankList(data) {
2 | var table = $( '' );
3 | var thead = $( '' );
4 | $( '' ).text( 'Rank' ).appendTo( thead );
5 | $( ' | ' ).text( 'Avatar' ).appendTo( thead );
6 | $( ' | ' ).text( 'Name' ).appendTo( thead );
7 | $( ' | ' ).text( 'Speak' ).appendTo( thead );
8 | $( ' | ' ).text( 'Score' ).appendTo( thead );
9 | thead.appendTo(table);
10 | $.each(
11 | data,
12 | function(num,content){
13 | var trow = $( '' );
14 | $( '' ).text( num+1 ).appendTo( trow );
15 | $(' | ').appendTo( trow );
16 | $( ' | ' ).text( content[1]).appendTo( trow );
17 | $( ' | ' ).text( content[2]).appendTo( trow );
18 | $( ' | ' ).text( content[0]).appendTo( trow );
19 | trow.appendTo( table );
20 | }
21 | );
22 | $( '#ranking' ).html( table.html() );
23 | return false;
24 | }
25 |
26 | function getRankPic(data) {
27 | var info=[];
28 | if(data[0][0]=='0'){
29 | return false;
30 | }
31 | $.each(data,function(n,content){
32 | if(n>14){
33 | return false;
34 | }
35 | info[n]={name:content[1],data:content[4]};
36 | })
37 | debugLog("info:");
38 | debugLog(info);
39 | $('#rank_pic').highcharts({
40 | credits:{enabled: false },
41 | exporting:{enabled:false},
42 | colors:['#37a2da','#32c5e9','#67e0e3','#9fe6b8','#ffdb5c','#ff9f7f','#fb7293','#e062ae','#e690d1','#e7bcf3','#9d96f5','#8378ea','#96bfff'],
43 | //chart: {type: 'spline'},
44 | title: {text: null},
45 | legend:{
46 | align:'right',
47 | verticalAlign:'top',
48 | layout:'vertical',
49 | floating:true,
50 | },
51 | xAxis: {
52 | type: 'datetime',
53 | title: {text: null}
54 | },
55 | yAxis: {title: {text: null},min: 0},
56 | tooltip: {
57 | headerFormat: '{series.name} ',
58 | pointFormat: '{point.x:%b-%e}: {point.y:f}'
59 | },
60 | plotOptions: {
61 | spline: {
62 | marker: {
63 | enabled: true
64 | }
65 | }
66 | },
67 | series:info
68 | });
69 | return false;
70 | }
71 | function getRanks(){
72 | $.ajax({
73 | type: 'post',
74 | url: 'ajax.php?m=getRank',
75 | dataType:'json',
76 | data:{'token':token,'is_img':1},
77 | success: function(data) {
78 | debugLog(data);
79 | if(errorCheck(data)){
80 | return false;
81 | }
82 | if(data[1].length==0){
83 | return false;
84 | }
85 | getRankList(data[1]);
86 | getRankPic(data[1]);
87 | },
88 | error: function(data) {
89 | debugLog(data);
90 | }
91 | });
92 | return false;
93 | }
94 | function countSecond ()
95 | {
96 | getRanks();
97 | setTimeout ("countSecond ()", 10000);
98 | }
99 | $(document).ready(function(){
100 | countSecond();
101 | });
102 |
--------------------------------------------------------------------------------
/notice.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
52 |
53 |
58 |
67 |
68 |
69 |
70 |
--------------------------------------------------------------------------------
/resetpwd.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
52 |
53 |
54 |
55 |
56 |
61 |
62 |
63 |
64 |
65 | email
66 |
67 |
68 |
69 |
70 | subject
71 |
72 |
73 |
74 | ![]()
75 |
76 |
77 |
95 |
96 |
97 |
98 |
99 |
100 |
101 |
102 |
103 |
--------------------------------------------------------------------------------
/scoreboard.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
52 |
53 |
58 |
59 |
71 |
72 |
73 |
74 |
75 |
--------------------------------------------------------------------------------
| | |