Grammarly Chrome extension replaces my iframe dropdown options with __grammarly

I’m building a Wix Studio site. Inside it, I embed an iframe that loads a custom HTML page.

That page has an amCharts map and a dropdown () to switch datasets.

When the Grammarly Chrome extension is enabled, it messes with my .
As soon as I click the dropdown (or sometimes right on load), the options get replaced and I’m left with only:

<select id="countrySelect">
  <option value="__grammarly">__grammarly</option>
</select>

So all my original dropdown options disappear, and the UI breaks.

Is there a way to completely stop Grammarly from touching my iframe and dropdown?

Environment

  • Wix Studio (iframe embed)
  • amCharts (map + dropdown re-render)
  • Grammarly Chrome extension (causing the issue)

What is the Expo 54 way of creating a file in external storage?

I’ve recently upgraded to expo 54 (from 53) where expo-file-system/next got renamed to expo-file-system and expo-file-system to expo-file-system/legacy.

I’m currently trying to migrate from the deprecated (/legacy) module to the main one.
But I can’t seem to be able to create a file in external storage.

This is working code using the legacy module:

import * as FileSystem from "expo-file-system/legacy";
const SystemIO = FileSystem.StorageAccessFramework;

async function externalSave(fileName: string, content: string) {
  const documentUri = SystemIO.getUriForDirectoryInRoot("Documents");
  const permission = await SystemIO.requestDirectoryPermissionsAsync(documentUri);
  if (permission.granted) {
    const targetPath = permission.directoryUri;
    const createdPath = await SystemIO.createFileAsync(
      targetPath,
      fileName,
      "application/json",
    );
    await SystemIO.writeAsStringAsync(createdPath, content);
  } else {
    // error handling
  }
}

And this is the modern attempt

import { Directory, File } from "expo-file-system";

async function externalSave(fileName: string, content: string) {
  // uri => content://com.android.externalstorage.documents/tree/primary%3ADocuments/
  const directory = await Directory.pickDirectoryAsync("Documents");
  // exists => false
  const file= new File(directory.uri, `${fileName}.${jsonExtension}`);
  // throws here
  file.create({ overwrite: true });
  // Also tried write without create and got the same error cause
  file.write(content);
}

This is the error caused by file.create

Call to function ‘FileSystemFile.create’ has been rejected.
→ Caused by: A folder with the same name already exists in the file location

When the modern externalSave is called, the user is prompted to select a directory in the external storage (starting with /documents), a File object is created (whose exists property is false) and then the file.create call throws the above error.

What is the proper way of creating a file in external storage, and writing to it?

What is this React/JavaScript statement doing [duplicate]

I’m trying to understand a particular React/JavaScript statement and what is happening with this statement:

const ManyLinksCard = (props) => {
    const { classes, cardInfo: { configuration: { customConfiguration } } } = props;

    const backgroundStyle = customConfiguration?.urlImage
            ? { backgroundImage: `url(${customConfiguration.urlImage})` }
            : {};
    
    const source = customConfiguration.client || customConfiguration;
}

The statement in question is:

const backgroundStyle = customConfiguration?.urlImage

and the question mark ? within customConfiguration?.

What is that ? doing? Is customConfiguration an array so the statement would be customConfiguration1.urlImage, customConfiguration2.urlImage, etc.?

Button Hover Background Color

When i hover on these buttons, appear the text of the function of each button along with it’s background color, for some this color is a very dark gray, and the other it’s a white.

The client really wants to all of them to be white, but which property i change in CSS to change this bg color?

I tried changing the font-awesome, bootstrap and other basis code for the icons, but still nothing, even when changing the :hover property

Is there a basis integrated code the change this automatically?

Observation: We’re using Leaflet JS library, is by any chance this tooltip create on it?

