I have a problem with the events. I can’t enlarge them. (resize)

I can’t extend the appointment. Can someone please tell me what’s wrong?

document.addEventListener("DOMContentLoaded", function() {
    const calendarEl = document.getElementById('calendar');
    const calendar = new FullCalendar.Calendar(calendarEl, {
        locale: 'de',
        initialView: 'dayGridMonth',
        editable: true,
        themeSystem: 'bootstrap4', // Theme System ändern: bootstrap3,bootstrap4,jquery-ui,standard
        droppable: true,
        eventDisplay: "block",
        weekNumbers: true,
        displayEventTime: true,
        weekends: true,
        displayEventEnd: true,
        events: 'libs/termine.php?data=all',
        eventDrop: function(event) {
            $.ajax({
                type: "get",
                url: "libs/termine.php?data=move",
                data: {
                    id: event.event._def.publicId, // Event id for DB
                    start:event.event.startStr,  // Event start timestamp
                    end:event.event.endStr, // Event end timestamp
                    allDay:event.event.allDay // Event allDay Boolean
                },
                success: function(response){
                    toastr.success(response);
                }
            });
        },
        eventResize: function(event) {
            $.ajax({
                type: "get",
                url: "libs/termine.php?data=move",
                data: {
                    id: event.event._def.publicId, // Event id for DB
                    start:event.event.startStr,  // Event start timestamp
                    end:event.event.endStr, // Event end timestamp
                    allDay:event.event.allDay // Event allDay Boolean
                },
                success: function(response){
                    toastr.success(response);
                }
            });
           },
        eventClick: function(info) {
            $('#eventModal').modal('show');
            $('#title').val(info.event.title);
            $('#start').val(info.event.startStr);
            $('#end').val(info.event.endStr);
            $('#eventId').val(info.event.id);
            $('#eventModalLabel').text('Termin bearbeiten');
            $('#deleteEventBtn').show();
        },
        dateClick: function(info) {
            // Crear nuevo evento al hacer clic en una fecha
            $('#eventModal').modal('show');
            $('#eventForm')[0].reset();
            $('#start').val(info.dateStr);
            $('#end').val('');
            $('#eventId').val('');
            $('#eventModalLabel').text('Ereignis hinzufügen');
            $('#deleteEventBtn').hide();
        }
    });
    $('#eventForm').on('submit', function(e) {
        e.preventDefault();
        const eventData = {
            title: $('#title').val(),
            start: $('#start').val(),
            end: $('#end').val(),
            id: $('#eventId').val()
        };
 
        $.ajax({
            url: eventData.id ? 'libs/termine.php?data=update' : 'libs/termine.php?data=add',
            type: 'get',
            dataType: 'json',
            data: eventData,
            eventDrop: function(event, delta){ // event drag and drop
               $.ajax({
                   url: 'index.php',
                   data: 'action=update&title='+event.title+'&start='+moment(event.start).format()+'&end='+moment(event.end).format()+'&id='+event.id ,
                   type: "get",
                   success: function(json) {
                   toastr.success(response);
                   }
               });
           },
            success: function(response) {
                $('#eventModal').modal('hide');
                calendar.refetchEvents();
                toastr.success(response);
                if (response && response.message) {
                    
                } else {
                    //alert("Error: respuesta no válida del servidor");
                }
            },
            error: function() {
                //alert("Error al guardar el evento.");
            }
        });
    });
 
    // Eliminar evento
    $('#deleteEventBtn').on('click', function() {
        const eventId = $('#eventId').val();
 
        if (eventId) {
            $.ajax({
                url: 'libs/termine.php?data=delete',
                type: 'GET',
                dataType: 'json',
                data: { id: eventId },
                success: function(response) {
                    $('#eventModal').modal('hide');
                    calendar.refetchEvents();
                   toastr.success(response);
                },
                error: function() {
                    
                }
            });
        }
    });
    calendar.render();

});

I haven’t found the error yet, maybe one of you can see it. Please help and my english is very bad ;)I want to enlarge the event, but it’s not working. It works great in other examples, but I can’t find my mistake.

I’ve already looked through some examples but haven’t found the right approach.

