Is there a way to track the share count of post shared from my website for “Facebook, Twitter, WhatsApp, Snapchat and LinkedIn

My website is developed in Yii2 and I want to track when a user share the post from my website to other Social Media platform, currently I can only track when they click on share button, but I am unable to track if the posts are actually shared on other platform.

We tried adding Metadata to our Website but still unable to track if the post is actually shared, the count increases by one when a user click on share button but we can’t determine if the post is shared on Facebook.

How do get in to or access storage/emulated/0/DCIM/Camera

I am trying to stop a hacker and get them out of my devices. They hear and see everything I do and my device states that it is an emulated device. I have bought several phones and and changed carriers and SIM cards, phone numbers and email addresses but they still seem to find me and get back in. I can’t afford an IT tech to help. I am trying to learn how to do things myself but I can’t write code nor can I find a terminal to use because the hacker always seems to disable them before I can use them. I did find out how and where it started and the name of the first malware they started with which is still being used. Agent Tesla is the name of the original malware. What can I do.

Everything and no results. Even had a friend who knows how to write code and they couldn’t do anything.

Is there a way to pass JSX props via a single prop?

I have a component that I can’t change. Its content is fixed and out of my reach.

function Button(props) {
   return <button {...props} />
}

Can be used as:

<Button onClick={...} disabled={...} />

My question is if it is possible to combine the props I send to it in a single “super” prop, e.g.

<Button componentProps={{ onClick: ..., disabled: ... }} />

without changing the component’s code. Similar to how you can either nest children or use the children prop to pass them.

Why is the header of the mobile navigation disappearing for 0.1 seconds when opening or closing (disabled background scroll)?

I am trying to develop a mobile navigation that disables background scroll and also stays on the scrolled position of the user. When it is opened, it saves the position of the user and sets the heights of the body, content and navigation to 100svh (- height of nav bar) so there are no problems with bottom bars (such as in Safari iOS). On top of that the content is not scrollable so there won’t be issues when scrolling in the navigation.

Basically everything works as it should except one thing. I noticed a white flashing of the navigation bar after you click on it. Turns out that it “disappears” for about 0.1 seconds. I tested it on my iPhone in Safari, Firefox as well as Chrome. Certainly there could be worse issues, but it is just not clean.