[enter image description here](https://i.sstatic.net/51eVasiH.png)

    <li>
   <!--Toolbar-->
   <div id="editingToolbar" style="display: none;margin-top: 15px;">
      <!--<ul class="e-separator"  style="display: none">
         <li id="liSignOut" class="fa fa-sign-out fa-lg" title="Sair"></li>
         </ul>-->
      <ul class="e-separator">
         <li id="lnkSysConf" class="fa fa-cog fa-lg" title="Configurações"></li>
         <li id="liHelp"  class="fa fa-question-circle-o fa-lg" title="Ajuda"></li>
      </ul>
      <ul class="e-separator">
         <li id="liFullExtent" class="fa fa-arrows-alt fa-lg" title="Zoom a extensão"></li>
         <li id="liPreviousZoom" class="fa fa-arrow-left fa-lg" title="Zoom anterior"></li>
         <li id="liNextZoom" class="fa fa-arrow-right fa-lg" title="Zoom posterior"></li>
         <li id="liClearZHistory" class="fa fa-eraser fa-lg" title="Limpar histórico"></li>
      </ul>
      <ul class="e-separator">
         <li id="liThemes" title="Mapas temáticos">
            <i class="fa fa-map-o fa-lg"></i>
         </li>
         <!--<li id="liHelp" title="Ajuda">
            <i class="fa fa-question-circle-o fa-lg"></i>
            </li>-->
         <li id="liPrint" title="Imprimir">
            <i class="fa fa-print fa-lg"></i>
         </li>
      </ul>
      <ul class="e-separator">
         <li id="liLayers" class="mainnav-toggle slide" title="Mapas">
            <i class="fa fa-navicon fa-lg"></i>
         </li>
         <li id="liTables" title="Informações">
            <i class="fa fa-table fa-lg"></i>
         </li>
      </ul>
      <ul class="e-separator">
         <li id="liInfo">
            <i class="fa fa-info-circle fa-lg" title="Identificar"></i>
         </li>
         <li id="liMove">
            <i class="fa fa-hand-stop-o fa-lg" title="Mover"></i>
         </li>
         <li id="liSelect">
            <i class="fa fa-mouse-pointer fa-lg" title="Selecionar"></i>
         </li>
      </ul>
   </div>
</li>

Leaflet CSS Code:

/* Variables and Mixins */
/* Generic L.Toolbar */
.leaflet-toolbar-0 {
  list-style: none;
  padding-left: 0;
  border: 2px solid rgba(0, 0, 0, 0.2);
  border-bottom-left-radius: 4px;
  border-bottom-right-radius: 4px;
  border-top-left-radius: 4px;
  border-top-right-radius: 4px;
}
.leaflet-toolbar-0 > li {
  position: relative;
}
.leaflet-toolbar-0 > li > .leaflet-toolbar-icon {
  display: block;
  width: 30px;
  height: 30px;
  line-height: 30px;
  margin-right: 0;
  padding-right: 0;
  border-right: 0;
  text-align: center;
  text-decoration: none;
  background-color: #ffffff;
}
.leaflet-toolbar-0 > li > .leaflet-toolbar-icon:hover {
  background-color: #f4f4f4;
}
.leaflet-toolbar-0 .leaflet-toolbar-1 {
  display: none;
  list-style: none;
}
.leaflet-toolbar-tip-container {
  margin: 0 auto;
  margin-top: -16px;
  height: 16px;
  position: relative;
  overflow: hidden;
}
.leaflet-toolbar-tip {
  width: 16px;
  height: 16px;
  margin: -8px auto 0;
  background-color: #ffffff;
  border: 2px solid rgba(0, 0, 0, 0.2);
  border-bottom-left-radius: 4px;
  border-bottom-right-radius: 4px;
  border-top-left-radius: 4px;
  border-top-right-radius: 4px;
  background-clip: content-box;
  -webkit-transform: rotate(45deg);
      -ms-transform: rotate(45deg);
          transform: rotate(45deg);
}
/* L.Toolbar.Control */
.leaflet-control-toolbar {
  /* Secondary Toolbar */
}
.leaflet-control-toolbar > li > .leaflet-toolbar-icon {
  border-bottom: 1px solid #ccc;
}
.leaflet-control-toolbar > li:first-child > .leaflet-toolbar-icon {
  border-top-left-radius: 4px;
  border-top-right-radius: 4px;
}
.leaflet-control-toolbar > li:last-child > .leaflet-toolbar-icon {
  border-bottom-left-radius: 4px;
  border-bottom-right-radius: 4px;
  border-bottom-width: 0;
}
.leaflet-control-toolbar .leaflet-toolbar-1 {
  margin: 0;
  padding: 0;
  position: absolute;
  left: 30px;
  /* leaflet-draw-toolbar.left + leaflet-draw-toolbar.width */
  top: 0;
  white-space: nowrap;
  height: 30px;
}
.leaflet-control-toolbar .leaflet-toolbar-1 > li {
  display: inline-block;
}
.leaflet-control-toolbar .leaflet-toolbar-1 > li > .leaflet-toolbar-icon {
  display: block;
  background-color: #919187;
  border-left: 1px solid #aaa;
  color: #fff;
  font: 11px/19px "Helvetica Neue", Arial, Helvetica, sans-serif;
  line-height: 30px;
  text-decoration: none;
  padding-left: 10px;
  padding-right: 10px;
  height: 30px;
}
.leaflet-control-toolbar .leaflet-toolbar-1 > li > .leaflet-toolbar-icon:hover {
  background-color: #a0a098;
}
.leaflet-control-toolbar .leaflet-toolbar-1 > li:last-child > .leaflet-toolbar-icon {
  border-top-right-radius: 4px;
  border-bottom-right-radius: 4px;
}
/* L.Toolbar.Popup */
.leaflet-popup-toolbar {
  position: relative;
  box-sizing: content-box;
}
.leaflet-popup-toolbar > li {
  float: left;
}
.leaflet-popup-toolbar > li > .leaflet-toolbar-icon {
  border-right: 1px solid #ccc;
}
.leaflet-popup-toolbar > li:first-child > .leaflet-toolbar-icon {
  border-top-left-radius: 4px;
  border-bottom-left-radius: 4px;
}
.leaflet-popup-toolbar > li:last-child > .leaflet-toolbar-icon {
  border-top-right-radius: 4px;
  border-bottom-right-radius: 4px;
  border-bottom-width: 0;
  border-right: none;
}
.leaflet-popup-toolbar .leaflet-toolbar-1 {
  position: absolute;
  top: 30px;
  left: 0;
  padding-left: 0;
}
.leaflet-popup-toolbar .leaflet-toolbar-1 > li > .leaflet-toolbar-icon {
  position: relative;
  float: left;
  width: 30px;
  height: 30px;

Yarn/npm scripts with backtick markers #J_S/#J_E work on macOS but fail on Windows (“#J_Scd is not recognized”) — how to make this cross‑platform?

I’m trying to run yarn install (and other scripts) for a project that’s partially auto‑generated by an internal platform. The platform injects special markers around script commands in package.json:

  • SCRIPT_START_MARKER = #J_S
  • SCRIPT_END_MARKER = #J_E

Example snippets from package.json:


`{
  "scripts": {
    "postinstall": "`#J_S`cd node_modules/@wingify/jslib-platform && grunt init-app || true`#J_E`&& cd - && node -e "try { require('fs').symlinkSync(require('path').resolve('node_modules/@bower_components'), 'bower_components', 'junction') } catch (e) { }"",
    "docs": "`#J_S`grunt typedoc`#J_E`",
    "ts": "`#J_S`grunt ts`#J_E`",
    "merge-configs": "`#J_S`cd node_modules/@wingify/jslib-platform && grunt merge-configs`#J_E`"
  }
}`

On macOS, running yarn install succeeds. On Windows (PowerShell/CMD), it fails inside dependencies that also contain these markers (e.g., @wingify/campaign-runner).

Error on Windows:

yarn install v1.22.22
[5/5] Building fresh packages...
error D:projectnode_modules@wingifycampaign-runner: Command failed.
Exit code: 1
Command: `#J_S`cd node_modules/@wingify/jslib-platform && grunt init-app || true`#J_E`
Output:
'`#J_S`cd' is not recognized as an internal or external command,