That is my HTML code:

        eventResize: function(event) {
            $.ajax({
                type: "get",
                url: "libs/termine.php?data=move",
                data: {
                    id: event.event._def.publicId, // Event id for DB
                    start:event.event.startStr,  // Event start timestamp
                    end:event.event.endStr, // Event end timestamp
                    allDay:event.event.allDay // Event allDay Boolean
                },
                success: function(response){
                    toastr.success(response);
                }
            });
           },

My problem is that I can’t extend the event, so I can’t make it last over several days. Postpone it, and everything’s fine.

How to invalidate a query with specific parameters using queryClient.invalidateQueries in React Query v5

I’m using React Query to manage my queries, and I have a scenario where I need to invalidate a query with specific parameters.

useQuery({
  queryKey: ["users", { page: 2, pageSize: 20 }],
  queryFn: () => fetchUsers(), // Function that fetches users
});

Currently, I’m on page 2 of the users list. After performing an edit operation successfully, I want to invalidate the query for page 1 (with the same pageSize parameter).

I tried this with queryClient.invalidateQueries, but it doesn’t seem to work as expected.

queryClient.invalidateQueries({
  queryKey: ["users", { page: 1, pageSize: 20 }], // Changing the params
});

How can I invalidate the query for page 1 after editing the data for page 2? Is there a way to invalidate the query with specific parameters like { page: 1, pageSize: 20 } without matching the exact reference?

How do i correctly convert and display the timezone from the API itself

my value is given in unix timestamp: 1744022662 and now i need to make it so that it shows the correct time in the searched country’s timezone.

    dayAndDate.textContent = datenday.toLocaleString("en-US", {day: "numeric", month: "numeric", year: "numeric", hour: "numeric", minute: "numeric", hour12: true});

OUTPUT: 4/8/2025, 4:29 AM```

This works but the time im getting is off by 3-4 hours and if i remove the timezone it still is off. 

Is there another similar function for displaying the date?

How to hide elements when child elements are hidden in table pagination using jquery?

I have a table with diffents rows. The table has a pagination using jquery

Each row has a title
I would like to hide the titles whose row is hidden.
Ex : if “Title2” is active, I’d like to hide “Title1” and “Title3”.
Ho to search and hide the that children are hiding ?

Thanks for your help !

    $(document).ready(function() {

            debugger;

            var show_per_page = 1;
            var number_of_items = $('#myTab').find('tbody tr:has(td)').length;

            
            var navigation_html = '<a class="previous_link" href="">Prev</a>' + '&nbsp';
            var current_link = 1;
            for (var i = 0; i < number_of_items; i = i + show_per_page) {
                navigation_html += '<a class="page_link" href="" data-start="' + i + '" data-end="' + (i + show_per_page) + '">' + (current_link) + '</a>' + '&nbsp';
                current_link++;
            }
            navigation_html += '<a class="next_link" href="">Next</a>';
            $('#page_navigation').html(navigation_html);
            rowDisplay(0, show_per_page);

            function rowDisplay(startIndex, endIndex) {
                $('#myTab').find('tbody tr:has(td)').hide().slice(startIndex, endIndex).show();
                        }

            $('.page_link').click(function(e) {     
                                
                e.preventDefault();
                $('.active').removeClass('active');
                $(this).addClass('active');
                var IndexData = $(this).data();
                rowDisplay(IndexData.start, IndexData.end);
            }).first().addClass('active');

            $('.previous_link, .next_link').click(function(e) {
                e.preventDefault();
                var traverse = $(this).is('.previous_link') ? 'prev' : 'next';
                $('.page_link.active')[traverse]('.page_link').click();
            });
        
        });

        

How should someone learn backbone marionette?

I am currently on internship and have to learn marionette for the frontend but I am not finding any new resources that can help me, other then some docs. They said I have to learn things on my own in this internship with some guidance from my co-workers.

This is how much I have been able to create after understanding:


import UsersView from '../views/Users';
import Users from '../collections/Users';
import MessagesView from '../views/Messages';
import Messages from '../collections/Messages';

export default Marionette.Application.extend({
  region: '#app',
  onStart() {
    const users = new Users();
    console.log("Loading users...");
    
    users.fetch().always(() => {
        console.log("Users loaded.");
        this.showView(new UsersView({ users }));
    });

    const messages = new Messages();
    console.log("Loading messages...");
    
    messages.fetch().always(() => {
        console.log("Messages loaded.");
        this.showView(new MessagesView({ messages }));
    });
  }
});




I would be greateful if you can recommend any useful resoucrces or ways to learn marionette.

how to make a cryptocoin burn button on a wordpress page?

crytpocoin burn button
i have tried to find it on youtube and tried donate buttons but it doesnt work.
i cant find it elsewhere. Nothing works.
I want it on my wordpress page.

please help!

<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Document</title>
<link rel="stylesheet" href="http://www.jgilmore.com/cart/scartlib.aspx?type=css">
<script src="http://www.jgilmore.com/cart/scartlib.aspx?type=js"></script>
<script>var scart = new shoppingcart();</script>
<script src="http://www.jgilmore.com/cart/bitcoin.aspx?cmd=rate"></script>
<script>
    var useBC = false;
    function useBitcoins(){useBC = true;}
    function useDollars(){useBC = false;}
    function AddtoCart(){
        var v = parseFloat(document.getelementbyid('burn').value) * (useBC ? 
1/scart.Bitcoin.BTCSUD : scart.AddtoCart('Burn, Burn to a good cause'+ v));
        scart.Show()
    }
</script>
</head>
<body>
<h1>5 Minute Bitcoin Burn Button</h1>
<input type="button" value="Burn" onclick="AddtoCart()"/>
<input type="text" id="burn"/><br>
Amout is in <input type="radio" name="a" onclick="useBitcoins()"/> bitcoins
<input type="radio" name="a" checked onclick="useDollars"/> USD <br>
<input type="button" value="Cart" onclick="scart.Show()" />
</body>
</html>

How to fix the problem with webtorrent “Invalid asm.js” or frizing when client.add?

I’m creating a streaming service. I need to use the magnet link to broadcast the video to the player. The problem is that the only library that does this for some reason does not work for me and gives the error
‘ webtorrent.min.js:16 Invalid asm.js: Unexpected token or when logging in toclient.add` freezes