function navigation(){

  var navheaderheight = document.getElementById("navclick").clientHeight;
  var status = document.getElementById("status");
  var userposition = document.getElementById("userposition");
  var content = document.getElementById("contentid");
  var navigationbox = document.getElementById("shownbox");
  var body = document.getElementById("bodyid");

    if (document.getElementById("status").value == 0){
      var scrolled = this.scrollY;
        userposition.setAttribute("value", scrolled)
        status.setAttribute("value", 1);
          content.classList.toggle("togglecon");
          navigationbox.classList.toggle("togglenav");
          body.classList.toggle("togglebod");
            var heightmaincontent = "calc(100svh - " + navheaderheight + "px + " + scrolled + "px)";
            content.style.height = heightmaincontent;
              var topmaincontent = "-" + scrolled + "px";
              content.style.top = topmaincontent;
    }
    else{
        status.setAttribute("value", 0);
          body.classList.toggle("togglebod");
          navigationbox.classList.toggle("togglenav");
          content.classList.toggle("togglecon");     
            content.style.height = "auto";
            content.style.top = "auto";
              window.scrollTo(0, userposition.value);
              userposition.value = 0;
    }
}
<body id="bodyid">

    <div class="navigation">
        <div class="navigation-click" id="navclick">
            <div class="icon" id="clicker" onclick="navigation()"></div>
        </div>
        <div class="navigation-box" id="shownbox"></div>
            <input id="status" value="0" type="hidden" />
            <input id="userposition" value="0" type="hidden" />
    </div>

    <div class="content" id="contentid">
        <p>Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. At vero eos et accusam et justo duo dolores et ea rebum. Stet clita kasd gubergren, no sea takimata sanctus est Lorem ipsum dolor sit amet. Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. At vero eos et accusam et justo duo dolores et ea rebum. Stet clita kasd gubergren, no sea takimata sanctus est Lorem ipsum dolor sit amet. Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. At vero eos et accusam et justo duo dolores et ea rebum. Stet clita kasd gubergren, no sea takimata sanctus est Lorem ipsum dolor sit amet. Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. At vero eos et accusam et justo duo dolores et ea rebum. Stet clita kasd gubergren, no sea takimata sanctus est Lorem ipsum dolor sit amet. Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. At vero eos et accusam et justo duo dolores et ea rebum. Stet clita kasd gubergren, no sea takimata sanctus est Lorem ipsum dolor sit amet. Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. At vero eos et accusam et justo duo dolores et ea rebum. Stet clita kasd gubergren, no sea takimata sanctus est Lorem ipsum dolor sit amet. Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. At vero eos et accusam et justo duo dolores et ea rebum. Stet clita kasd gubergren, no sea takimata sanctus est Lorem ipsum dolor sit amet. Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. At vero eos et accusam et justo duo dolores et ea rebum. Stet clita kasd gubergren, no sea takimata sanctus est Lorem ipsum dolor sit amet. Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. At vero eos et accusam et justo duo dolores et ea rebum. Stet clita kasd gubergren, no sea takimata sanctus est Lorem ipsum dolor sit amet. Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. At vero eos et accusam et justo duo dolores et ea rebum. Stet clita kasd gubergren, no sea takimata sanctus est Lorem ipsum dolor sit amet. Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. At vero eos et accusam et justo duo dolores et ea rebum. Stet clita kasd gubergren, no sea takimata sanctus est Lorem ipsum dolor sit amet. Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. At vero eos et accusam et justo duo dolores et ea rebum. Stet clita kasd gubergren, no sea takimata sanctus est Lorem ipsum dolor sit amet. Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. At vero eos et accusam et justo duo dolores et ea rebum. Stet clita kasd gubergren, no sea takimata sanctus est Lorem ipsum dolor sit amet. Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. At vero eos et accusam et justo duo dolores et ea rebum. Stet clita kasd gubergren, no sea takimata sanctus est Lorem ipsum dolor sit amet. Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. At vero eos et accusam et justo duo dolores et ea rebum. Stet clita kasd gubergren, no sea takimata sanctus est Lorem ipsum dolor sit amet. Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. At vero eos et accusam et justo duo dolores et ea rebum. Stet clita kasd gubergren, no sea takimata sanctus est Lorem ipsum dolor sit amet.</p>
    </div>

</body>

How to put it in order Excel to JS

guys
I have a program that reads data from Excel and then compares it with the numbers entered by the user.
My data is Height and Width (this is entered by the user)
and using this data I would like the price to be displayed. (which is also included in the excel table).

My question is: how to best arrange the data in excel to implement the comparison code in the next steps.

My data in excel in this momment

What is the different between function and let? [duplicate]

I’m new to JS, I’m having problem to see what’s the different between using let function and function. They do the same thing and I don’t know which one has better use case or more efficient. Please do share your knowledge here.

The let function code :

let textInput = document.getElementId("textInput");
let myFunction = () => {
    if(textInput.value === ""){ 
        console.log("Failed"); 
    }
    else{
        console.log("Success"); 
    }
}

The function code :

let textInput = document.getElementId("textInput");
function myFunction() {
    if(textInput.value === ""){ 
        console.log("Failed"); 
    }
    else{
        console.log("Success"); 
    }
}

I googled it but most of them have paywall to know more, so this is the only free option I have. Thanks in advance.

Why the Youtube Iframe API runs only once inside useEffect?

I am using the Youtube Iframe API’s first example in my react app. The problem I am facing is that when I reload the page everything works fine for the first time but when I change any settings like autoplay, loop from sidebar it stops working. I am following the first Iframe example from the documentation.

I am expecting that If i change any settings from sidebar, everything should works just fine.

Heres what I have tried —

import "./styles.css";
import { useEffect } from "react";

