Browse Source

For ancient browsers

pull/6/head
Menci 7 years ago
parent
commit
ca3aa23026
  1. 2
      views/index.ejs
  2. 2
      views/problem_data.ejs
  3. 2
      views/ranklist.ejs

2
views/index.ejs

@ -61,7 +61,7 @@
elem.style = 'overflow: hidden; width: 100%; '; elem.style = 'overflow: hidden; width: 100%; ';
elem.style.maxHeight = lineHeight + 'px'; elem.style.maxHeight = lineHeight + 'px';
elem.innerHTML = html; elem.innerHTML = html;
var imgs = Array.from(elem.getElementsByTagName('img')); var imgs = Array.prototype.slice.call(elem.getElementsByTagName('img'));
for (var i in imgs) imgs[i].parentNode.removeChild(imgs[i]); for (var i in imgs) imgs[i].parentNode.removeChild(imgs[i]);
var script = document.getElementById('user-infomation-script-<%= i %>'); var script = document.getElementById('user-infomation-script-<%= i %>');
script.parentNode.replaceChild(elem, script); script.parentNode.replaceChild(elem, script);

2
views/problem_data.ejs

@ -146,7 +146,7 @@ function getIcon(filename) {
<script> <script>
function check_replace() { function check_replace() {
var old_files = <%- JSON.stringify((testdata && testdata.files ? testdata.files : []).map(x => x.filename)) %>; var old_files = <%- JSON.stringify((testdata && testdata.files ? testdata.files : []).map(x => x.filename)) %>;
var replaced_files = Array.from($('#upload_file')[0].files).map(function (x) { return x.name; }).filter(function (x) { return old_files.includes(x); }); var replaced_files = Array.prototype.slice.call($('#upload_file')[0].files).map(function (x) { return x.name; }).filter(function (x) { return old_files.includes(x); });
var s = ''; var s = '';
for (let file of replaced_files) s += '<samp>' + file + '</samp><br>'; for (let file of replaced_files) s += '<samp>' + file + '</samp><br>';
if (s) { if (s) {

2
views/ranklist.ejs

@ -45,7 +45,7 @@
elem.style = 'overflow: hidden; width: 100%; '; elem.style = 'overflow: hidden; width: 100%; ';
elem.style.maxHeight = lineHeight + 'px'; elem.style.maxHeight = lineHeight + 'px';
elem.innerHTML = html; elem.innerHTML = html;
var imgs = Array.from(elem.getElementsByTagName('img')); var imgs = Array.prototype.slice.call(elem.getElementsByTagName('img'));
for (var i in imgs) imgs[i].parentNode.removeChild(imgs[i]); for (var i in imgs) imgs[i].parentNode.removeChild(imgs[i]);
var script = document.getElementById('user-infomation-script-<%= i %>'); var script = document.getElementById('user-infomation-script-<%= i %>');
script.parentNode.replaceChild(elem, script); script.parentNode.replaceChild(elem, script);

Loading…
Cancel
Save