<script src="/templates/lordfilm-light/js/webtorrent.min.js"></script>
<script>
    
    var videoURL = '';
    console.log("1", videoURL);

    var client = new WebTorrent();
    console.log("2", videoURL);

    var magnetURI = "magnet:?xt=urn:btih:645ff84f4020018984a5fe8b71b839a008502d1a";
    console.log("3", videoURL);

    client.on('error', function (err) {
      console.log('client error:', err);
    });

    client.on('warning', function (err) {
      console.log('warning:', err);
    });

    client.add(magnetURI, function (torrent) {
      console.log("4", videoURL);
      console.log("torrent add:", torrent.name);

      var file = torrent.files.find(function (file) {
        return file.name.endsWith('.mp4') || file.name.endsWith('.webm');
      });

      if (file) {
        console.log("Find video:", file.name);

        file.getBlobURL(function (err, url) {
          if (err) {
            console.error('error URL:', err);
            return;
          }

          videoURL = url;
          console.log("videoURL:", videoURL);

          
        });

      } else {
        console.warn('File dont here.');
      }
    });
  </script>

I tried to change the webtor version, opened local servers with code straight from the webtor docks , but nothing works. I take link form DLE additional fields using a parser, the entire magnet link looks like this
magnet:?xt=urn:btih:645ff84f4020018984a5fe8b71b839a008502d1a&dn=solncestoyanie_midsommar-2019-bdrip&tr=http://tracker.dler.org:6969/announce&tr=udp://tracker.opentrackr.org:1337

How do large-scale React applications structure codebases for long-term scalability and team collaboration?

I’ve been building React applications for a while, but as my projects grow in size and complexity, I’m starting to hit issues with:

  • Folder structure getting messy

  • Difficulties maintaining reusable components

  • Confusion over where to place business logic

  • Onboarding new developers efficiently

I know there’s no “one-size-fits-all,” but I’d love to hear from experienced React developers who’ve worked on enterprise-level or long-lived projects:

Key questions:

What folder structures and naming conventions have worked best for scalability and maintainability?

How do you organize shared logic (e.g. hooks, utils, services)?

How do you avoid tight coupling between UI components and business logic?

Are there any architectural patterns (like feature-based, domain-driven design, etc.) you recommend?

Context:

Using React 18 with Vite + TypeScript

Working in a team of 4–6 developers

State management: Zustand for now, considering Redux Toolkit

Tailwind CSS for styling