export default function App({config}) {
  useEffect(() => {
    const tag = document.createElement("script");
    tag.id = "iframe-demo";
    tag.src = "https://www.youtube.com/iframe_api";
    const firstScriptTag = document.getElementsByTagName("script")[0];
    firstScriptTag.parentNode.insertBefore(tag, firstScriptTag);

    let player;

    window.onYouTubeIframeAPIReady = () => {
      player = new window.YT.Player("existing-iframe-example", {
        events: {
          onReady: (e) => {
            console.log("on player ready", e);
            player.mute();
          },
          onStateChange: (e) => {
            if (e.data === window.YT.PlayerState.ENDED && true) {
              console.log("video ended", player);
              player.seekTo(5 || 0);
            }
          },
        },
      });
    };
  }, [config?.autoplay, config?.isVideoMute]);

  return (
    <div className="App">
      <iframe
        id="existing-iframe-example"
        width="640"
        height="360"
        src={`https://www.youtube.com/embed/M7lc1UVf-VE?enablejsapi=1&start=5&end=8&mute=${config?.isVideoMute}&autoplay=${config?.isAutoPlay}`}
        frameborder="0"
      ></iframe>
    </div>
  );
}

Take a look at the Iframe src attribute. From my settings panel, I am controlling the mute and autoplay config. So, when I change any value of these settings, the Youtube Player API onStateChange does not fire.

JavaScript pagination and data fetch from URL

I’m a beginner in JavaScript and I’m having a few problems with my code.
First of all, sorry for the long and weird question.

(I will share all of my code as I fetch the data from a URL along with examples of the calls results)

function displayImage(postId) {
  const img = document.createElement("img");
  img.src = `http://10.0.0.17:7099/v1_api/blogimg/abcdef/${postId}/0.png`;
  img.alt = "Blog Image";
  img.classList.add("img-responsive");
  img.addEventListener("click", function () {
    window.location.href = `blog-item.html?id=${postId}`;
  });
  return img;
}