Environment

  • Windows: PowerShell 5.1 (also tried CMD), Yarn 1.22.22
  • macOS: Works with the same repo without any extra tool
  • package.json is auto-generated; markers are inserted by a script that defines:
    `const SCRIPT_START_MARKER = '`#J_S`';
    const SCRIPT_END_MARKER = '`#J_E`';`
    
  • I cannot easily remove the markers from dependencies; they’re reinstalled by yarn.

What I’ve tried

  • Running yarn install normally on Windows → fails as above.
  • Setting npm’s script shell to Git Bash so npm/yarn scripts run under bash:
    npm config set script-shell "C:Program FilesGitbinbash.exe"
    npm config get script-shell
    

    This helps in some setups, but I still hit failures when a dependency’s postinstall runs with these markers.

  • Using WSL (Ubuntu) and running yarn install from /mnt/d/… → works, but I’d prefer a Windows-native approach.
  • Searching for a yarn/npm feature to ignore/strip these markers → couldn’t find any.

Questions

  1. Is there any official way to make npm/yarn treat those backtick‑wrapped markers as harmless on Windows (similar to how they effectively don’t break in bash on macOS)?
  2. Is configuring npm’s script‑shell to Git Bash the recommended/best practice for this case, or is there a better cross‑platform approach?
  3. If Git Bash is the solution, how can I ensure all dependency scripts (including postinstall in node_modules) reliably execute under bash on Windows?
  4. If the only fix is “remove the markers,” what’s a practical strategy when dependencies’ package.json also contain them and get reinstalled by yarn? Is there a preinstall hook, patch-package, or other common workaround?

Goal
I want yarn install and subsequent yarn scripts (e.g., build) to work on Windows without manually editing node_modules each time or maintaining a separate Windows-only branch.

Tags

  • node.js
  • npm
  • yarnpkg
  • windows
  • bash
  • cross-platform
  • postinstall

If you think I’m missing a standard pattern for cross‑platform npm/yarn scripts here, please point me to it. Thanks!

How to temporarily store a user’s data so they can retrieve it on another device

I have developed a small web game in HTML/JS (with Vue.js) where players can come every day to play a new game. I plan to add a statistics system soon so that players can track their progress. Their statistics will be stored in localStorage and updated every day after the end of a game.

So far, so good.

Now I’m looking to integrate a feature that allows players to transfer their stats from one device to another (PC to mobile and vice versa, since the statistics are specific to the browser used), and that’s where I don’t know how to proceed. I’ve seen that similar games such as Gamedle and Loldle offer this feature, where they generate a token that users can copy and paste onto their other device.

I had thought about setting up a database specifically for this purpose, or creating a file on my server where I would write the token (generated beforehand) + the local storage data, but I noticed that the two sites mentioned above have made sure that the token has a limited lifespan, so I wondered if they had done something else or used a third-party API. I don’t know…

Can you tell me what you think would be the simplest and most practical method to implement for temporarily storing a user’s game data on the server side so that they can transfer it to another device?

Thanks in advance!

What languages, frameworks and libraries should I use for my web application? [closed]

I’m working on a project, and I’d love to get advice from experienced web developers about the best technologies to use.

Here’s the idea:
The application will allow this fictional restaurant’s guests to scan a QR code at their table, which takes them to a web interface where they can build and submit their order.

There will be three main parts:

Guest interface: Guests choose and customize their meals, then submit the order.

Waiter interface: Waiters can see incoming orders in real time, sorted by table.

Admin interface: The restaurant admin can update menu items, prices, and availability.

I’d like to have real-time updates so waiters see new orders immediately and guests can track order progress.

I already know HTML, CSS (including Tailwind and Bootstrap), PHP (started learning Laravel), JavaScript (started learning Node.js), C#, and some Python. My goal is to choose a tech stack that’s realistic for my skill set.

Which languages, frameworks, or libraries would you recommend for building such a project? Should I stick with PHP/Laravel for the backend, or would Node.js be a better choice for real-time communication? For the frontend, would you suggest a framework like Vue or React, or something else?

Any advice would be greatly appreciated!

I want to know how to freeze the header row when scrolling down

<div class="table-responsive" style="max-height:540px; overflow-y:auto;">
    <table class="table table-bordered" style="table-layout: fixed; width: 100%;">
        <thead class="thead-light">
            <tr>
                <th class="sticky-top bg-white">Status</th>
            </tr>
        </thead>
        <tbody>
            <tr><td>test</td></tr>
        </tbody>
    </table>
</div>

I also tried using a table with display: block;:

<table class="table table-bordered" style="width: auto; max-height: 540px; display: block;">
</table>

With this approach, the header froze, but the columns got misaligned.
I want a table with a scrollable body and sticky headers, while keeping all columns correctly aligned.
How can I achieve this?

How to change input value on Webflow Designer through google chrome console code?

I need to change field values on “custom properties” section of webflow designer using javascript code on google chrome console

fields to change

Also, after changing, it should be saved on editor like I entered that manually.

How can I achieve needed result?

Currently i`m trying to use

