Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 18 additions & 0 deletions src/StringPrototype.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
if (String.prototype.replaceAll === undefined) {
String.prototype.replaceAll = function (before, after) {
let res = new String(), matched = 0;
for (let i = 0; i < this.length; i += 1) {
if (this[i] == before[matched]) {
matched += 1;
if (matched == before.length) {
res += after;
matched = 0;
}
} else {
matched = 0;
res += this[i];
}
}
return res;
};
}
6 changes: 4 additions & 2 deletions src/components/problem/content.vue
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<template>
<div id="problem-view">
<div id="content">
<div id="problem-content">
<div id="problem-content" v-loading="problemLoading">
<div v-if="!isWider" id="full-screen-button" @click="full_screen()">
Expand
<i class="el-icon-arrow-right"></i>
Expand Down Expand Up @@ -85,7 +85,8 @@ export default {
enable: true,
hidden: false,
time: '-',
memery: '-'
memery: '-',
problemLoading: true
};
},
methods: {
Expand All @@ -101,6 +102,7 @@ export default {
this.memery = data.memory_limit / 1000;
this.time = data.time_limit;
this.hidden = !data.enabled;
this.problemLoading = false;
})
.catch(err => {
if(err.request.status === 404) {
Expand Down
2 changes: 2 additions & 0 deletions src/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,8 @@ import './assets/css/fontstyle.css';
import './assets/css/basic.css';
import('./loader/load');

import './StringPrototype';

Vue.config.productionTip = false;

new Vue({
Expand Down