document.addEventListener("DOMContentLoaded", function () {
  let skip = 0;
  const postsPerPage = 2;
  const baseUrl = "http://10.0.0.17:7099/v1_api/bloglist/abcdef";
  const urlCategories = "http://10.0.0.17:7099/v1_api/blogstatistics/abcdef";
  const postsContainer = document.getElementById("posts-container");
  const paginationContainer = document.getElementById("pagination");
  const categoriesContainer = document.getElementById("blog-categories");
  const tagsContainer = document.getElementById("tag-cloud");
  const recentPostsContainer = document.querySelector(".widget-recent-post");

  function fetchPosts(skip) {
    const url = `${baseUrl}?skip=${skip}&take=${postsPerPage}&requireTotalCount=true`;
    fetch(url)
      .then((response) => response.json())
      .then((data) => {
        const totalRecords = data.totalRecordCount;
        const posts = data.rows.sort(
          (a, b) => new Date(b.creation) - new Date(a.creation)
        );
        const numPages = Math.ceil(totalRecords / postsPerPage);

        function displayPosts(page) {
          postsContainer.innerHTML = "";

          const start = (page - 1) * postsPerPage;
          const end = start + postsPerPage;
          const paginatedPosts = posts.slice(start, end);

          paginatedPosts.forEach((post) => {
            const postElement = document.createElement("div");
            postElement.classList.add("blog-post");
            postElement.innerHTML = `
                          <example></example>?
                      `;

            const imgContainer = displayImage(post.id);
            postElement.insertBefore(imgContainer, postElement.firstChild);
            postsContainer.appendChild(postElement);
          });

          const pagination = Array.from(
            { length: numPages },
            (_, index) => index + 1
          )
            .map(
              (pageNum) =>
                `<li class="page-item ${
                  pageNum === page ? "active" : ""
                }"><a href="#" class="page-link" data-page="${pageNum}">${pageNum}</a></li>`
            )
            .join("");

          paginationContainer.innerHTML = `
                      <li class="page-item ${
                        page === 1 ? "disabled" : ""
                      }"><a href="#" aria-label="Start" class="page-link" data-page="1">Inicio</a></li>
                      <li class="page-item ${
                        page === 1 ? "disabled" : ""
                      }"><a href="#" aria-label="Previous" class="page-link" data-page="${
            page - 1
          }">Anterior</a></li>
                      ${pagination}
                      <li class="page-item ${
                        page === numPages ? "disabled" : ""
                      }"><a href="#" aria-label="Next" class="page-link" data-page="${
            page + 1
          }">Siguiente</a></li>
                      <li class="page-item ${
                        page === numPages ? "disabled" : ""
                      }"><a href="#" aria-label="End" class="page-link" data-page="${numPages}">Final</a></li>
                  `;

          const pageLinks = document.querySelectorAll(".page-link");
          pageLinks.forEach((link) => {
            link.addEventListener("click", () => {
              const pageNum = parseInt(link.getAttribute("data-page"));
              skip = (pageNum - 1) * postsPerPage;
              fetchPosts(skip);
            });
          });
        }

        displayPosts(1);
      })
      .catch((error) => console.error("Error obtaining posts", error));
  }

  function fetchRecentPosts() {
    const url = `${baseUrl}?take=3&requireTotalCount=true`;

    fetch(url)
      .then((response) => response.json())
      .then((data) => {
        const posts = data.rows.sort(
          (a, b) => new Date(b.creation) - new Date(a.creation)
        );

        posts.forEach((post) => {
          const postItem = document.createElement("div");
          postItem.classList.add("media");

          postItem.innerHTML = `
            <div class="media-left">
                <a href="blog-item.html?id=${post.id}">
                    <img class="media-object" src="http://10.0.0.17:7099/v1_api/blogimg/abcdef/${
                      post.id
                    }/0.png" alt="...">
                </a>
            </div>
            <div class="media-body">
                <h4 class="media-heading"><a href="blog-item.html?id=${
                  post.id
                }">${post.title}</a></h4>
                <ul>
                    <li><a href="blog-item.html?id=${post.id}">${
            post.usrName
          }</a></li>
                    <li>${new Date(post.creation).toLocaleDateString()}</li>
                </ul>
            </div>
        `;

          recentPostsContainer.appendChild(postItem);
        });
      })
      .catch((error) => console.error("Error :", error));
  }

  function fetchCategories() {
    fetch(urlCategories)
      .then((response) => response.json())
      .then((data) => {
        const categories = data.rows.filter((row) => row.rectype === 0);

        const categoriesList = categories
          .map(
            (category) => `
                <li>
                    <i class="fa fa-angle-double-right"></i>
                    <a href="#" data-id="${category.id}" class="category-link">${category.description}</a>
                    <a href="#" class="cat-counter">(${category.Count})</a>
                </li>
            `
          )
          .join("");

        categoriesContainer.innerHTML = categoriesList;

        const categoryLinks =
          categoriesContainer.querySelectorAll(".category-link");
        categoryLinks.forEach((link) => {
          link.addEventListener("click", (event) => {
            event.preventDefault();
            const categoryId = link.getAttribute("data-id");
            fetchPostsByCategory(categoryId);
          });
        });
      })
      .catch((error) =>
        console.error("Error al obtener las categorías:", error)
      );
  }

  function fetchPostsByCategory(categoryId) {
    const url = `${baseUrl}?category=${categoryId}&skip=0&take=${postsPerPage}&requireTotalCount=true`;

    fetch(url)
      .then((response) => response.json())
      .then((data) => {
        const totalRecords = data.totalRecordCount;
        const posts = data.rows.sort(
          (a, b) => new Date(b.creation) - new Date(a.creation)
        );
        const numPages = Math.ceil(totalRecords / postsPerPage);
        displayPosts(posts, numPages);
      })
      .catch((error) => console.error("Error obtaining posts:", error));
  }

  function fetchTags() {
    fetch(urlCategories)
      .then((response) => response.json())
      .then((data) => {
        const tags = data.rows.filter((row) => row.rectype === 1);

        const tagsList = tags
          .map(
            (tag) => `
                <a href="#">${tag.description}</a>
            `
          )
          .join("");

        tagsContainer.innerHTML = tagsList;
      })
      .catch((error) =>
        console.error("Error al obtener las etiquetas:", error)
      );
  }

  fetchPosts(skip);
  fetchRecentPosts();
  fetchCategories();
  fetchTags();

  document.addEventListener("click", function (event) {
    if (event.target.classList.contains("readmore")) {
      const postId = event.target.getAttribute("data-id");
      window.location.href = `blog-item.html?id=${postId}`;
    }
  });
});

