`;
const blob=new Blob([htmlContent], { type: 'application/msword' });
const url=URL.createObjectURL(blob);
const a=document.createElement('a');
a.href=url;
a.download='bamini-output.doc';
document.body.appendChild(a);
a.click();
document.body.removeChild(a);
URL.revokeObjectURL(url);
showNotification('Word file saved successfully!');
}
function shareViaWhatsApp(){
if(!baminiOutput.value){
showNotification('No content to share!');
return;
}
const text=encodeURIComponent(baminiOutput.value);
const url=`https://wa.me/?text=${text}`;
window.open(url, '_blank');
}
convertBtn.addEventListener('click', convertToBamini);
clearBtn.addEventListener('click', clearText);
copyBtn.addEventListener('click', copyToClipboard);
pasteBtn.addEventListener('click', pasteFromClipboard);
saveTextBtn.addEventListener('click', saveToTextFile);
saveWordBtn.addEventListener('click', saveToWordFile);
shareWhatsappBtn.addEventListener('click', shareViaWhatsApp);
unicodeInput.addEventListener('keydown', function(e){
if(e.key==='Enter'&&e.shiftKey){
e.preventDefault();
convertToBamini();
}});
google.load("elements", "1", {
packages: "transliteration"
});
function onLoad(){
const options={
sourceLanguage: google.elements.transliteration.LanguageCode.ENGLISH,
destinationLanguage: [google.elements.transliteration.LanguageCode.TAMIL],
shortcutKey: 'ctrl+g',
transliterationEnabled: true
};
const control=new google.elements.transliteration.TransliterationControl(options);
control.makeTransliteratable(['transliterateDiv']);
}
google.setOnLoadCallback(onLoad);