td {{ c.from.name }}
td(v-if="!!c.to[0]")
span(v-for="pname in c.to") {{ pname }}
- td(v-else) {{ c.to.length - 1 }} player{{ c.to.length >= 3 ? 's' : '' }}
+ td(v-else) {{ c.to.length }} player{{ c.to.length >= 2 ? 's' : '' }}
td {{ c.timeControl }}
</template>
import params from "../parameters"; //for server URL
+// TODO: replace by fetch API ?
+// https://www.sitepoint.com/xmlhttprequest-vs-the-fetch-api-whats-best-for-ajax-in-2019/
+
// From JSON (encoded string values!) to "arg1=...&arg2=..."
function toQueryString(data)
{
export function extractTime(timeControl)
{
- const tcParts = timeControl.replace(/ /g,"").split('+');
- const mainTimeArray = tcParts[0].match(/([0-9]+)([smhd])/);
+ let tcParts = timeControl.replace(/ /g,"").split('+');
+ // Concatenate usual time control suffixes, in case of none is provided
+ tcParts[0] += "m";
+ tcParts[1] += "s";
+ const mainTimeArray = tcParts[0].match(/([0-9]+)([smhd]+)/);
if (!mainTimeArray)
return null;
const mainTimeValue = parseInt(mainTimeArray[1]);
let increment = 0;
if (tcParts.length >= 2)
{
- const incrementArray = tcParts[1].match(/([0-9]+)([smhd])/);
+ const incrementArray = tcParts[1].match(/([0-9]+)([smhd]+)/);
if (!incrementArray)
return null;
const incrementValue = parseInt(incrementArray[1]);
import { getRandString } from "@/utils/alea";
import GameList from "@/components/GameList.vue";
import ChallengeList from "@/components/ChallengeList.vue";
+import { GameStorage } from "@/utils/storage";
export default {
name: "my-hall",
components: {