That is all my code, I’m going to explain it a bit:

Function fetchPosts(skip): This function collects all the data from a URL query and then they are shown (this one works as intended and initially no need to change anything except pagination)

  • const pagination (line 78) it should collect the total count of posts (by id) then print it on your typical pagination thingy, this works as intended, but the problem comes at the moment of changing the “active” class where it always stays at one (though you can properly navigate through the pages) I’d also like to make it so there is a limit of numbers you can see and click (example, there are 20 pages in total, so if you are in page 1 you should only be able to go from page 1 to 10, then if on page 5 from 1 to 15 etc.)

fetchRecentPosts(): working as intended

fetchCategories(): working as intended

fetchPostByCategory():this is my second problem, when clicking on a post category (rows.description) it should call to fetchPosts but then only show the post with the same category as the one clicked (post.category) using this URL: http://10.0.0.17:7099/v1_api/bloglistCat/abcdef/
{category ID}

fetchTags(): working as intended

fetchPostByTag(): this needs to be done still but same as ByCategory, this time using http://10.0.0.17:7099/v1_api/bloglistTag/abcdef/Procesos/%7Bdescription%7D

These are two examples of my URL calls:

baseUrl:

  "usrName": "JA",
      "id": 6,
      "title": "Procesos contables habituales",
      "categoryid": 2,
      "category": "Finances",
      "abstract": "Sample Text",
      "img": "blogimg/abcdef/6/0.png",
      "creation": "2024-05-10T11:18:04.953",
      "taglist": "["Industry"]"
    },
    {

categoryUrl:

{
  "rows": [
    {
      "Count": 2,
      "description": "Industry",
      "category": 0,
      "rectype": 1
    },
    {
      "Count": 5,
      "description": "Finances",
      "category": 2,
      "rectype": 0
    }
  ],
  "requeryError": ""
}

Where rectype = 0 is category and rectype = 1 are tags

Now, finally my html so you knows how it should be organized:

<body>
    <header>
        <div class="navbar navbar-default navbar-top">
            <div class="container">
                <div class="navbar-header">
                    <!-- Stat Toggle Nav Link For Mobiles -->
                    <button type="button" class="navbar-toggle" data-toggle="collapse" data-target=".navbar-collapse">
                        <i class="fa fa-bars"></i>
                    </button>
                    <!-- End Toggle Nav Link For Mobiles -->
                    <!--a class="navbar-brand" href="index.html"></a-->
                    <a title="runit" href="index.html" class="logo-link">
                        <img src="images/Logotipo.png" alt="Logo" class="logo-img">
                    </a>
                </div>
                <div class="navbar-collapse collapse">
                    <!-- Start Navigation List -->
                    <ul class="nav navbar-nav navbar-right">
                        <li>
                            <a href="index.html">Inicio</a>
                        </li>
                        <li>
                            <a href="about.html">Sobre nosotros</a>
                        </li>
                        <li>
                            <a href="service.html">Servicios y Productos</a>
                        </li>
                        <li>
                            <a href="portfolio.html">Portfolio</a>
                        </li>
                        <li>
                            <a class="active" href="blog.html">Blog</a>
                        </li>
                        <li><a href="contact.html">Contacto</a>
                        </li>
                    </ul>
                    <!-- End Navigation List -->
                </div>
            </div>
        </div>
    </header>
    <!-- Start Header Section -->
    <div class="page-header-blog">
        <div class="overlay">
            <div class="container">
                <div class="row">
                    <div class="col-md-12">
                        <h1>Blog</h1>
                    </div>
                </div>
            </div>
        </div>
    </div>
    <!-- End Header Section -->

    <!-- Start Blog Page Section -->
    <div class="container">
        <div class="row">
            <!-- Start Blog Body Section -->
            <div class="col-md-8 blog-bodyt">
                
                <!-- Start Blog Body -->
                <div class="col-md-8" id="posts-container" class="scroll">
                    <!-- Blog Content comes here -->
                </div>
                <!-- End Blog Body Section -->

                <!-- Start Pagination -->
                <nav>
                    <ul id="pagination" class="pagination">
                        
                    </ul>
                </nav>
                <!-- End Pagination -->

            </div>
            <!-- End Blog Body Section -->

            <!-- Start Sidebar Section -->
            <div class="col-md-4 sidebar right-sidebar">
                <!-- Start Recent Post Widget -->
                <div class="widget widget-recent-post">
                    <div class="section-heading-2">
                        <h3 class="section-title">
                            <span>Latest Posts</span>
                        </h3>
                    </div>

                    <div id="posts-container">

                    </div>

                </div>
                <!-- End Recent Post Widget -->


                <!-- Blog categories widget -->
                <div class="widget widget-categories">
                    <div class="section-heading-2">
                        <h3 class="section-title">
                            <span>Categories</span>
                        </h3>
                    </div>
                    <ul id="blog-categories">

                    </ul>
                </div>
                <!-- End Blog categories widget -->

                <!-- Tag Cloud Widget -->
                <div class="widget widget-tags">
                    <div class="section-heading-2">
                        <h3 class="section-title">
                            <span>Tags Popular</span>
                        </h3>
                    </div>
                    <div class="tagcloud" id="tag-cloud">

                    </div>
                </div>
                <!-- End Tag Cloud Widget -->
            </div>
            <!-- End Sidebar Section -->
        </div>
    </div>
    <!-- End Blog Page Section -->
</body>

For the pagination I tried following this tutorial (starts at min 5:40), but op is using a different way to keep track of the current page.

About the tag/category part I can’t really find anything similar to what I wanted so I was hoping any of you could give me more insight on how to make it work.

Sorry again for the long question, I’m still a bit new to Stack Overflow.

if condition not working in the javascript play wright code [closed]

when new user trying u login it redirect to sign up page existing user login mean its navugate to home page

export class signuppage {
    
    //var namefield:locator;

    constructor(page) {
        this.page=page;
        this.namefield="//input[@placeholder='Full Name']"
        this.signupfreame="//div[@class='modal-login modal-body']"
        this.terms="//label[contains(text(),'I hereby state that I am older than 18 years of ag')]"
        //this.jotdhomepopup=".modal-content.contentClassName.undefined"
        this.profileicon="//a[@id='dropdown-user']//img"
}
async signupdetails() {
const nameFieldExists = await this.page.$(this.namefield);
const profileIconExists = await this.page.$(this.profileicon);

    if (nameFieldExists) {
        // If the name field exists, proceed with signup process
        await this.page.waitForSelector(this.signupfreame);
        await this.page.fill(this.namefield, data.personname);
        const terms = await this.page.locator("label[for='tnc']");
        await terms.click();
        await this.page.waitForTimeout(5000);
        console.log("Sign up page");
    } else if (profileIconExists) {
        // If the profile icon exists, consider the user as an existing user
        console.log("Existing user");
    } else {
        // If neither name field nor profile icon exists, log "Failed"
        console.log("Failed");
    }

}

How to take a screenshot of a a-scene of AFRAME on button click and download it

I am using ascene and i want to take a screenshot on button click with 3d element

I have added an Iframe in html file and want to take a screenshot of the iframe with 3d element place on a-scene how to do that

<iframe id="aframeFrame" src="tabular_navbar.html" width="200" height="400" onload="handleIframeLoad()">
         <p>Your browser does not support iframes.</p>
        </iframe>
<button id="capture-screenshot">Capture Screenshot</button>

tabular_navbar.html

<a-scene mindar-face embedded vr-mode-ui="enabled: false" device-orientation-permission-ui="enabled: false">
      <a-camera active="false" position="0 0 0"></a-camera>
      <a-entity mindar-face-target="anchorIndex: 1">
        <a-sphere color="green" radius="0.1"></a-sphere>
      </a-entity>
    </a-scene>

javascript, cant get getElementsById to work

I have 2 fields in a web form to fill with text from the clipboard. I managed to get 1 to work but cant the other. I’m using a Chrome addon to autofill with javascript rule tried changing getElementsByName to getElementsById but doesn’t work.

This code works:

<input id="repeatEmail" type="text" name="repeatEmail" autocomplete="chrome-off" maxlength="50" class="register__input" style="border: 1px solid rgb(170, 170, 170) !important;">
setTimeout(async function GetClip() {
  let ctext = await window.navigator.clipboard.readText()
  console.log('Clipboard: ' + ctext);
  document.getElementsByName("repeatEmail")[0].value = ctext;
}, 1000)

This code doesn’t work:

<input id="name" type="text" autocomplete="off" maxlength="28" class="register__input" style="border: 1px solid rgb(170, 170, 170) !important;">
setTimeout(async function GetClip() {
  let ctext = await window.navigator.clipboard.readText()
  console.log('Clipboard: ' + ctext);
  document.getElementsByName("name")[0].value = ctext;
}, 1000)

Error when using logarithmic axis for HeatmapGridSeries in lightningChartJS 5.2.0

I am using lightningChartJS to create a heatmap within a dashboard object. My requirement is to have a logarithmic x-axis, while the normal x-axis should not be visible. This setup worked perfectly in version 4.2.1, but after updating to version 5.2.0, it throws an error and the heatmap is not displayed.

Here’s a snippet of the React code I am using:

import { useEffect } from "react";
import { lightningChart, Axis, ChartXY, emptyLine } from "@arction/lcjs";

function App() {
  useEffect(() => {
    const lc = lightningChart({license: "my-license"});
 const dashboard = lc.Dashboard({
    numberOfColumns: 1,
    numberOfRows: 1,
    container: "lc"
  });
    const chart = dashboard.createChartXY({   columnIndex: 0,
      rowIndex: 0 });
    chart.getDefaultAxisX().setVisible(false);
    const logXAxis = chart
      .addAxisX({
        type: "logarithmic",
        base: 10
      })
      .setInterval({
        start: 3,
        end: 500
      });

    const heatmapSeries = chart.addHeatmapGridSeries({
      columns: 901,
      rows: 2500,
      dataOrder: "rows",
      start: { x: 0, y: 0 },
      end: { x: 25, y: 25 }
    })
    .setWireframeStyle(emptyLine)
    .setIntensityInterpolation("bilinear");

    return () => {
      chart.dispose();
    };
  }, []);

  return <div id="lc" style={{ width: "500px", height: "500px" }}></div>;
}

export default App;

In version 4.2.1, the heatmap displays correctly, as shown in this screenshot:
enter image description here

after updating to version 5.2.0, I encounter the following error and the chart does not render:

Uncaught Error: HeatmapGridSeries can only be attached to a pair of Linear Axes.

Here is a screenshot of the error:
enter image description here

Has anyone else encountered this issue? Is there a workaround to use a logarithmic axis with a heatmap in the latest version, or is this a bug?

Complex shopping cart logic and tax calculation, discount voucher, bundles

I’m in the process of creating a checkout / shopping cart process for a relatively scenario and would like to check if someone has done this before and what the best or rather financially (tax) correct method is to calculate the VAT and discounts to be tax compliant.

It’s not about the actual programming code but more about the correct sequence or logic that should be followed to be financially correct.

To start with we have ‘Passes’ that allow clients to attend sessions based on the pass ‘credits’ Clients can buy this passes in as standalone items or in ‘packs’. Packs are purely a ‘collection’ or Product / Pass combinations and ONLY has a sales value. VAT for packs is based on the items within the pack. They can also have Promotion Codes that can be applied to a specific product or to the cart value.

There’s also ‘Products’ that can be purchased.

NOTE: All the prices are inclusive of VAT

**So Passes:** 
1 - Pass 1 - has 1 credit and price is $25 - vat is 9%
2 - Pass 2 - has 5 credits and price is $100 - vat is 9%
3 - Pass 3 - has 10 credits and price is $180 - vat is 9%
4 - Pass 4 - has 20 credits and price is $340 - vat is 9%


**Products**
1 - Product 1 - price $15 - vat 15%
2 - Product 2 - price $70 - vat 15%
3 - Product 3 - price $11 - vat 9%

**Packs**
1 - Pack 1 - consist of **Pass 1 and Product 1** - price $110 
2 - Pack 2 - consist of **Pass 2 and Product 2** - price $165

**Promo Codes**
1 - Promo 1 - ONLY valid on Pass 2 - value 5% of item value
2 - Promo 2 - valid on cart total - value 5% of cart value


Here's 2 sample carts:

**Cart 1**
1 x Pass 3 @ 180 (this is @ 9% VAT inclusive)
1 x Pack 2 @ 165 (this has 2 items with 9% and 15% VAT)
Client added Promo Code 1 (promo is only valid for Pass 2 which is part of the Pack)


**Cart 2** 
1 x Product 2 @ $8 (this is @ 15% VAT inclusive)
1 x Pack 1 @ $110 (this has 2 items with 9% and 15% VAT)
1 x Pass 2 @ $100 (this is @ 9% inclusive)
1 x Product 3 @ $11 (this is @ 9% inclusive)
Client added Promo Code 2 (promo code is valid for the total cart value)

So the question is how to 1) apply the discounts for the promo codes entered, 2) calculate the discounts.