input.value = needed_value; 

That`s not helped to me

After that I tried to emulate firing events

const nativeInputValueSetter = Object.getOwnPropertyDescriptor(window.HTMLInputElement.prototype, 'value').set;
    nativeInputValueSetter.call(input, newValue);

input.dispatchEvent(new Event('input', { bubbles: true }));
input.dispatchEvent(new Event('change', { bubbles: true }));
input.dispatchEvent(new KeyboardEvent('keydown', { key: 'Enter', code: 'Enter', bubbles: true }));

That also not helped me.

What else methods should I try?

How do I access a dynamic variable returned by a function that is inside another function

I ma trying to first create the tic tac toe game on the console.
What I want
Before the playRound function is called, the value of the targeted cell should be zero otherwise the playround function should not be called.

function Gameboard() {
  const rows = 3;
  const columns = 3;
  const board = [];

  for (let i = 0; i < rows; i++){
    board[i] = []
    for (let j = 0; j < columns; j++) {
      board[i].push(Cell());
    }
  }

  console.log(" board display");  
  console.log(board);


  const dropToken = (column, row, player) => {
 
    const currentValueCell = () => board[row][column].getValue()
    
    console.log(currentValueCell());
    console.log(board[row][column].getValue());
    return board[row][column].addToken(player);

 
}


  const  printBoard = () => {
    const boardWithCellValues = board.map((row) => row.map((cell) => cell.getValue()))
    console.log(boardWithCellValues);
  };

  return {
    printBoard,
    dropToken,
    board,
    
  };
}

function Cell() {
  let value = 0;
  const addToken = (player) => {
      value = player
  };

  const getValue = () => value;

  return {
    getValue,
    addToken
  };
}


function GameContoller(
    playerOneName = "player One",
    playerTwoName = "player Two"
) {
    const board = Gameboard();

    const players = [
        {
            name: playerOneName,
            token: 1
        },
        {
            name: playerTwoName,
            token: 2
        }
    ];

    let activePlayer = players[0];

    const switchPlayerTurn = () => {
        activePlayer = activePlayer ===  players[0] ? players[1] : players[0];
    };

    const getActivePlayer = () => activePlayer;

    const printNewRound = () => {
        board.printBoard();
        console.log(`${getActivePlayer().name}'s turn.`);
    };


    const playRound = (column, row) => {
        console.log(
            `Dropping ${getActivePlayer().name}'s token into ${column} and  ${row}...`
        );
        board.dropToken(column,row, getActivePlayer().token);
        console.log(board.dropToken().currentValueCell);//What I have tried to access the value of the targeted cell

        switchPlayerTurn();
        printNewRound();

        

    };

    printNewRound();

    return{
        playRound,
        getActivePlayer
    };
}

