From ae5590521a1cb598ee94f4b4a85e294c1be3dfc0 Mon Sep 17 00:00:00 2001 From: venkateswaran ubuntu Date: Mon, 27 Nov 2023 12:00:07 +0530 Subject: [PATCH] workarea changes : RV --- addform.html | 190 ++++++++++++++++++++++----------------------- package-lock.json | 194 +++++++++++++++++++++++----------------------- style.css | 16 ++-- xml2json.js | 4 +- 4 files changed, 200 insertions(+), 204 deletions(-) diff --git a/addform.html b/addform.html index 335222f..a0131e3 100644 --- a/addform.html +++ b/addform.html @@ -48,13 +48,12 @@ - - + - - - + + @@ -375,16 +374,16 @@ .work-area1{ background-color: transparent; position: absolute; - top:-8px; - left:-18px; + top:13px; + left:295px; border-width:0; - transform:rotate(58deg); - transition: box-shadow 0.3s, background-color 0.3s; + /* transform:rotate(58deg); + transition: box-shadow 0.3s, background-color 0.3s; */ color: #bf303b; } .work-area1::before{ - content: '\2BC7'; + content: '\2715'; font-size: 24px; } .work-area::before{ @@ -392,7 +391,7 @@ } .menu-symbol { position:absolute; - right:0; + right:20px; background-color: transparent; margin-top: 14px; border-radius: 20%; @@ -606,6 +605,7 @@ h1.title{ max-height: calc(100% - 60px); overflow-y: auto; margin-bottom: 10px; + height:100%; } #messageForm { @@ -744,19 +744,10 @@ h1.title{ document.addEventListener('DOMContentLoaded', function () { // Initialize Quill with your specific configuration var quill = new Quill('#workarea', { - theme: 'snow', + theme: 'snow', modules: { - toolbar: { - container: toolbarOptions, - clipboard: { - matchVisual: true, - }, - ImageResize: { - displaySize: true, - modules: ['Resize', 'DisplaySize', 'Toolbar'] - } - }, - } + toolbar: toolbarOptions, + } }); var chat_Div = $("#workarea"); @@ -767,24 +758,24 @@ h1.title{ $('#workarea').focus(function () { rtc_hide_and_show(chatRtc); }); - + document.getElementById('sidebarToggle2').addEventListener('click', function () { var sidebar = document.getElementById('rightSidebar'); document.body.classList.toggle('sidebar-open'); - if (sidebar.style.width === '250px') { + if (sidebar.style.width === '350px') { sidebar.style.width = '0'; } else { - sidebar.style.width = '250px'; + sidebar.style.width = '350px'; } }); document.getElementById('sidebarToggle3').addEventListener('click', function () { var sidebar = document.getElementById('rightSidebar'); document.body.classList.toggle('sidebar-open'); - if (sidebar.style.width === '250px') { + if (sidebar.style.width === '350px') { sidebar.style.width = '0'; } else { - sidebar.style.width = '250px'; + sidebar.style.width = '350px'; } }); @@ -803,6 +794,8 @@ h1.title{ var mathCheckbox = document.getElementById('Choicemath_messageInput'); var mathField = document.getElementById('workarea_math'); var richText = document.getElementById('workarea'); + var quillrichText = document.getElementById('messageInput_rtc'); + // Ensure MathQuill field is initially hidden $(mathField).hide(); // $(richText1).show(); @@ -810,11 +803,12 @@ h1.title{ if (mathCheckbox.checked) { $(mathField).show(); $(richText).hide(); - rtc_hide_and_show(chatRtc); + $('#messageInput_rtc').hide(); } else { $(mathField).hide(); $(richText).show(); - rtc_hide_and_show(chatRtc); + $('#messageInput_rtc').hide(); + } }); @@ -836,12 +830,12 @@ h1.title{ }); async function sendMessage(quill) { - var workarea = document.getElementById('workarea'); + + var workarea = document.getElementById('workarea').querySelector('.ql-editor').innerHTML; var mathField = document.getElementById('workarea_math'); - var messagesContainer = document.getElementById('messages'); - console.log("workarea",workarea); - console.log("mathField",mathField); - console.log("messagesContainer",messagesContainer); + // console.log("workarea",workarea); + // console.log("mathField",mathField); + // console.log("messagesContainer",messagesContainer); var content = ''; @@ -852,13 +846,18 @@ h1.title{ content = await convertToLatex(mathFieldContent); } else { - content = quill.root.innerHTML.trim(); + content = document.getElementById('workarea').querySelector('.ql-editor').innerHTML; + } // Log the content to the console - console.log("Message Content: ", content); + // console.log("Message Content: ", content); if (content !== '') { + + var messagesContainer = document.getElementById('messages'); + + // console.log(messagesContainer) // var messageElement = document.createElement('div'); // messageElement.className = 'message'; @@ -870,6 +869,9 @@ h1.title{ if ($('#Choicemath_messageInput').prop('checked')) { // Clear the math field content + var mathJaxContainer = document.getElementById('workarea_math'); + // console.log(mathJaxContainer.value) + mathJaxContainer.value = ""; // mathField.latex(''); } else { quill.setText(''); @@ -883,16 +885,15 @@ h1.title{ const mathStatusBoolean = true // Check if the text contains

tags - console.log("ff") return new Promise(async(resolve, reject) => { if (!/

|<\/p>/i.test(text)) { - console.log('text:' , text) + // console.log('text:' , text) if (mathStatusBoolean) { - console.log('text1:' , text) + // console.log('text1:' , text) // Use MathJax to convert the text to LaTeX const cov = await MathJax.tex2chtml(text).outerHTML; - console.log('cov:' , cov); + // console.log('cov:' , cov); resolve(cov); //return cov; } else { @@ -901,9 +902,9 @@ h1.title{ //return text; } } else { - console.log("pq") + // console.log("pq") const cov = await MathJax.tex2chtml(text).outerHTML; - console.log('cov:' , cov) + // console.log('cov:' , cov) resolve(cov); //return cov; } @@ -911,19 +912,20 @@ h1.title{ }); } +