You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
78 lines
2.0 KiB
78 lines
2.0 KiB
const { createApp } = Vue;
|
|
|
|
const fontsMap = {
|
|
ambili: "FML-TTambili",
|
|
charaka: "FML-TTRevathi",
|
|
haritha: "haritha",
|
|
indulekha: "FML-TTindulekha",
|
|
karthika: "FML-TTkarthika",
|
|
manorama: "manorama",
|
|
matweb: "matweb",
|
|
nandini: "FML-TTnandini",
|
|
panchari: "panchari",
|
|
revathi: "FML-TTrevathi",
|
|
uma: "FML-TTkaumudi",
|
|
};
|
|
|
|
createApp({
|
|
data() {
|
|
return {
|
|
form: {
|
|
text: `ചെണ്ടമേളം
|
|
കുഞ്ചൻ നമ്പ്യാർ
|
|
മഞ്ഞൾ പ്രസാദം
|
|
തിങ്കളാഴ്ച
|
|
`,
|
|
font: "karthika",
|
|
},
|
|
allFonts: Object.keys(fontsMap),
|
|
asciiTxt: "",
|
|
asciiFont: "",
|
|
};
|
|
},
|
|
|
|
methods: {
|
|
async onSubmit() {
|
|
const res = await fetch("/api/a2u", {
|
|
method: "post",
|
|
body: JSON.stringify(this.form),
|
|
headers: {
|
|
"Content-type": "application/json",
|
|
},
|
|
});
|
|
const data = await res.json();
|
|
this.asciiTxt = data.ascii;
|
|
this.asciiFont = fontsMap[this.form.font];
|
|
},
|
|
correctOldChillu(e) {
|
|
return (e = e
|
|
.replace("ൺ", "ണ്")
|
|
.replace("ൻ", "ന്")
|
|
.replace("ർ", "ര്")
|
|
.replace("ൽ", "ല്")
|
|
.replace("ൾ", "ള്")
|
|
.replace("ോ", "ോ")
|
|
.replace("ൊ", "ൊ"));
|
|
},
|
|
correctNewChillu(e) {
|
|
return (e = e
|
|
.replaceAll("ണ്", "ൺ")
|
|
.replaceAll("ന്", "ൻ")
|
|
.replaceAll("ര്", "ർ")
|
|
.replaceAll("ല്", "ൽ")
|
|
.replaceAll("ള്", "ൾ")
|
|
.replaceAll("ോ", "ോ")
|
|
.replaceAll("ൊ", "ൊ")
|
|
.replaceAll("൦", "0")
|
|
.replaceAll("൧", "1")
|
|
.replaceAll("൨", "2")
|
|
.replaceAll("൩", "3")
|
|
.replaceAll("൪", "4")
|
|
.replaceAll("൫", "5")
|
|
.replaceAll("൬", "6")
|
|
.replaceAll("൭", "7")
|
|
.replaceAll("൮", "8")
|
|
.replaceAll("൯", "9"));
|
|
},
|
|
},
|
|
}).mount("#app");
|
|
|