As you can see from the data above, a Pack is essentially 1 or more products and has a combined selling value for the items in that pack – ie. a discounted value for the items but at a pack level, and the VAT is inclusive so in order to calculate the VAT in a pack you have to pro-rate the actual selling price of the item within the pack then apply the tax/vat. Add to that the promo coupon and the question is what calculation comes first and do you pro-rate @ the inclusive price level or at the exclusive price level? And for the promo at cart level do you now pro-rate ALL the items in the cart or can you apply the discount of subtotal level which will mean your tax breakdown will be incorrect??

I’m sure there must be a specific sequence this needs to be done at in order to be VAT / TAX compliant but I don’t seem to find anything online that describes the sequence or process of how this should be done.

Will be interesting to see as I have discussed with multiple people and I seem to be getting conflicting approached to do this 🙂

Thanks in advance for your views and comments.

Issue with Modal: Unable to Close by Clicking Outside

I have a modal that opens when clicking a button. However, I’m facing an issue where the modal doesn’t close when clicking outside of it. Here’s the HTML structure:

Button to open the modal:

<div class="col-md-3 mb-3 text-center">
    <button id="spread-truth-button" class="faith-button system_page_button btn btn-custom btn-block" type="button" data-bs-toggle="modal" data-bs-target="#shareModal">Spread the truth!</button>