I’m not looking for boilerplate code, but real-world guidance, examples, or even resources/articles you’ve found useful.

How to efficiently implement a uniform pixel map with 100,000 blocks for interactive image placement?

Problem Description

I need to implement a pixel map using canvas or a JavaScript library that contains +- 100,000 blocks.

What I want to achieve:
A map where countries are represented by nxn blocks, with each block being the same size throughout the entire map.

The requirement is to have +- 100k blocks in total. Users should be able to select individual blocks or groups of blocks and place images on them.

My current stack is React.js + deck.gl (I also tried raw canvas but it was too laggy).

What I’ve Tried

I attempted using deck.gl to create the map, but it takes 10-20 seconds to load due to the large number of blocks. Additionally, the blocks have inconsistent sizes – blocks at the top of the map are longer than others (possibly due to the map projection).

I believe a WebGL-based library would provide the best performance for this use case.

For reference, I found this implementation that seems to handle similar functionality efficiently: https://pixelplace.io/7-pixels-world-war

Specific Questions

  • What’s the most efficient way to implement this type of pixel map?
  • How can I optimize rendering performance for 100,000 blocks?
  • What’s the best approach for handling image placement on both individual blocks and grouped blocks (when a user selects multiple blocks to form a larger area)?
  • How can I ensure all blocks maintain the same size regardless of their position on the map?

Any suggestions on libraries, techniques, or optimization strategies would be greatly appreciated!

Relative paths for Javascript fetch inside a Thunderbird extension

I’m trying to use window.fetch() in a Thunderbird extension I’m working on. Specifically, I want to try fetching the contents of files using relative paths – but am failing, possibly because I’m not using the right relative path.

So, the scenario is that the extension provides a background.html; that include a script file, background.js; that script invokes the “WebListener API”, an extension loader of sorts; the WL API code registers a JS file’s URI I give it in a property of a window object; then, finally, when that window loads, Services.scriptloader.loadSubScript() is called with my JS file’s URI; and this invokes my actual code, where I call window.fetch(). Yes, I realize that is rather contorted and weird, but that’s just the way it is these days 🙁

Anyway, the code I’m calling is something like the following:

window.fetch(uri)
  .then((response) => {
    if (!response.ok) {
      throw new Error(`thrown response status: ${response.status}`);
    }
    return response.text();
  })
  .then((text) => doStuff(text) )
  .catch((err) => console.error(`fetch failed: ${err}`));

This works (mostly-works, anyway) if I specify URIs such as chrome://bidimailui/content/subdir/somefile.xhtml – and bundle somefile.xhtml in the appropriate location within the XPI. But if I try specifying a relative path – relative to the location of background.html, or background.js, or the script where the code snippt above is located, or with some parts of the path prefixed – none of those options work. I get an opaque “Network error”, in the .catch() block.

My question: Is this relative-path fetching even supposed to succeed? And if it is – how do I determine the correct relative path for the file I’m trying to fetch? i.e. what would it be relative to?

How can I prevent and/or catch the iframe doing the top-level redirect in Safari?

In our Telegram WebApp I open an iframe to another website, and it does a top-level redirect after the form is submitted (i.e. it redirects our WebApp URL, not the iframe). I tried using service workers (to track current window URL changes), as well as subscribing to onbeforeunload, however there’s a problem with Safari browser that doesn’t have this event, and also that worker’s context is also the document, and it disappears after document’ domain changes.

I cannot do anything with what’s inside the iframe, nor can I create a script that’s attached to the document because it will be non-existent after the redirect. The redirect happens when server-side 301 response is received when form is submitted.

I tried suggestions from AI, but most of them are about creating a script, which doesn’t work because of the above, and some exotic ones I have no ability to implement inside Telegram WebApp (like ARP poisoning).

error when using let and var to store php value [duplicate]

<script>
  let checked = <?php echo $row["restriction"] ?>;
  console.log(checked);
</script>

When I was using a JS variable with let to store a php value, this output appears with errors:

1
userManage.php:88 Uncaught SyntaxError: Identifier 'checked' has already been declared (at userManage.php:88:49)
userManage.php:109 Uncaught SyntaxError: Identifier 'checked' has already been declared (at userManage.php:109:49) 
userManage.php:130 Uncaught SyntaxError: Identifier 'checked' has already been declared (at userManage.php:130:49)

