workarea math changes : RV

This commit is contained in:
venkateswaran ubuntu 2023-11-30 17:46:12 +05:30
parent 432adb7709
commit 87a9e1eb42
3 changed files with 44 additions and 67 deletions

View File

@ -1282,14 +1282,42 @@ $("#overlay").show();
$('#workarea_math').click(function(){
console.log('called');
$('#workarea_math').css('margin-bottom', '190px');
$('#workarea_math').css('margin-bottom', '240px');
localStorage.setItem('workAreaMath', true);
});
$(document).on("click", function (event) {
var ids = document.getElementById('workarea_math')
console.log(ids)
// console.log('Clicked element id:', event.target.id);
// console.log('Clicked element:', event.target);
const targetElement = event.target;
var tragetedId = event.target.id.startsWith("ML");
const classList = Array.from(event.target.classList);
const hasMLKClass = classList.some(className => className.startsWith("MLK") || className.startsWith("row") || className.startsWith("left") || className.startsWith("ML") || className.startsWith("action"));
const isSvgElement = targetElement.closest('svg') || targetElement.closest('i');
// console.log('svg',isSvgElement);
// console.log(hasMLKClass);
if (event.target.id !== 'workarea_math' && tragetedId == false && hasMLKClass == false && isSvgElement == null) {
// console.log('Inside if');
var value = localStorage.getItem('workAreaMath');
if (value === 'true') {
// console.log('Value:', value);
$('#workarea_math').css('margin-bottom', '0px');
localStorage.removeItem('workAreaMath');
} else {
// $('#workarea_math').css('margin-bottom', '190px');
// console.log('Value is not true');
}
}
});
var ids = document.getElementById('workarea_math');
function clearMessage() {
var val = document.getElementById('messages') ;
@ -1392,27 +1420,6 @@ $(document).on("click", function (event) {
}
});
$(document).on("click", function (event) {
console.log(event.target.id);
console.log(event.target.id == 'workarea_math' ? 'true' : 'false');
if(event.target.id !== 'workarea_math')
{
var element = $('.ML__virtual-keyboard-toggle');
console.log(element);
var value = localStorage.getItem('workAreaMath');
console.log('valeu : ', value);
console.log('type : ',typeof value);
if(value === 'true'){
$('#workarea_math').css('margin-bottom', '0px');
localStorage.removeItem('workAreaMath');
}
}
// localStorage.removeItem('workAreaMath');
});
document.addEventListener('DOMContentLoaded', function () {
const scrollToTopBtn = document.getElementById('SaveButton');
@ -1550,8 +1557,6 @@ function loadXML(xmlFileName) {
} else{
decodeData = data;
}
console.log('jsonDecodeData : ', jsonDecodeData);
xml2json(decodeData);
@ -1742,20 +1747,20 @@ var quill = new Quill('#Question_title', {
var quill = new Quill('#QuestionsGroupIdset ', {
// var quill = new Quill('#QuestionsGroupIdset ', {
theme: 'snow',
modules: {
toolbar: toolbarOptions,
clipboard: {
matchVisual: true,
},
imageResize:{
displaySize:true,
modules: [ 'Resize', 'DisplaySize', 'Toolbar' ],
}
}
});
// theme: 'snow',
// modules: {
// toolbar: toolbarOptions,
// clipboard: {
// matchVisual: true,
// },
// imageResize:{
// displaySize:true,
// modules: [ 'Resize', 'DisplaySize', 'Toolbar' ],
// }
// }
// });
var quill = new Quill('#Question_description', {
theme: 'snow',

View File

@ -1,26 +0,0 @@
const fs = require('fs');
// Function to encode data to base64
function encodeToBase64(data) {
return Buffer.from(data, 'utf-8').toString('base64');
}
// Function to encode .env file to base64
function encodeEnvFileToBase64(envFilePath, outputFilePath) {
// Read the content of the .env file
const envData = fs.readFileSync(envFilePath, 'utf-8');
// Encode the data to base64
const base64Data = encodeToBase64(envData);
// Write the base64-encoded data to a new file
fs.writeFileSync(outputFilePath, base64Data, 'utf-8');
console.log('File encoded to base64 successfully.');
}
// Example usage
const envFilePath = '/.env';
const outputFilePath = '/encoded_base64.env';
encodeEnvFileToBase64(envFilePath, outputFilePath);

View File

@ -1,5 +1,3 @@
const { loadImage } = require("jodit/types/core/helpers");
function jsonToHtml(jsonData) {
// console.log(jsonData);