Update index.js

This commit is contained in:
Max W. 2025-04-11 01:24:53 +02:00
parent 814adbd334
commit 78c0a99b72

View File

@ -85,6 +85,7 @@ $(document).ready(function() {
// Load paste on page load
async function loadPasteFromUrl() {
$viewer.text("Loading...");
const urlParams = new URLSearchParams(window.location.search);
const pasteId = urlParams.get('id');
@ -93,6 +94,7 @@ $(document).ready(function() {
const response = await fetch(`/api/pastes/${pasteId}`);
if (response.ok) {
$('pre').css('width', '100%'); // Set pre width
const content = await response.text();
$editor.val(content);
updateLineNumbers();