const game = GameContoller();

THis is the current code of what I have tried. My expectation was If I use the currentValueCell function inside the dropToken function it is able to capture the value of the cell at the time then I can be able to use that variable inside the playground function

Uncaught Error in MInd AR js using Django for Ar based website

MindAR “RangeError: Extra N byte(s) found at buffer[1]” + “AR target element not found”

Problem
MindAR throws RangeError: Extra XXXX byte(s) found at buffer[1] when loading a .mind marker file. Additional logs show AR target element not found and a browser extension message-channel warning.

Environment

  • A‑Frame: 1.4.0
  • three.js: ^0.147.0
  • mindar-image-aframe
  • Marker path: /media/markers/baby121/baby121.mind

Observed Logs (trimmed)

Valid MIND format detected: 88919 byte payload
Received 88927 bytes, Content-Type: application/octet-stream
Uncaught (in promise) RangeError: Extra 4167 of 4168 byte(s) found at buffer[1]
AR target element not found

Root Cause

MindAR validates the marker file length against its header. The served file contains extra bytes compared to the header (e.g., expected 88919, received 88927). This typically happens when:

  • An edge/proxy (Cloudflare/Tunnel, etc.) compresses or rewrites binary files (gzip/brotli) or appends bytes.
  • The file was uploaded in text mode (CRLF/BOM) or otherwise corrupted.
  • The URL returns HTML or a partial/concatenated response instead of the raw binary.