</div>

Modal content:

<div id="shareModal" class="modal">
    <!-- Modal content -->
    <div class="modal-content">
        <span class="close">&times;</span>
        <p class="centered-text form-labels">Broadcast the Arcane Cards</p>
        <div class="social-media-button-container">
            <button class="social-media-share-button" onclick="shareOnFacebook()">
                <img src="{% static 'icon-facebook.png' %}" alt="Share on Facebook">
            </button>
            <!-- Other social media share buttons -->
        </div>
        <input type="text" value="https://www.example.com/system_page" id="shareLink" style="display: none;">
    </div>
</div>

The modal opens correctly, but it doesn’t close when clicking outside of it. How can I add functionality to close the modal by clicking outside of it?

What I Tried:

I first attempted to research the issue online and reviewed the Bootstrap documentation for modals to see if there was a built-in option for closing the modal by clicking outside of it. However, I couldn’t find a straightforward solution within the Bootstrap framework.

Then, I experimented with adding custom JavaScript code to achieve the desired functionality. I tried various event listeners, such as click events on the modal backdrop or document body, to detect clicks outside of the modal and trigger the modal’s close action accordingly.

Expectations:

My expectation was that by implementing the appropriate JavaScript code, the modal would respond to clicks outside of its content area and automatically close itself. I anticipated that this would provide a more intuitive user experience, allowing users to dismiss the modal easily without having to interact directly with the modal’s close button.