The console.log only runs once then the three other values get an error.

After replacing let -> var, then there’s clearly nothing wrong

<script>
  var checked = <?php echo $row["restriction"] ?>;
  console.log(checked);
</script>

Output:

1
1
1
0
0

DOM elements correctly initialized but not visible after slider transform

I am dynamically adding DOM elements during initialization using JavaScript.
All the elements are correctly added to the DOM (see developer tools screenshot — all tags are inside the container).

However, when I slide to the next page using transform: translateX(), the elements are not visible, even though they are definitely in the DOM and have correct size (see the second screenshot).

What could be causing this issue?

What I’ve checked so far:

✅ The images exist and paths are correct.

✅ HTML elements are properly added inside .page-grid containers.

✅ The first page (data-page=”0″) displays perfectly fine.

✅ It’s not a CSS display: none issue.

✅ It’s not an opacity problem.

✅ The container sizes are correct (checked with developer tools).

But still, the second page (data-page=”1″) does not render images when sliding.

const pages = [{
    prefix: 'assets/emoji_',
    count: 18
  },
  {
    prefix: 'assets/effect_',
    count: 18
  }
];

function initializePages() {
  const grids = document.querySelectorAll('.page-grid');
  grids.forEach((grid, index) => {
    const page = pages[index];
    for (let i = 1; i <= page.count; i++) {
      const img = document.createElement('img');
      img.src = `${page.prefix}${String(i).padStart(2, '0')}.png`;
      img.alt = `${page.prefix}${i}`;
      grid.appendChild(img);
    }
  });
}

function updateSlider() {
  const slider = document.querySelector('.page-slider');
  slider.style.transform = `translateX(-100%)`; // simulate sliding to page 1
}

initializePages();
updateSlider();
.page-slider {
  display: flex;
  width: 100%;
  overflow: hidden;
  transition: transform 0.4s ease;
}

.page-grid {
  min-width: 100%;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
}
<div class="page-slider">
  <div class="page-grid" data-page="0"></div>
  <div class="page-grid" data-page="1"></div>
</div>

✅ Page 0 (data-page=”0″) — images visible

enter image description here

❌ Page 1 (data-page=”1″) — images not visible, but DOM elements exist

enter image description here

Thank you in advance for your help!

DOM elements correctly initialized but not visible after slider transform (Vanilla JS + CSS)

I am dynamically adding DOM elements during initialization using JavaScript.
All the elements are correctly added to the DOM (see developer tools screenshot — all tags are inside the container).

However, when I slide to the next page using transform: translateX(), the elements are not visible, even though they are definitely in the DOM and have correct size (see the second screenshot).

What could be causing this issue?

What I’ve checked so far:

✅ The images exist and paths are correct.

✅ HTML elements are properly added inside .page-grid containers.

✅ The first page (data-page=”0″) displays perfectly fine.

✅ It’s not a CSS display: none issue.

✅ It’s not an opacity problem.

✅ The container sizes are correct (checked with developer tools).

But still, the second page (data-page=”1″) does not render images when sliding.

html

<div class="page-slider">
  <div class="page-grid" data-page="0"></div>
  <div class="page-grid" data-page="1"></div>
</div>

css

.page-slider {
  display: flex;
  width: 100%;
  overflow: hidden;
  transition: transform 0.4s ease;
}

.page-grid {
  min-width: 100%;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
}

js

const pages = [
  { prefix: 'assets/emoji_', count: 18 },
  { prefix: 'assets/effect_', count: 18 }
];

function initializePages() {
  const grids = document.querySelectorAll('.page-grid');
  grids.forEach((grid, index) => {
    const page = pages[index];
    for (let i = 1; i <= page.count; i++) {
      const img = document.createElement('img');
      img.src = `${page.prefix}${String(i).padStart(2, '0')}.png`;
      img.alt = `${page.prefix}${i}`;
      grid.appendChild(img);
    }
  });
}

function updateSlider() {
  const slider = document.querySelector('.page-slider');
  slider.style.transform = `translateX(-100%)`; // simulate sliding to page 1
}

initializePages();
updateSlider();

✅ Page 0 (data-page=”0″) — images visible

enter image description here

❌ Page 1 (data-page=”1″) — images not visible, but DOM elements exist

enter image description here

Thank you in advance for your help!