AR target element not found is a separate DOM timing/selector issue: tracking starts before the <a-entity mindar-image-target> exists.

The message-channel warning usually comes from a browser extension and is unrelated.


Fixes

A) Serve .mind files as raw, uncompressed binary

Headers:

  • Content-Type: application/octet-stream
  • No Content-Encoding (disable gzip/brotli)
  • Avoid any response transformations.

Nginx

location /media/markers/ {
    types { application/octet-stream mind; }
    default_type application/octet-stream;
    gzip off;  # ensure no compression
    add_header Cache-Control "public, max-age=31536000, immutable";
}

Apache

AddType application/octet-stream .mind
SetEnvIfNoCase Request_URI ".mind$" no-gzip=1
Header set Cache-Control "public, max-age=31536000, immutable"

Cloudflare/Proxy
Add a rule to bypass cache/transforms for *.mind or enforce Content-Encoding: identity at origin. Disable minify/compression for that path.

B) Verify served bytes match the source

Node quick check

const fs = require('fs');
const https = require('https');
const crypto = require('crypto');

// local file
const a = fs.readFileSync('./baby121.mind');
console.log('local', a.length, crypto.createHash('sha256').update(a).digest('hex'));

// remote file
https.get('https://your-domain/media/markers/baby121/baby121.mind', res => {
  const chunks = [];
  res.on('data', d => chunks.push(d));
  res.on('end', () => {
    const b = Buffer.concat(chunks);
    console.log('remote', b.length, crypto.createHash('sha256').update(b).digest('hex'));
  });
});

If lengths/hashes differ, the server/proxy is modifying the file. Fix config and/or re‑upload in binary mode.

C) If manually fetching, read as arrayBuffer()

const res = await fetch('/media/markers/baby121/baby121.mind', { cache: 'no-cache' });
const buf = await res.arrayBuffer();         // ✅ not res.text()
const blob = new Blob([buf], { type: 'application/octet-stream' });
const url  = URL.createObjectURL(blob);
// Use `url` in MindAR config

D) Ensure the AR target exists before tracking

HTML skeleton

<a-scene mindar-image="imageTargetSrc: /media/markers/baby121/baby121.mind;"
         vr-mode-ui="enabled: false"
         device-orientation-permission-ui="enabled: true"
         embedded>
  <a-camera position="0 0 0" look-controls="enabled: false"></a-camera>
  <a-entity id="ar-target" mindar-image-target="targetIndex: 0">
    <a-entity gltf-model="#model" position="0 0 0" scale="0.2 0.2 0.2"></a-entity>
  </a-entity>
</a-scene>

JS timing guard

const sceneEl = document.querySelector('a-scene');
sceneEl.addEventListener('loaded', () => {
  const target = document.querySelector('#ar-target');
  if (!target) {
    console.warn('AR target element not found');
    // Optionally create/append the target here
  }
});

E) Re‑export marker if corrupted

If the on‑disk .mind already has the wrong size, regenerate it with MindAR CLI/Editor and upload again (binary mode). Avoid editing it in text editors.


What I tried
I set up an A-Frame (v1.4.0) + MindAR scene and served my marker file (baby121.mind) from /media/markers/baby121/. I also confirmed that the file was being fetched correctly by the browser and that it returned with Content-Type: application/octet-stream.

What I expected
I expected MindAR to load the .mind marker normally, initialize tracking, and then detect the target so I could attach my 3D model to it.

What actually happened
Instead, the console shows that the .mind file is detected but with mismatched byte sizes (e.g., “88927 bytes received” vs. “88919 payload”). This leads to RangeError: Extra XXXX byte(s) found at buffer[1]. At the same time, I also get AR target element not found. As a result, the AR experience never starts properly.

