2. Lekhoniya: A Dynamic Text Formatting
Script
Introduction
Welcome to the world of Lekhoniya - a dynamic text formatting script designed to enhance
your web editing experience. Developed by the talented programmer Subham Mandal, this
script empowers users to apply rich formatting styles seamlessly.
Overview
The Console Magic
The script incorporates a unique console logging feature. onessssweb users will appreciate
the interactive console, providing real-time feedback on their actions. The console, housed
in the "console-card" element, displays messages and actions, making debugging and
monitoring a breeze.
javascript
const consoleLog = console.log;
const card = document.getElementById("console-card");
console.log = function () {
for (let i = 0; i < arguments.length; i++) {
const message = arguments[i];
const p = document.createElement('p');
p.textContent = message; card.appendChild(p);
}
consoleLog.apply(console, arguments);
card.style.opacity = 1;
if (hideTimeout) {
3. clearTimeout(hideTimeout);
}
hideTimeout = setTimeout(() => {
card.style.opacity = 0; // Hide the card
setTimeout(() => {
card.innerHTML = '';
}, 300);
}, 5000);
};
Text Formatting Wizardry
Lekhoniya introduces an innovative text formatting mechanism. The function
`applyFormatting` enables users to customize text color, font weight, family, size, and
decoration. It intelligently handles both selected and unselected text, providing a
seamless editing experience.
javascript
function applyFormatting(color, fontWeight, fontFamily, fontSize, textDecoration
saveSelection();
var span = document.querySelector('.main'); var
newNode = document.createElement('span');
newNode.style.color = color;
newNode.style.fontWeight = fontWeight;
newNode.style.fontFamily = fontFamily;
newNode.style.fontSize = fontSize;
newNode.style.textDecoration = textDecoration;
if (selectedRange.toString().length > 0) {
newNode.appendChild(selectedRange.extractContents());
selectedRange.insertNode(newNode);
} else {
newNode.innerHTML = '​'; // Zero-width space
selectedRange.insertNode(newNode);
selectedRange.setStartAfter(newNode);
selectedRange.setEndAfter(newNode);
restoreSelection();
}
}
Background Brilliance
The script doesn't stop at text formatting. Users can also apply background colors
effortlessly with the `applyBackgroundColor` function. Highlight your content with a splash
of color using
4. this powerful feature.
javascript
function applyBackgroundColor(color) {
saveSelection();
var span = document.querySelector('.main'); var
newNode = document.createElement('span');
newNode.style.backgroundColor = color;
if (selectedRange.toString().length > 0) {
newNode.appendChild(selectedRange.extractContents());
selectedRange.insertNode(newNode);
} else {
newNode.innerHTML = '​'; // Zero-width space
selectedRange.insertNode(newNode);
selectedRange.setStartAfter(newNode);
selectedRange.setEndAfter(newNode);
restoreSelection();
}
}
Usage Instructions
•
Text Formatting: Highlight the desired text and call `applyFormatting` with your
preferred styles.
•
Background Color: Select text or position the cursor, then invoke `applyBackgroundColor`
with
the desired color.
Conclusion
Embrace the power of Lekhoniya and elevate your web editing experience. The brilliance of
this script is a testament to the programming prowess of Subham Mandal. Dive in, explore,
and let your creativity flow! onessssweb users, rejoice!
Feel free to connect with Subham Mandal for any inquiries or enhancements to this incredible
script.
5. Context Menu Magic: A Dynamic Script
Introduction
Welcome to the world of Context Menu Magic! This script, designed to enhance user
interactions, introduces a dynamic context menu feature. Crafted by the talented
developer Subham Mandal, this script ensures a seamless and intuitive browsing
experience.
Overview
The Contextual Wonder
The script takes advantage of the `contextmenu` event, intercepting the default browser
context menu. When triggered, the script displays a customized menu, providing users
with a context-sensitive interface. This feature is particularly useful for web applications
where right- click functionality needs a touch of personalization.
javascript
document.addEventListener("contextmenu", function (event) {
event.preventDefault();
let menu = document.getElementById("menu");
menu.style.display = "block";
// Calculate the adjusted position accounting for scroll
let scrollX = window.pageXOffset || document.documentElement.scrollLeft; let
scrollY = window.pageYOffset || document.documentElement.scrollTop; var posX =
event.clientX + scrollX;
var posY = event.clientY + scrollY;
});
menu.styl
e.left =
posX +
"px";
menu.styl
e.top =
posY +
"px";
document.addEventListener("click", function (event) { var
menu = document.getElementById("menu");
menu.style.display = "none";
});
Mobile Menu Mastery
6. To add a touch of mobile responsiveness, the script introduces a mobile menu feature. The
`sidemenuopen` function toggles between the mobile menu and the regular side menu,
providing a smooth transition for users on various devices.
javascript
function sidemenuopen() {
document.getElementById("menumobile").style.display = 'block';
document.getElementById("sidemenu").style.display = 'none';
setTimeout(function () { document.getElementById("menumobile").style.display =
"none"; document.getElementById("sidemenu").style.display = 'block';
}, 3000);
}
Usage Instructions
•
Context Menu: Right-click on elements to trigger the context menu and explore
additional options.
•
Mobile Menu: Click on the menu icon to toggle between the mobile menu and the regular
side
menu.
Conclusion
Experience the fluidity of Context Menu Magic in action! This script, crafted by the
ingenious Subham Mandal, brings a touch of sophistication to your web applications.
Embrace the power of context-sensitive interactions and ensure a delightful user
experience.
Feel free to connect with Subham Mandal for any questions or customization needs related
to this script. Elevate your website's user interface with the magic of context menus!
Dynamic Toolset: Unleashing the
Power of Your Script
Introduction
7. Dive into the dynamic world of Dynamic Toolset, a script designed to empower users
with a versatile set of tools for language translation, mathematical calculations, and
more. Developed by the innovative mind of Subham Mandal, this script elevates your
web experience with seamless functionality.
Overview
Linguistic Exploration
The script's primary feature involves linguistic exploration. With a simple right-click, users can
trigger the `analy` function, initiating a series of powerful tools to analyze and understand
text.
javascript
function analy(){
getWordData();
sidep();
doGet();
goScience();
calx();
viewslide();
// Hide unnecessary elements
document.getElementById("bx").style.display = "none";
document.getElementById("dx").style.display = "none";
document.getElementById("cx").style.display = "none";
document.getElementById("wx").style.display = "none";
document.getElementById("sep").style.display = "none";
document.getElementById("imageContainer").style.display = "none";
document.getElementById("wait").style.display = "block";
}
Word Data Fetching
The `getWordData` function utilizes the Dictionary API to fetch detailed information about the
selected word, providing its definition and linguistic insights.
javascript
function getWordData() {
// ... (existing code)
}
Language Translation
8. The script seamlessly integrates Google Translate API to translate the selected word or
phrase into Bengali, enriching the user's linguistic experience.
javascript
function doGet() {
// ... (existing code)
}
Mathematical Marvel
For users inclined towards mathematical exploration, the `calx` function unleashes the
power of the Math.js API, performing mathematical calculations with ease.
javascript
function calx() {
// ... (existing code)
}
Usage Instructions
1. Word Exploration: Right-click on a word and choose the "Analyze" option to reveal
detailed information, translation, and more.
2. Language Translation: Witness linguistic magic by exploring translations through
the dynamically fetched Bengali equivalent.
3. Mathematical Marvel: For mathematical enthusiasts, simply include a
mathematical expression in your selection and observe the calculated result.
Conclusion
Dynamic Toolset, sculpted by the brilliance of Subham Mandal, transforms your web
browsing into a multifaceted experience. Seamlessly switch between linguistic exploration
and mathematical marvels with a simple right-click. Explore, analyze, and discover the
potential within your web content.
Feel free to connect with Subham Mandal for any questions, suggestions, or
customizations related to this script. Elevate your web experience with the dynamic
tools at your fingertips!
9. Scientific Insights: A Window to
Knowledge
Introduction
Embark on a journey of scientific exploration with the Scientific Insights script, a creation
of the visionary developer Subham Mandal. This script seamlessly integrates with
Wikipedia, offering users a gateway to in-depth information on scientific topics, right at
their fingertips.
Overview
Navigating the Cosmos
The heart of the script lies in the `goScience` function, enabling users to delve into the
scientific realms. When triggered, this function sends an AJAX request to the Wikipedia
API, extracting insightful information about the selected scientific term.
javascript
function goScience() {
// ... (existing code)
}
Usage Instructions
1. Scientific Exploration: With the term of interest selected, simply click the "Analyze" option.
The
`goScience` function will retrieve and display relevant scientific insights.
Conclusion
Scientific Insights, curated by the inventive Subham Mandal, transforms your web browsing
experience into a scientific adventure. Uncover the mysteries of the cosmos, explore scientific
concepts, and enhance your understanding with a simple click.
10. Feel free to connect with Subham Mandal for any inquiries, suggestions, or enhancements
related to this script. Elevate your web experience with a window to scientific knowledge!
2 / 2
Certainly! Here's the complete documentation for your script:
html
<!-- Include jQuery library in your HTML -->
<script src="https://code.jquery.com/jquery-3.6.4.min.js"></script>
<script>
// Function to fetch and display scientific insights from Wikipedia
function goScience() {
let searchTerm = $('#selectedword').val();
$.ajax({
url: 'https://en.wikipedia.org/w/api.php', data: {
action: 'query',
format: 'json',
prop: 'extracts',
exintro: '', titles:
searchTerm
},
dataType: 'jsonp', beforeSend:
function () {
// Hide 'wx' and show 'wait' before making the AJAX request
$('#wx').hide();
$('#wait').show();
},
success: function (data) {
$('#wait').hide();
var pages = data.query.pages;
var pageId = Object.keys(pages)[0];
var extractHtml = pages[pageId].extract;
// Extract plain text from HTML response
var extract = $('<div>').html(extractHtml).text();
// Display results
$('#science').html(extract);
11. $('#wx').show();
},
error: function (error) { console.log(error);
$('#wx').hide();
$('#wait').hide();
}
});
}
</script>
Scientific Insights: A Window to
Knowledge
Introduction
Embark on a journey of scientific exploration with the Scientific Insights script, a creation
of the visionary developer Subham Mandal. This script seamlessly integrates with
Wikipedia, offering users a gateway to in-depth information on scientific topics, right at
their fingertips.
Overview
Navigating the Cosmos
The heart of the script lies in the `goScience` function, enabling users to delve into the
scientific realms. When triggered, this function sends an AJAX request to the Wikipedia
API, extracting insightful information about the selected scientific term.
javascript
function goScience() {
let searchTerm = $('#selectedword').val();
$.ajax({
url: 'https://en.wikipedia.org/w/api.php', data: {
action: 'query',
format: 'json',
prop: 'extracts',
exintro: '', titles:
searchTerm
},
dataType: 'jsonp', beforeSend:
function () {
12. // Hide 'wx' and show 'wait' before making the AJAX request
$('#wx').hide();
$('#wait').show();
},
success: function (data) {
$('#wait').hide();
var pages = data.query.pages;
var pageId = Object.keys(pages)[0];
var extractHtml = pages[pageId].extract;
// Extract plain text from HTML response
var extract = $('<div>').html(extractHtml).text();
// Display results
$('#science').html(extract);
$('#wx').show();
},
error: function (error) { console.log(error);
$('#wx').hide();
$('#wait').hide();
}
});
}
Usage Instructions
1. Scientific Exploration: With the term of interest selected, simply click the "Analyze" option.
The
`goScience` function will retrieve and display relevant scientific insights.
Conclusion
Scientific Insights, curated by the inventive Subham Mandal, transforms your web browsing
experience into a scientific adventure. Uncover the mysteries of the cosmos, explore scientific
concepts, and enhance your understanding with a simple click.
Feel free to connect with Subham Mandal for any inquiries, suggestions, or enhancements
related to this script. Elevate your web experience with a window to scientific knowledge!
13. Dynamic Image Viewer: Explore the
Visual Realm
Introduction
Experience the visual realm with the Dynamic Image Viewer script, an ingenious creation by
developer Subham Mandal. This script integrates with Google Search, fetching and displaying
images related to the selected term, making your exploration more vivid.
Overview
Exploring Visuals
The `viewslide` function takes your selected term, transforms it into a search-friendly
format, and fetches related images from Google Search using the CodeTabs API.
javascript
function viewslide(){
// ... (existing code)
fetch(mainlink)
.then(function(response) {
if (response.status !== 200) { return;
}
response.text().then(function(data) {
document.getElementById("inputTextArea").value = data;
document.getElementById("wait").style.display = "none";
checkImagePresence();
extractURLs();
displayImages();
});
})
.catch(function(err) { console.log('Fetch
Error :-S', err);
});
}
Usage Instructions
14. 1. Image Exploration: After selecting a term, trigger the `viewslide` function. The script
fetches images related to the term, providing a visual representation.
Additional Integration
In addition to the powerful image exploration, this script seamlessly integrates with the terms
Lekhoniya and onessssweb, enhancing your web experience further.
Conclusion
Dynamic Image Viewer, crafted by the visionary Subham Mandal, adds a visual dimension
to your web exploration. Whether you are researching, learning, or simply curious, the
script turns your selected terms into a captivating visual journey.
Feel free to connect with Subham Mandal for any inquiries, suggestions, or enhancements
related to this script. Elevate your web experience by exploring the visual realm
effortlessly!
Visual Brilliance: Unveiling Images with
Lekhoniya
Introduction
Welcome to Lekhoniya, a web application designed to bring visual brilliance to your online
experience. Developed by the skilled developer Subham Mandal, this application seamlessly
integrates the brand name onessssweb, making your exploration visually captivating.
Overview
Image Extraction and Uniqueness
The script facilitates the extraction and uniqueness of image URLs from the fetched HTML
content, providing a streamlined visual representation of the term.
javascript
15. function extractURLs() {
// ... (existing code)
function eliminateDuplicates(urls) {
// ... (existing code)
}
}
function checkImagePresence() {
// ... (existing code)
}
Usage Instructions
1. Image Extraction: After triggering the `viewslide` function, use the `extractURLs`
function to gather unique image URLs related to your selected term.
2. Visual Presence: The `checkImagePresence` function visually represents the
extracted images, making your exploration with Lekhoniya more engaging.
Conclusion
Lekhoniya, developed by the innovative Subham Mandal, transforms your web exploration
into a visual feast. Seamlessly integrated with the brand name onessssweb, this
application adds a touch of uniqueness to your online journey.
Feel free to connect with Subham Mandal for any inquiries, suggestions, or enhancements
related to this script. Elevate your web experience with the visual brilliance of Lekhoniya!
Visual Showcase: Unleashing Images
with Elegance
Introduction
Enhance your visual journey with the Visual Showcase script, a creation by the talented
developer Subham Mandal for the web application Lekhoniya. Seamlessly integrated with
the
16. brand name onessssweb, this script transforms image URLs into an elegant visual showcase.
Overview
Dynamic Image Display
The `displayImages` function takes the extracted image URLs and dynamically generates img
tags for each, creating a visually appealing display.
javascript
function displayImages() {
// ... (existing code)
var imageUrls = document.getElementById("outputTextArea").value.split("n"); var
imageContainer = document.getElementById("imageContainer");
// Clear existing images imageContainer.innerHTML
= "";
// Generate img tags for each URL
for (var i = 0; i < imageUrls.length; i++) { var
imageUrl = imageUrls[i].trim();
if (imageUrl !== "") {
var img = document.createElement("img"); img.src =
imageUrl; imageContainer.appendChild(img);
}
}
}
Usage Instructions
1. Visual Delight: After extracting image URLs using the `extractURLs` function, trigger
`displayImages` to showcase them elegantly in the designated `imageContainer`.
Conclusion
Visual Showcase, a creation by the imaginative Subham Mandal, adds an elegant touch to
your image exploration within Lekhoniya. Integrated with the brand name onessssweb, this
script transforms image URLs into a visually captivating experience.
17. Feel free to connect with Subham Mandal for any inquiries, suggestions, or enhancements
related to this script. Elevate your web experience with the elegant visual showcase of
Lekhoniya!
Local Storage Magic: Save, Load, and
Update with Ease
Introduction
Discover the magic of local storage with the Local Storage Magic script, a creation by the
brilliant developer Subham Mandal. This script, integrated into the web application
Lekhoniya, seamlessly interacts with the brand name onessssweb, enabling users to save,
load, and update content effortlessly.
Overview
Save to Local Storage
The `saveToLocalStorage` function captures the content of an editable span and stores it
in the local storage under a specified address.
javascript
function saveToLocalStorage() {
let localaddress = document.getElementById('localaddress').value; var
spanContent = document.getElementById('editableSpan').innerHTML;
localStorage.setItem(localaddress, spanContent);
}
Load from Local Storage
The `loadFromLocalStorage` function retrieves content from the local storage, allowing
users to load their saved content back into the editable span.
javascript
function loadFromLocalStorage() {
setTimeout(authority, 500);
18. var spanContent = localStorage.getItem('lekhoniya'); if
(spanContent) {
document.getElementById('editableSpan').innerHTML = spanContent;
}
}
Update Local Storage
The `updateLocalStorage` function acts as a bridge, calling the `saveToLocalStorage`
function to ensure the latest content is stored.
javascript
function updateLocalStorage() { saveToLocalStorage();
}
Usage Instructions
1. Save Content: Enter a local address in the designated field and trigger `saveToLocalStorage`
to save the content of the editable span.
2. Load Content: Use `loadFromLocalStorage` to retrieve previously saved content based
on the specified local address.
3. Update Content: After making changes, trigger `updateLocalStorage` to ensure the
latest content is saved.
Conclusion
Local Storage Magic, a creation by the innovative Subham Mandal, enhances the usability
of Lekhoniya. Seamlessly integrated with the brand name onessssweb, this script
empowers users to save and load content effortlessly.
Feel free to connect with Subham Mandal for any inquiries, suggestions, or
enhancements related to this script. Elevate your content management experience
with the local storage magic of Lekhoniya!
19. Offline Mode Enabler: Download and
Take It Anywhere
Introduction
Enable offline capabilities with the Offline Mode Enabler script, a creation by the ingenious
developer Subham Mandal. Seamlessly integrated into the web application Lekhoniya, this
script, associated with the brand name onessssweb, empowers users to download and
carry their content anywhere.
Overview
Download HTML Content
The `offline` function encapsulates the ability to download the HTML content of the editable
span. Users can specify a name for the file, and the content will be saved as an HTML file.
javascript
function offline() {
// ... (existing code)
let content = document.getElementById("editableSpan").outerHTML; let
name = document.getElementById("name").value;
let blob = new Blob([content], { type: "text/html" }); let
url = URL.createObjectURL(blob);
var link = document.createElement("a"); link.href
= url;
link.download = name + ".html";
document.body.appendChild(link);
link.click();
document.body.removeChild(link);
URL.revokeObjectURL(url);
}
Usage Instructions
20. 1. Download Content: Fill in the desired file name in the designated field and trigger the
`offline` function. The content of the editable span will be saved as an HTML file.
Conclusion
Offline Mode Enabler, a creation by the innovative Subham Mandal, adds a layer of
flexibility to Lekhoniya. Seamlessly integrated with the brand name onessssweb, this
script allows users to take their content offline, providing convenience and accessibility.
Feel free to connect with Subham Mandal for any inquiries, suggestions, or enhancements
related to this script. Download and take your content anywhere with the offline mode
magic of Lekhoniya!
Real-time Connectivity: Harnessing
Firebase Magic
Introduction
Welcome to the world of real-time connectivity with the Firebase Magic script, an
integration by the skilled developer Subham Mandal. Seamlessly woven into the web
application, this script, associated with the brand name onessssweb, leverages the power of
Firebase for a dynamic and collaborative experience.
Overview
Firebase Configuration
The script initiates the Firebase configuration using the provided credentials. This
configuration is vital for establishing a connection with the Firebase Realtime Database and
other Firebase services.
Usage Instructions
1. Firebase Setup: Before using Firebase in your application, replace the placeholder
values in the `firebaseConfig` object with your actual Firebase project credentials.
21. Conclusion
Firebase Magic, crafted by the ingenious Subham Mandal, elevates your web application
to new heights of connectivity. Seamlessly integrated with the brand name onessssweb,
this script allows you to harness the real-time capabilities of Firebase for a dynamic and
collaborative user experience.
Feel free to connect with Subham Mandal for any inquiries, suggestions, or enhancements
related to this script. Dive into the realm of real-time connectivity with the Firebase magic
of onessssweb!
Online Collaboration: Empowering Your
Content
Introduction
Empower your content with the ability to collaborate online using the Online Collaboration
script, a creation by the talented developer Subham Mandal. Integrated into the web
application
22. Lekhoniya, and associated with the brand name onessssweb, this script harnesses the power
of Firebase to enable real-time online collaboration and backups.
Overview
Uploading Content
The `online` function facilitates the upload of content to the Firebase Realtime Database. It
includes user information and the ability to edit status, making it a robust solution for
collaborative content creation.
javascript
function online() {
// ... (existing code)
let newText = document.getElementById("newText").value; let
datanode = document.getElementById("datanode").value;
const data = {};
data[datanode] = newText + "<input id='usermain' style='display:none' value=
document.getElementById("backupdatax").value = newText + "<input id='usermai
// ... (existing code)
}
Uploading Editable Content
The `onlineedit` function extends the functionality to allow users to upload content with the
ability to edit. This feature is particularly useful for collaborative editing scenarios.
javascript
function onlineedit() {
// ... (existing code)
let newText = document.getElementById("newText").value; let
datanode = document.getElementById("datanode").value;
const data = {};
data[datanode] = newText + "<input id='usermain' style='display:none' value=
document.getElementById("backupdatax").value = newText + "<input id='usermai
23. // ... (existing code)
}
Copy to Clipboard
The `copyToClipboard` function allows users to easily copy the shareable URL to facilitate
collaboration.
javascript
function copyToClipboard() {
// ... (existing code)
}
Usage Instructions
1. Upload Content: Use the `online` function to upload content for collaborative viewing
with no editing rights.
2. Upload Editable Content: Utilize the `onlineedit` function to upload content with the
ability to edit, facilitating collaborative editing.
3. Copy Shareable URL: Click the "Copy to Clipboard" button to copy the shareable URL for
easy collaboration.
Conclusion
Online Collaboration, designed by the visionary Subham Mandal, transforms Lekhoniya
into a collaborative powerhouse. Seamlessly integrated with the brand name onessssweb,
this script leverages Firebase for real-time collaboration and content backups.
Feel free to connect with Subham Mandal for any inquiries, suggestions, or enhancements
related to this script. Collaborate online effortlessly with the power of Lekhoniya!
Automated Backup: Safeguarding Your
Content
24. Introduction
Safeguard your content with the Automated Backup script, a creation by the resourceful
developer Subham Mandal. Integrated into the web application Lekhoniya, and associated
with the brand name onessssweb, this script automates the backup process, ensuring the
safety and accessibility of your valuable content.
Overview
Backup Upload
The `backupload` function orchestrates the backup process by collecting essential information
such as the timestamp, backup URL, and backup data.
javascript
function backupload() {
// ... (existing code)
let timestamp = new Date().toLocaleTimeString() + ' | ' + new Date().getDate let
backupurl = document.getElementById("shareurl").value;
let backupdata = document.getElementById("backupdatax").value;
document.getElementById('timestamp').value = timestamp;
document.getElementById('backupurl').value = backupurl;
document.getElementById('backupdata').value = backupdata;
backupsheet();
}
Google Sheet Backup
The `backupsheet` function sends the collected backup information to a Google Sheet for
secure storage and easy retrieval.
javascript
function backupsheet() {
const scriptURL = 'https://script.google.com/macros/s/AKfycbyJfX6ypCWnHy5iX6 const
form = document.forms['google-sheet'];
fetch(scriptURL, { method: 'POST', body: new FormData(form) })
.then(response => {
25. if (response.ok) { document.getElementById("online").innerHTML =
"Server";
document.getElementById("onlineedit").innerHTML = "Server (Edita
} else {
alert('Backup failed. Please try again.');
}
})
.catch(error => {
alert('An error occurred during backup. Please try again later.');
console.error('Error:', error);
});
}
Usage Instructions
1. Backup Content: Utilize the `backupload` function to initiate the automated backup process.
2. Google Sheet Storage: The `backupsheet` function sends the backup information to a
Google Sheet for secure storage.
Conclusion
Automated Backup, a creation by the insightful Subham Mandal, adds an extra layer of
protection to your Lekhoniya content. Seamlessly integrated with the brand name
onessssweb, this script automates the backup process, ensuring the safety and accessibility
of your valuable content.
Feel free to connect with Subham Mandal for any inquiries, suggestions, or enhancements
related to this script. Safeguard your content effortlessly with the automated backup
feature of Lekhoniya!
Dynamic URL Analysis: Personalized
Content Experience
Introduction
26. Experience personalized content with the Dynamic URL Analysis script, an ingenious creation
by the developer Subham Mandal. Integrated into the web application Lekhoniya, and
associated with the brand name onessssweb, this script dynamically analyzes the URL to
enhance user interactions and content display.
Overview
URL Digit Check
The `checkURLDigits` function dynamically analyzes the digits in the URL to determine the
content display. If the URL contains more than seven digits, it assumes it's a specific content
URL and fetches the corresponding content from Firebase. Otherwise, it loads content from
the local storage.
javascript
function checkURLDigits() {
// ... (existing code)
if (digitsCount > 7) {
// Code to fetch content from Firebase based on URL
// ... (existing code)
} else {
// Code to load content from local storage
// ... (existing code)
}
}
Firebase Content Fetch
The script fetches content from Firebase based on the extracted text from the URL.
javascript
fetch("https://onerealtimeserver-default-rtdb.firebaseio.com/lekhoniya/" + extra
.then(response => response.json())
.then(data => {
// ... (existing code)
})
.catch(error => {
// Handle errors during the fetch request
console.log("Error:", error);
});
27. Local Content Load
If the URL doesn't contain more than seven digits, the script loads content from local storage.
javascript
document.getElementById('ini').className = 'ini-out'; setTimeout(loadFromLocalStorage,
100); document.getElementById('localaddress').value = 'lekhoniya';
// ... (existing code)
Usage Instructions
1. Dynamic Content Display: The script dynamically analyzes the URL and displays
the corresponding content from Firebase or local storage.
Conclusion
Dynamic URL Analysis, designed by the innovative Subham Mandal, tailors the content
experience in Lekhoniya based on the URL. Seamlessly integrated with the brand name
onessssweb, this script enhances user interactions by dynamically adapting to the URL
context.
Feel free to connect with Subham Mandal for any inquiries, suggestions, or enhancements
related to this script. Enjoy a personalized content experience with the dynamic URL
analysis feature of Lekhoniya!
User Authentication and Authorization:
Empowering Content Management
Introduction
Empower content management with the User Authentication and Authorization script, a
sophisticated creation by the developer Subham Mandal. Seamlessly integrated into the web
application Lekhoniya, and aligned with the brand name onessssweb, this script ensures
secure and personalized content management through user authentication and authorization.
28. Overview
User Authentication
The `checkLocalStorage` function checks if a user is present in the local storage. If not, it
creates a new user using the `newUser` function.
javascript
function checkLocalStorage() {
ini();
let userName = localStorage.getItem('lekhoniya-user');
console.log('User: ' + userName);
if (userName == null) {
newUser();
} else {
document.getElementById('usercheck').value = userName;
}
authority();
}
New User Creation
The `newUser` function creates a new user by generating a unique identifier based on the
current timestamp and additional device information.
javascript
function newUser() {
const firstParenthesesMatch = navigator.userAgent.match(/((.*?))/); const did
= firstParenthesesMatch[1].replace(/ /g, "").replace(/;/g, "-");
let userName = Date.now() + '-' + did;
localStorage.setItem('lekhoniya-user', userName);
document.getElementById('usercheck').value = userName;
checkLocalStorage();
firebase.database().ref("lekhoniya_user").push(userName);
document.getElementById('who').value = 'Author: ' + userName;
}
User Authorization
The `authority` function compares the main user and check user. If they match, it allows
updates; otherwise, it designates the authority as 'Server'.
29. javascript
function authority() {
let usermain = document.getElementById('usermain').value; let
usercheck = document.getElementById('usercheck').value;
if (usermain == usercheck) {
document.getElementById('online').innerHTML = 'Update';
} else {
document.getElementById('online').innerHTML = 'Server';
}
}
Usage Instructions
1. User Authentication: The script checks and creates a new user if needed, ensuring
personalized content management.
2. User Authorization: The script authorizes users based on their credentials, allowing
updates or designating authority to the server.
Conclusion
User Authentication and Authorization, crafted by the skilled Subham Mandal, fortifies content
management within Lekhoniya. Seamlessly integrated with the brand name onessssweb, this
script ensures secure and personalized content experiences by authenticating users and
authorizing updates.
For inquiries, suggestions, or enhancements related to this script, feel free to connect with
Subham Mandal. Elevate your content management with the robust user authentication and
authorization features of Lekhoniya!
Enhancing Lekhoniya Experience:
Dynamic Content Creation
Introduction
30. Elevate your Lekhoniya experience with the Dynamic Content Creation script, a dynamic
solution crafted by the developer Subham Mandal. Seamlessly integrated into the
Lekhoniya web application, this script enhances user interaction by providing a dynamic
and user-friendly content creation experience.
Overview
Dynamic Content Creation
The `create` function opens a new window, directing users to the Lekhoniya blogspot for
dynamic content creation.
javascript
document.getElementById("create").addEventListener("click", function() {
window.open("https://lekhoniya.blogspot.com/", "_blank"); window.close();
});
Initialization
The `ini` function initializes the user interface, providing a smooth and interactive user
experience.
javascript
function ini() { document.getElementById('ini').style.display =
'block'; setTimeout(function() {
document.getElementById('ini').style.display = 'none';
}, 2000);
}
Usage Instructions
1. Dynamic Content Creation: Clicking on the designated element, such as a button with the ID
`create`, opens a new window, redirecting users to the Lekhoniya blogspot for dynamic
content creation.
2. Initialization: The `ini` function ensures a smooth and interactive user interface,
enhancing the overall user experience.
31. Conclusion
Dynamic Content Creation, a creation by Subham Mandal, enriches the content creation
experience within Lekhoniya. Seamlessly integrated into the platform, this script provides
users with dynamic and user-friendly tools for creating engaging content.
For any inquiries, suggestions, or enhancements related to this script, feel free to connect
with Subham Mandal. Elevate your content creation journey with the dynamic features of
Lekhoniya!
Exploring Lekhoniya Archives:
Navigating Through Time
Introduction
Embark on a journey through time with the Lekhoniya Archives Explorer script, thoughtfully
designed by the developer Subham Mandal. Integrated seamlessly into the Lekhoniya web
application, this script provides users with an intuitive interface to explore archived content,
enhancing the overall navigation experience.
Overview
Archives Exploration
The script dynamically fetches archived content from the Firebase database, presenting it
in an organized and user-friendly manner. Users can navigate through the archives by
clicking on the listed items, providing an easy way to access historical content.
javascript
setTimeout(function () {
let databaseRef = firebase.database().ref("lekhoniya");
databaseRef.once("value").then(function (snapshot) {
var keyNames = Object.keys(snapshot.val());
keyNames.forEach(function (key, index) {
var div = document.createElement("div");
div.textContent = (index + 1) + '. ' + key.replace(/-d{10,}$/g, ''
div.style.cursor = "pointer";
32. div.style.height = '5%';
div.style.border = '1px solid #ccc';
div.style.boxShadow = '2px 2px 3px #888888';
div.style.padding = '2%';
div.style.backgroundColor = '#ebebeb';
div.addEventListener("click", function () {
window.location.href = "https://lekhoniya.blogspot.com/" + key +
});
// Add a class to the div div.className
= 'custom-div';
document.getElementById('res').appendChild(div);
});
}).catch(function (error) { console.error(error);
});
}, 100);
Usage Instructions
1. Archives Exploration: The script dynamically fetches and displays archived content from the
Firebase database. Users can click on the listed items to navigate to the corresponding
historical content.
Conclusion
The Lekhoniya Archives Explorer, a creation by Subham Mandal, enriches the user
experience by providing an organized and intuitive way to explore archived content.
Seamlessly integrated into the Lekhoniya web application, this script offers a glimpse into
the past, making navigation through time an engaging experience.
For inquiries, suggestions, or enhancements related to this script, feel free to connect with
Subham Mandal. Explore the rich history of Lekhoniya with the Archives Explorer!
Streamlined Lekhoniya Experience:
Code Refinement
33. Introduction
Experience a more streamlined and efficient Lekhoniya with the Code Refinement script.
Developed by Subham Mandal, this script enhances the overall user interface by removing
unnecessary elements and optimizing the display for a more focused and engaging reading
experience.
Overview
Code Refinement
The script, executed with a 10-millisecond interval, optimizes the Lekhoniya blogspot
display. It hides specific elements, such as the editable span and blog pager links, to
ensure a cleaner and distraction-free interface.
javascript
const intervalId = setInterval(removeCode, 10);
function removeCode() {
let currentURL = window.location.href;
let desiredString1 = 'https://lekhoniya.blogspot.com/2023/'; let
desiredString2 = 'https://lekhoniya.blogspot.com/p/';
if (currentURL.includes(desiredString1) || currentURL.includes(desiredString
document.getElementById("editableSpan").style.display = 'none';
let blog1Element = document.getElementById("Blog1");
blog1Element.setAttribute('onclick', 'mainp()');
let titleElements = document.querySelectorAll('.post-title.entry-title') let
bodyElements = document.querySelectorAll('.post-body.entry-content')
let blogPagerElements = document.querySelectorAll('.blog-pager');
blogPagerElements.forEach(function (element) {
element.remove();
});
let feedLinkElements = document.querySelectorAll('.post-feeds');
feedLinkElements.forEach(function (element) {
element.remove();
});
if (titleElements.length === 0 || bodyElements.length === 0) {
console.log("Elements not found.");
removeCode();
return;
34. }
titleElements.forEach(function (titleElement) {
// Additional refinement logic for post titles if needed
});
bodyElements.forEach(function (bodyElement) {
// Additional refinement logic for post bodies if needed
});
clearInterval(intervalId);
} else {
let mainElement = document.getElementById("main"); if
(mainElement) {
mainElement.remove();
clearInterval(intervalId);
}
}
}
Usage Instructions
1. Automatic Refinement: The script automatically refines the Lekhoniya blogspot display,
hiding unnecessary elements for a cleaner reading experience.
Conclusion
Code Refinement, a creation by Subham Mandal, brings efficiency and focus to the Lekhoniya
reading experience. Seamlessly integrated into the platform, this script ensures that readers
can enjoy content distraction-free. For any inquiries, suggestions, or enhancements related to
this script, feel free to connect with Subham Mandal. Elevate your reading experience with
Code Refinement!
Interactive Code Execution in
Lekhoniya
Introduction
35. Experience an enhanced level of interactivity on Lekhoniya with the introduction of
Interactive Code Execution. This script, developed by Subham Mandal, enables users to
execute custom JavaScript code snippets directly within the content. Let's dive into the
details!
Overview
Interactive Code Execution
This script adds a dynamic layer to Lekhoniya by allowing users to execute custom
JavaScript code snippets. Triggered by a specific combination of '@l' and 'l/' within the
editable span, the entered code is processed and executed instantly.
javascript
document.addEventListener('keydown', function(event) { if
(event.key === 'Enter' || event.keyCode === 13) {
const editableSpan = document.getElementById('editableSpan'); const
spanContent = editableSpan.innerHTML;
const lcStart = spanContent.indexOf('@l'); const
lcEnd = spanContent.indexOf('l/');
if (lcStart !== -1 && lcEnd !== -1 && lcStart < lcEnd) {
const codeToExecute = spanContent.substring(lcStart + 2, lcEnd); const
replacedCode = codeToExecute.replace(/`id`/g, 'document.getEle
.replace(/`b`/g, 'document.body')
.replace(/`bgc`/g, '.style.backgroundColor')
.replace(/`x`/g, 'document.getElementById("editableSpan")')
.replace(/`hide`/g, '.style.display="none"')
.replace(/`code`/g, 'document.write(');
}
}
});
const finalCode =
replacedCode.replace(
/`/g, '');
eval(finalCode);
Usage Instructions
1. Trigger Code Execution: Enter custom JavaScript code snippets within the editable
span between '@l' and 'l/'.
2. Execute Code: Press 'Enter', and the script will process and execute the entered code
instantly.
Code Snippet Examples
36. Example 1: Change Background Color
html
@ldocument.getElementById('b').style.backgroundColor = 'blue'l/
Example 2: Hide Editable Span
html
@l`x`.hide`l/
Example 3: Execute Custom Code
html
@l`code`'<h1>Hello, Lekhoniya!</h1>'`l/
Conclusion
Elevate your interaction with Lekhoniya using Interactive Code Execution. Developed by
Subham Mandal, this script empowers users to integrate dynamic JavaScript functionalities
seamlessly.
Feel free to experiment and enhance your content with live code execution! For any queries or
feedback, connect with Subham Mandal. Happy coding!
Enhanced Web Interaction on
Lekhoniya
Introduction
Subham Mandal has enriched the web interaction capabilities of Lekhoniya with the
addition of versatile web-related functions. Users can now seamlessly integrate external
content, run code snippets, and display web pages or blog posts directly within the
platform. Let's explore the new functionalities!
Overview of Web Interaction Functions
37. `webrun(x)`
The `webrun` function fetches content from a given URL (`x`) and appends the result to the
editable span. It provides a dynamic way to run and display external content.
`source(x)`
The `source` function fetches the source code of a web page specified by the URL (`x`) and
appends it to the editable span. This is useful for inspecting the underlying code of a
webpage.
`google(x)`
The `google` function initiates a Google search for the provided query (`x`) and appends the
search results to the editable span.
`find(x)`
The `find` function performs a Yahoo search for the provided query (`x`) and appends
the search results to the editable span.
`xframe(x)`
The `xframe` function fetches content from a given URL (`x`) and displays it within an iframe,
providing a compact view of external content.
`site(x)`
The `site` function fetches the content of the specified website (`x`) and displays it within
an iframe, enabling users to embed external websites seamlessly.
`blog(x)`
The `blog` function fetches the content of a specified blog (`x`) and displays it within an
iframe, facilitating the integration of blog content.
`frame(x)`
The `frame` function displays an external webpage specified by the URL (`x`) within an
iframe, offering a compact and embedded view.
Usage Instructions
1. Execute Web Functions: Call any of the web-related functions listed above,
providing the required parameters where applicable.
38. 2. View Results: The output of the executed function will be appended to the editable
span, allowing users to interact with the fetched content.
Examples
1. Run Code Snippet
javascript
webrun('https://example.com/code.js');
2.Fetch Source Code
javascript
source('https://example.com');
3.Perform Google Search
javascript
google('OpenAI GPT-3');
4.Display External Webpage
javascript
frame('https://example.com');
5.Display Blog Content
javascript
blog('example-blog');
6.Embed External Website
javascript
site('example-website');
7. Fetch and Display Web Content
39. javascript
xframe('https://example.com');
Conclusion
Experience an enhanced level of web interaction on Lekhoniya with these powerful
web-related functions. Developed by Subham Mandal, these functions provide users with
the ability to seamlessly integrate external content, run code snippets, and embed web
pages or blog posts. For any queries or feedback, connect with Subham Mandal. Happy
exploring!
Certainly! Let's create a detailed guide for the provided JavaScript code, explaining its
purpose and functionality.
Clearspace Utility on Lekhoniya - In-depth Guide
Introduction
Subham Mandal has introduced a handy utility named Clearspace on Lekhoniya, enabling
users to quickly clear the content within the editable span using a key combination. This
guide will walk you through the functionality and usage of the Clearspace utility.
Overview of Clearspace Utility
The Clearspace utility is designed to provide users with a convenient way to clear the
content within the editable span on Lekhoniya. By pressing the "Escape" key a certain
number of times in quick succession, users can trigger the clearing action. This serves as
a safety measure to prevent accidental content deletion.
Code Explanation
javascript
var clearspace = 0; document.addEventListener("keydown",
function(event) {
if (event.code === "Escape") { clearspace += 1; }
});
40. document.addEventListener("keyup", function(event) { if
(event.code === "Escape") {
if (clearspace > 50) {
const editableSpan = document.getElementById("editableSpan");
editableSpan.textContent = "";
alert("Lekhoniya: Cleared!");
}
});
}
clearspace = 0;
Usage Instructions
1. Trigger Clearspace:
•
Press and hold the "Escape" key multiple times in quick succession.
2. Clear Content:
•
If the "Escape" key is pressed more than 50 times quickly, the content within the
editable span will be cleared.
•
A confirmation alert, "Lekhoniya: Cleared!" will be displayed.
Additional Tips
•
Use the Clearspace utility with caution to avoid unintentional content deletion.
•
Customize the threshold (currently set to 50) based on your preference by adjusting the
`clearspace` variable.
Conclusion
The Clearspace utility adds a practical feature to Lekhoniya, offering users a quick and
controlled method to clear the editable span content. For any inquiries, feedback, or
assistance, feel free to connect with Subham Mandal. Happy writing and exploring on
Lekhoniya!
Certainly! Let's create an in-depth guide for the provided JavaScript code, explaining its
purpose and functionality.
Lekhoniya Global Script - In-depth Guide
Introduction
41. The Lekhoniya Global Script enhances the collaborative and real-time aspects of Lekhoniya by
providing a global platform for users to share content. This guide will walk you through the
features and functionalities of the script.
Overview of Global Script
The Global Script is designed to facilitate real-time collaboration and sharing of content
among users on Lekhoniya. Users accessing a specific URL
(`https://lekhoniya.blogspot.com/g/`) will be connected to a shared space where updates
made by one user are reflected in real-time for others.
Code Explanation
javascript
var currentUrl_gtime = window.location.href.substring(0, 33); var
urlToMatch = 'https://lekhoniya.blogspot.com/g/';
if (currentUrl_gtime === urlToMatch) {
console.log('Connecting...');
// Listen for changes in the 'Lekhoniya-Global' Firebase database
firebase.database().ref('Lekhoniya-Global').on("value", function(snapshot) {
var firebaseValue = snapshot.val().user;
// Check and activate the script based on Firebase value
checkAndActivateScript(firebaseValue);
});
function checkAndActivateScript(firebaseValue) {
let localStorageValue = localStorage.getItem('lekhoniya-user');
if (firebaseValue === localStorageValue) {
// User is already connected
} else {
// Update content based on the 'valx' value from Firebase
firebase.database().ref('Lekhoniya-Global').on("value", function(snapshot)
document.getElementById('editableSpan').innerHTML = snapshot.val().valx;
});
}
}
// Alert and console message to indicate successful connection alert('Welcome to
Global!');
console.log('Lekhoniya Global!');
// Set 'oninput' event for the 'editableSpan'
42. let editableSpan = document.getElementById('editableSpan');
editableSpan.setAttribute('oninput', 'updateGlobal()');
// Fetch initial content from Firebase
fetch('https://onerealtimeserver-default-rtdb.firebaseio.com/Lekhoniya-Global/
.then(response => response.json())
.then(data => { document.getElementById('editableSpan').innerHTML
= data;
});
}
// Function to update global content on user input
function updateGlobal() {
let timeg = new Date().toLocaleTimeString();
let user = localStorage.getItem('lekhoniya-user');
const valx = document.getElementById('editableSpan').innerHTML;
// Update 'Lekhoniya-Global' Firebase database
firebase.database().ref('Lekhoniya-Global').set({ valx, user , timeg });
}
Usage Instructions
1. Access Global Space:
•
Open the URL `https://lekhoniya.blogspot.com/g/` in your web browser.
2. Real-time Collaboration:
•
Users accessing the global space can collaboratively edit and share content in real-time.
3. Automatic Updates:
•
Content is automatically updated based on user inputs, providing a seamless
collaborative writing experience.
4. User Connection:
•
User connection is managed through Firebase, ensuring that each user's contributions
are reflected in the shared space.
5. Alerts and Console Messages:
•
Users receive an alert message ("Welcome to Global!") upon successful connection.
•
Connection details are logged to the console for reference.
Conclusion
The Lekhoniya Global Script brings a new dimension to collaborative writing, offering users a
shared space for real-time content creation and updates. For questions, feedback, or
assistance, feel free to reach out to the Lekhoniya support team. Happy global writing on
Lekhoniya!
43. Certainly! Let's create an in-depth guide for the provided JavaScript code, explaining its
purpose and functionality.
Realtime Drawing Script - In-depth Guide
Introduction
The Realtime Drawing Script enhances the drawing experience on Lekhoniya by providing
users with a dedicated drawing space. This guide will walk you through the features and
functionalities of the script.
Overview of Drawing Script
The Drawing Script is designed to offer users a real-time drawing experience within a
dedicated iframe. Users accessing a specific URL (`https://lekhoniya.blogspot.com/d/`) will
be redirected to a drawing page hosted on onessssweb's blog, allowing them to draw
collaboratively.
Code Explanation
javascript
var currentUrl_dtime = window.location.href.substring(0, 33); var
durlToMatch = 'https://lekhoniya.blogspot.com/d/';
if (currentUrl_dtime === durlToMatch) {
console.log('Realtime Drawing');
// Create an iframe element
let iframe = document.createElement('iframe');
// Set the source URL for the drawing page
iframe.src = "https://onessssweb.blogspot.com/2023/11/drawplate.html";
// Set inline styles for the iframe
iframe.style.position = "fixed"; iframe.style.top =
"0";
iframe.style.left = "0";
iframe.style.bottom = "0";
iframe.style.right = "0";
iframe.style.width = "100%";
44. iframe.style.height = "100%";
iframe.style.border = "none";
iframe.style.margin = "0";
iframe.style.padding = "0"; iframe.style.overflow =
"hidden"; iframe.style.zIndex = "999999";
// Append the iframe to the document body
document.body.appendChild(iframe);
// Hide the editableSpan to provide a clean drawing space
document.getElementById('editableSpan').style.display = 'none';
// Extract resolution parameters from the URL, defaulting to 800×800
const currentURL = window.location.href;
let ssx = 800;
let ssy = 800;
const match = currentURL.match(//d/(d+)-(d+)//);
if (match) {
ssx = parseInt(match[1]); ssy
= parseInt(match[2]);
console.log("Resolution: " + ssx + 'X' + ssy);
}
}
Usage Instructions
1. Access Drawing Space:
•
Open the URL `https://lekhoniya.blogspot.com/d/` in your web browser.
2. Real-time Drawing:
•
Users are redirected to a dedicated drawing page hosted on onessssweb's blog.
•
The drawing experience is collaborative and real-time within the iframe.
3. Drawing Resolution:
•
The resolution of the drawing canvas can be customized based on parameters in the URL.
•
The default resolution is set to 800×800.
4. Clean Drawing Space:
•
The editableSpan is hidden to provide a clean space for drawing.
5. Console Logging:
•
Connection details and resolution parameters are logged to the console for reference.
Conclusion
The Realtime Drawing Script adds a new dimension to collaborative creativity on Lekhoniya,
offering users a shared space for real-time drawing experiences. For questions, feedback, or
assistance, feel free to reach out to the Lekhoniya support team. Enjoy drawing
collaboratively on Lekhoniya!