diff options
author | pzread <netfirewall@gmail.com> | 2013-03-10 15:02:19 +0800 |
---|---|---|
committer | pzread <netfirewall@gmail.com> | 2013-03-10 15:02:19 +0800 |
commit | 0bcc905d92d2f69a0b961746be1f19ef096857a3 (patch) | |
tree | 514abd4fd4319cb6e05df7007580f8afc5896040 /toj/pmod/pmod_test | |
parent | 898913018b1d3f289f10d4716e28489497c977cb (diff) | |
download | taiwan-online-judge-0bcc905d92d2f69a0b961746be1f19ef096857a3.tar taiwan-online-judge-0bcc905d92d2f69a0b961746be1f19ef096857a3.tar.gz taiwan-online-judge-0bcc905d92d2f69a0b961746be1f19ef096857a3.tar.bz2 taiwan-online-judge-0bcc905d92d2f69a0b961746be1f19ef096857a3.tar.lz taiwan-online-judge-0bcc905d92d2f69a0b961746be1f19ef096857a3.tar.xz taiwan-online-judge-0bcc905d92d2f69a0b961746be1f19ef096857a3.tar.zst taiwan-online-judge-0bcc905d92d2f69a0b961746be1f19ef096857a3.zip |
Add Virtual URI System. New UI design. Improve sqmod_test
Diffstat (limited to 'toj/pmod/pmod_test')
-rwxr-xr-x | toj/pmod/pmod_test/pmod_test.css | 33 | ||||
-rwxr-xr-x | toj/pmod/pmod_test/pmod_test.html | 5 | ||||
-rwxr-xr-x | toj/pmod/pmod_test/pmod_test.js | 121 |
3 files changed, 78 insertions, 81 deletions
diff --git a/toj/pmod/pmod_test/pmod_test.css b/toj/pmod/pmod_test/pmod_test.css index 2cd5bfb..f8a48a6 100755 --- a/toj/pmod/pmod_test/pmod_test.css +++ b/toj/pmod/pmod_test/pmod_test.css @@ -1,11 +1,6 @@ div.pmod_test > div.info{ - width:250px; - height:100%; - padding:0px 0px 0px 6px; - position:absolute; - top:0px; - left:0px; - overflow:auto; + width:240px; + float:left; } div.pmod_test > div.info > table.statlist{ width:100%; @@ -13,10 +8,11 @@ div.pmod_test > div.info > table.statlist{ border-collapse:collapse; } div.pmod_test > div.info > table.statlist td.name{ - width:96px; + width:76px; } div.pmod_test > div.info > table.statlist td.value{ width:auto; + padding:0px 0px 0px 6px; } div.pmod_test > div.info > table.limitlist{ width:100%; @@ -24,30 +20,29 @@ div.pmod_test > div.info > table.limitlist{ border-collapse:collapse; } div.pmod_test > div.info > table.limitlist td.name{ - width:96px + width:76px; } div.pmod_test > div.info > table.limitlist td.value{ width:auto; + padding:0px 0px 0px 6px; } div.pmod_test > div.info > table.scorelist{ width:100%; text-align:left; border-collapse:collapse; } -div.pmod_test > div.info > table.scorelist tr.item{ - font-size:16; -} div.pmod_test > div.info > table.scorelist th.no,div.pmod_test > div.info > table.scorelist td.no{ - width:64px; + width:76px; } div.pmod_test > div.info > table.scorelist th.score,div.pmod_test > div.info > table.scorelist td.score{ width:auto; + padding:0px 0px 0px 6px; } div.pmod_test > div.content{ - height:100%; - padding:0px 6px 0px 0px; - position:absolute; - top:0px; - left:256px; - overflow:auto; + width:978px; + margin:0px 0px 0px 6px; + float:left; +} +div.pmod_test p{ + text-indent:32px; } diff --git a/toj/pmod/pmod_test/pmod_test.html b/toj/pmod/pmod_test/pmod_test.html index 10b297b..7f1a1b8 100755 --- a/toj/pmod/pmod_test/pmod_test.html +++ b/toj/pmod/pmod_test/pmod_test.html @@ -17,11 +17,11 @@ <h3>限制</h3> <table class="limitlist"> <tr> - <td class="name">時間限制</td> + <td class="name">執行時間</td> <td class="value timelimit"></td> </tr> <tr> - <td class="name">記憶體限制</td> + <td class="name">記憶體</td> <td class="value memlimit"></td> </tr> </table> @@ -35,3 +35,4 @@ </table> </div> <div class="content"></div> +<div style="width:100%; height:32px; clear:both;"></div> diff --git a/toj/pmod/pmod_test/pmod_test.js b/toj/pmod/pmod_test/pmod_test.js index c691c8a..3f1e577 100755 --- a/toj/pmod/pmod_test/pmod_test.js +++ b/toj/pmod/pmod_test/pmod_test.js @@ -1,74 +1,75 @@ -var pmod_test = { - init:function(that,j_page){ - that.export_urlchange = function(direct){ - if(direct == 'in'){ - that.fadein(j_page); - j_page.find('div.info > h2.proid').text('ProID:' + that.proid); - $.post('/toj/pmod/pmod_test/pmod_test.php',{'proid':JSON.stringify(that.proid)},function(res){ - var i; - var reto; - var seto; - var j_table; - var j_item; +var pmod_test = function(that,j_pbox){ + that.node.url_chg = function(direct,url_upart,url_dpart){ + if(direct == 'in'){ + that.fadein(j_pbox); - if(res[0] != 'E'){ - reto = JSON.parse(res); - seto = reto.set; - index.setcontent($('<span>' + that.proname + '</span>')); - j_page.find('div.content').html(reto.content); + j_pbox.find('div.info > h2.proid').text('ProID:' + that.proid); + $.post('/toj/pmod/pmod_test/pmod_test.php',{'proid':JSON.stringify(that.proid)},function(res){ + var i; + var reto; + var seto; + var j_table; + var j_item; - $.post('/toj/php/problem.php',{'action':'get_pro_stat','data':JSON.stringify({'proid':that.proid})},function(res){ - var reto + if(res[0] != 'E'){ + reto = JSON.parse(res); + seto = reto.set; + index.content_set($('<span>' + that.proname + '</span>')); + j_pbox.find('div.content').html(reto.content); - if(res[0] != 'E'){ - reto = JSON.parse(res); - j_page.find('div.info > table.statlist td.bscore').text(reto.score); - if(reto.tried == false){ - j_page.find('div.info > table.statlist td.bscore').css('color','#1C1C1C'); - j_page.find('div.info > table.statlist td.stat').text('未嘗試'); + $.post('/toj/php/problem.php',{'action':'get_pro_stat','data':JSON.stringify({'proid':that.proid})},function(res){ + var reto + + if(res[0] != 'E'){ + reto = JSON.parse(res); + j_pbox.find('div.info > table.statlist td.bscore').text(reto.score); + if(reto.tried == false){ + j_pbox.find('div.info > table.statlist td.bscore').css('color','#1C1C1C'); + j_pbox.find('div.info > table.statlist td.stat').text('未嘗試'); + }else{ + if(reto.score < 60){ + j_pbox.find('div.info > table.statlist td.bscore').css('color','#FF0000'); + }else if(reto.score < 80){ + j_pbox.find('div.info > table.statlist td.bscore').css('color','#00FF00'); + }else if(reto.score < 100){ + j_pbox.find('div.info > table.statlist td.bscore').css('color','#FFFF00'); }else{ - if(reto.score < 60){ - j_page.find('div.info > table.statlist td.bscore').css('color','#FF0000'); - }else if(reto.score < 80){ - j_page.find('div.info > table.statlist td.bscore').css('color','#00FF00'); - }else if(reto.score < 100){ - j_page.find('div.info > table.statlist td.bscore').css('color','#FFFF00'); - }else{ - j_page.find('div.info > table.statlist td.bscore').css('color','#FFFFFF'); - } + j_pbox.find('div.info > table.statlist td.bscore').css('color','#FFFFFF'); + } - if(reto.is_ac == true){ - j_page.find('div.info > table.statlist td.stat').text('已通過'); - }else{ - j_page.find('div.info > table.statlist td.stat').text('已嘗試'); - } + if(reto.is_ac == true){ + j_pbox.find('div.info > table.statlist td.stat').text('已通過'); + }else{ + j_pbox.find('div.info > table.statlist td.stat').text('已嘗試'); } } - }); + } + }); - j_page.find('div.info > table.limitlist td.timelimit').text(seto.timelimit + ' ms'); - j_page.find('div.info > table.limitlist td.memlimit').text(seto.memlimit + ' KB'); + j_pbox.find('div.info > table.limitlist td.timelimit').text(seto.timelimit + ' ms'); + j_pbox.find('div.info > table.limitlist td.memlimit').text(seto.memlimit + ' KB'); - j_table = j_page.find('table.scorelist'); - j_table.find('tr.item').remove(); - for(i = 0;i < seto.count;i++){ - j_item = $('<tr class="item"><td class="no"></td><td class="score"></td></tr>'); - j_item.find('td.no').text(i + 1); - j_item.find('td.score').text(seto.score[i]); - j_table.append(j_item); - } + j_table = j_pbox.find('table.scorelist'); + j_table.find('tr.item').remove(); + for(i = 0;i < seto.count;i++){ + j_item = $('<tr class="item"><td class="no"></td><td class="score"></td></tr>'); + j_item.find('td.no').text(i + 1); + j_item.find('td.score').text(seto.score[i]); + j_table.append(j_item); } - }); - }else if(direct == 'out'){ - that.fadeout(j_page); - }else if(direct == 'same'){ - } - }; + MathJax.Hub.Queue(["Typeset",MathJax.Hub,j_pbox[0]]); + } + }); + }else if(direct == 'out'){ + that.fadeout(j_pbox); + } + + return 'cont'; + }; - j_page.find('div.info > button.submit').on('click',function(e){ - that.submit(); - }); - } + j_pbox.find('div.info > button.submit').on('click',function(e){ + that.submit(); + }); }; |