How to concate two objects, and if any keys are the same between the two objects, sum the elements [duplicate]

// Complete the function mergeObjects(obj1, obj2) that returns a new object containing all properties of obj1 and obj2
// If a property exists in both objects, add them together (ints) or concatenate them (arrays/strings)
function mergeObjects(obj1, obj2) {
    let obj = new Object();

    let key1 = Object.keys(obj1);
    let key2 = Object.keys(obj2);
}

This is all i have so far. I’m not too sure of what to do… If anyone can give me some perspective or a hint that would be great

Pick Group and Rank question in qualtrics. Groups to be editable during preview

I was wondering if it is possible for be able to have the user be able to rename the groups for the question type pick group and rank when they are doing the survey (not in survey editor)

Possibly using javascript or anything else, would greatly appreiciate any help. Im not very good with javascript, and tried to use gpt which came up with this code



Qualtrics.SurveyEngine.addOnReady(function() {

  // Select all group headers (Qualtrics usually uses these classes)

  let groupHeaders = document.querySelectorAll(".ChoiceGroupHeader, .RankGroupHeader, .Editable.Answer");



  groupHeaders.forEach(header => {

    // Create an input field to replace the header text

    let input = document.createElement("input");

    input.type = "text";

    input.value = header.innerText.trim();

    input.style.border = "1px solid #ccc";

    input.style.borderRadius = "6px";

    input.style.padding = "2px 6px";

    input.style.fontSize = "14px";

    input.style.width = (header.offsetWidth || 120) + "px";



    // Replace the header content with the input

    header.innerHTML = "";

    header.appendChild(input);



    // Update the header text dynamically as the user edits

    input.addEventListener("input", function() {

      header.setAttribute("data-renamed", this.value);

    });

  });

});

But this did not work.

Thabk you all

How to use ACF OpenStreetMap Field plugin in WordPress with zoom setting?

I’m trying to figure out how to use Leaflet.js that’s inside the ACF Openstreetmap Field Plugin. I found a code that was helpful and I was able to modify to display the map on my wordpress website.

The way it works is that it collect the map/markers from the single campuses and display them all together in the main campuses map. However, the problem is that while it does work in the single campus page, it’s not showing the correct zoom setting on the single campus page.

Here are my steps:

  1. Install ACF OpenStreetMap Field Plugin

  2. When creating the Map Location Field Group in ACF, make sure to click on “Raw Data” under Return Format

  3. In functions.php, add this

wp_enqueue_style('leaflet-map-css', '//unpkg.com/[email protected]/dist/leaflet.css');
wp_enqueue_script('leaflet-map-js', '//unpkg.com/[email protected]/dist/leaflet.js', NULL, '1.9.4', false); 
  1. In index.js, add this
import LeafletMap from "./modules/Leaflet";
const leafletMap = new LeafletMap();
  1. In archive-campus.php, add this (This is where it collects all markers from single campus posts in main campuses page),
<div class="acf-map">
    <?php
    while(have_posts()) {
      the_post();
      $map_location = get_field('map_location');
    ?>
        <div class="marker"
            data-lng="<?php echo $map_location['markers']['0']['lng']; ?>"
            data-lat="<?php echo $map_location['markers']['0']['lat']; ?>"
        >
        <h3><a href="<?php the_permalink(); ?>"><?php the_title(); ?></a></h3>
            <?php echo $map_location['address'] ?>
        </div>
    <?php } ?>
 
    </div>
  1. Add Leaflet.js file in js->modules folder (There’s no need to add Mapbox Token. I didn’t create an account or add any credit card info.)
class LMap {
  constructor() {
    document.querySelectorAll(".acf-map").forEach((el) => {
      this.new_map(el);
    });
  }
 
  new_map($el) {
    var $markers = $el.querySelectorAll(".marker");
 
    var map = L.map($el).setView([0, 0], 13);
 
    L.tileLayer("https://tile.openstreetmap.org/{z}/{x}/{y}.png", {
      maxZoom: 19,
      attribution:
        '&copy; <a href="http://www.openstreetmap.org/copyright">OpenStreetMap</a>',
    }).addTo(map);
 
    map.markers = [];
    var that = this;
 
    // add markers
    $markers.forEach(function (x) {
      that.add_marker(x, map);
    });
 
    // center map
    this.center_map(map);
  } // end new_map
 
  add_marker($marker, map) {
    var marker = L.marker([
      $marker.getAttribute("data-lat"),
      $marker.getAttribute("data-lng"),
    ]).addTo(map);
 
    map.markers.push(marker);
 
    // if marker contains HTML, add it to an infoWindow
    if ($marker.innerHTML) {
      // create info window
      marker.bindPopup($marker.innerHTML);
    }
  } // end add_marker
 
  center_map(map) {
    var bounds = new L.LatLngBounds();
 
    // loop through all markers and create bounds
    map.markers.forEach(function (marker) {
      var latlng = new L.LatLng(marker._latlng.lat, marker._latlng.lng);
 
      bounds.extend(latlng);
    });
 
    map.fitBounds(bounds);
  } // end center_map
}
 
export default LMap;
  1. In single-campus.php, add this:
<?php
      $map_location = get_field('map_location');
      ?>
      
      <div class="acf-map">
        <div class="marker" data-lat="<?php echo $map_location['markers']['0']['lat'] ?>" data-lng="<?php echo $map_location['markers']['0']['lng']; ?>">
            <h3><?php the_title(); ?></h3>
            <?php echo $map_location['address']; ?>
        </div>
    </div>

So I tried to add the zoom setting to the code but it didn’t work in the single campus page as it was supposed to.

Here’s my attempt:

  1. single-campus.php
<?php
      $map_location = get_field('map_location');

      if ($map_location) {
        // print_r($map_location);
        $zoom_level = isset($map_location['zoom']) ? esc_attr($map_location['zoom']) : 14;
      }
      ?>
      
      <div class="acf-map" data-zoom="<?php echo $zoom_level; ?>">
        <div class="marker" data-lat="<?php echo $map_location['markers']['0']['lat'] ?>" data-lng="<?php echo $map_location['markers']['0']['lng']; ?>">
            <h3><?php the_title(); ?></h3>
            <?php echo $map_location['address']; ?>
        </div>
    </div>
  1. and I edited the new_map section in the Leaflet.js:
new_map($el) {
    var $markers = $el.querySelectorAll(".marker");

    var zoom_level = parseInt($el.getAttribute("data-zoom")) || 13;

    var map = L.map($el).setView([0, 0], zoom_level);

    L.tileLayer("https://tile.openstreetmap.org/{z}/{x}/{y}.png", {
      maxZoom: 19,
      attribution:
        '&copy; <a href="http://www.openstreetmap.org/copyright">OpenStreetMap</a>',
    }).addTo(map);

Can you let me know what went wrong, please?

Express routes not being hit; router testing middleware never logs requests [closed]

I’m building a Node.js + Express backend with MongoDB and JWT authentication. I have a router userRoutes.js that handles /api/users endpoints, but none of the routes seem to be hit — even a simple console.log in the router middleware never prints.

My setup:

  • server.js
import express from "express";
import cookieParser from "cookie-parser";
import userRoutes from "./routes/userRoutes.js";

const app = express();
app.use(express.json());
app.use(cookieParser());

app.use("/api/users", userRoutes);
app.get("/", (req, res) => res.send("Server is ready"));
app.listen(5000, () => console.log("Server running"));
  • userRoutes.js
import express from "express";
import { registerUser, authUser } from "../controllers/userController.js";

const router = express.Router();

// Debug middleware
router.use((req, res, next) => {
  console.log("Request hit userRoutes:", req.method, req.originalUrl);
  next();
});

router.post("/", registerUser);
router.post("/auth", authUser);

export default router;

Issue:

  • When I make requests to /api/users/ or /api/users/auth, nothing logs in the console.
  • The root route / works fine.

Link to github repo

.env variables setup

MONGO_URI=
JWT_SECRET=
NODE_ENV=development

What I’ve tried:

  • Checked that the paths to the router and controller files are correct.
  • Verified that the server is running and listening on the right port.
  • Ensured express.json() and cookieParser() are used before the router.

Why aren’t requests reaching the userRoutes router? What might be causing the router middleware to never log requests?