Second Text component in View line break

I have two components following each other in component and I wanna so that the first component stretches as long as it can and then ellipsizing, but second component stayed close to first without ellipsizing and then in the right with ellipsized first component.

I’ve tried everything that I can think of but without success.

This is Demo of that problem: https://snack.expo.dev/@volodyaspace/second-component-line-break

the text components muck more than expected

In Javascript, how can I querySelector to get the innerHTML excluding one of the inner sibling divs

I have the following html:

<body>
    <span class="comment">
        EXAMPLES:
        <p><i>Example 1</i> - <a href="https://example.com/1">https://example.com/1</a> - Jan 2020 (2 comments)</p>
        <p><i>Example 2</i> - <a href="https://example.com/2">https://example.com/2</a> - Jun 2022 (13 comments)</p>
        <div class="reply"><p><u><a href="reply?id=12323" rel="nofollow">reply</a></u></p></div>
        <p><i>Example 3</i> - <a href="https://example.com/3">https://example.com/3</a> - Apr 2023 (33 comments)</p>
    </span>
</body>

I am trying to get the innerHTML of the .comment class except the .reply div.

Note that the .reply class is not guaranteed to be the last.

Basically, I want to get just:

EXAMPLES:
<p><i>Example 1</i> - <a href="https://example.com/1">https://example.com/1</a> - Jan 2020 (2 comments)</p>
<p><i>Example 2</i> - <a href="https://example.com/2">https://example.com/2</a> - Jun 2022 (13 comments)</p>
<p><i>Example 3</i> - <a href="https://example.com/3">https://example.com/3</a> - Apr 2023 (33 comments)</p>

I am unable to figure out how I can exclude one of the sibling children.

I know I can get the children except the .reply class using the following:

document.querySelectorAll(`.comment > :not(.reply)`)

But this isn’t the innerHTML. It’s a NodeList:

enter image description here

Is there a way to get a new combined element from this NodeList on which I can then call innerHTML on?

I found a slight similar question here:

Javascript .innerHTML but excluding inner div

but that question is about extracting a specific string and solutions seem ugly. Is there a better way?

Grab nested youtube iframe

I’m working on a project where I need to capture the dimensions (width and height) of YouTube embedded iframes on a webpage via an extension, specifically when the user hovers their mouse over the iframe. However, when attempting to programmatically iterate through all the iframes to obtain this information, I encounter cors policy restrictions, which prevent me from accessing the iframe’s properties directly.

I’ve experimented with using regular expressions to circumvent this issue, but unfortunately, that approach hasn’t yielded the desired results.

Can anyone provide guidance or suggest alternative methods to achieve this objective?

Thanks

How to get the names of cities from the route of the Yandex Maps API

There is a code that builds a route between the entered cities using the Yandex Maps API.

ymaps.ready(init);

export function init() {
        myMap = new ymaps.Map('map', {
            center: [55.7549792211111,37.61615189062498],
            zoom: 10,
            controls: []
        }),
    // Создадим панель маршрутизации.
        routePanelControl = new ymaps.control.RoutePanel({
            options: {
                
            }
        }),
        zoomControl = new ymaps.control.ZoomControl({
            options: {
                size: 'small',
                float: 'none',
                position: {
                    bottom: 145,
                    right: 10
                }
            }
        });
    // Пользователь сможет построить только автомобильный маршрут.
    routePanelControl.routePanel.options.set({
        types: {auto: true}
    });
    myMap.controls.add(routePanelControl).add(zoomControl);
    // Получим ссылку на маршрут.
    routePanelControl.routePanel.getRouteAsync().then(function (route) {
        // Зададим максимально допустимое число маршрутов, возвращаемых мультимаршрутизатором.
        route.model.setParams({results: 1}, true);
        // Повесим обработчик на событие построения маршрута.
        route.model.events.add('requestsuccess', function () {
            var activeRoute = route.getActiveRoute();
            if (activeRoute) {
                // Получим протяженность маршрута.
                var length = route.getActiveRoute().properties.get("distance");
                var duration = route.getActiveRoute().properties.get("duration"),
                // Создадим макет содержимого балуна маршрута.
                    balloonContentLayout = ymaps.templateLayoutFactory.createClass(
                        '<span>Расстояние: ' + length.text + '.</span><br/>' +
                        '<span>Время в пути: ' + duration.text + '</span>');
                // Внешний вид маршрута
                route.options.set({
                    routeActiveStrokeColor: "#ff4f1e"
                });
                // Зададим этот макет для содержимого балуна.
                route.options.set('routeBalloonContentLayout', balloonContentLayout);
                // Откроем балун.
                activeRoute.balloon.open();
            }
        });
    });
}

I need to take and save the names of the cities “From” and “To” from the built route. In the future, I need this data to save it to the database.

I found this code, but I don’t know how to adapt it for my code.

ymaps.ready(function () {
    ymaps.geolocation.get({ provider: 'yandex' }).then(function(result) {
        var data = result.geoObjects.get(0).properties.get('metaDataProperty').GeocoderMetaData;
        var administrativeAreaName = data.AddressDetails.Country.AdministrativeArea.AdministrativeAreaName; // region
        
        if ('SubAdministrativeArea' in data.AddressDetails.Country.AdministrativeArea) {
            var localityName = data.AddressDetails.Country.AdministrativeArea.SubAdministrativeArea.Locality.LocalityName; // city
        } else {
            var localityName = data.AddressDetails.Country.AdministrativeArea.Locality.LocalityName; // city
        }

    });

});

Why am I getting WebKitFormBoundary in my post request using the JS Fetch API?

I am trying to send data to my Django server from JS. My code looks like this?

    let url = play_selected.dataset.url;
    const csrf_token = getCookie('csrftoken');

    let data = JSON.stringify( { selects: arr } );
    console.log(data);
    const response = await fetch(url, {
      method: 'POST', // Specify the HTTP method
      body: data, // JSON.stringify(data), // Convert data to JSON string (if object)
      headers: {
        'Content-Type': 'application/json', // Set content type header
        'X-CSRFtoken': csrf_token
      }
    });
    data = await response.json();
    console.log(data);

The selects arr is just an array of numbers which I will eventually do something in my django back end. Currently all I am doing is printing out the request.POST variable which is always empty.

When I print out request.body I get the following:

    (Pdb) p request.POST
    <QueryDict: {}>
    (Pdb) p request.body
    b'{"selects":["29"]}'
    (Pdb) 

I would imagine that request.POST should display something similar to what is in request.body.

Why is request.POST empty?

Bug with clipboard.writeText() or am I missing something?

I am trying to paste into the Gmail Compose field where you input your email’s body, and all that. So, here is the issue: I want to paste parsedBody in, but for some reason, the lines.slice(2).join('n').trim(); is not being applied to the pasted text. However, what’s being logged to the console in console.log(parsedBody); has the slicing and joining applied.

So, is this a bug with the navigator.clipboard.writeText API, or am I making a mistake here?

const responseContainer = document.getElementById('generated-response');
if (responseContainer.value.length === 0 || generatingResponse) return;
const view = composeView.getBodyElement();
view.innerHTML = `<div>${responseContainer.value.replace(/n/g, '<br>')} ${view.innerHTML}</div>`;
mainView.close();
try {
    const fullEmail = responseContainer.value;
    const lines = fullEmail.split(/r?n|r/);
    const subjectPrefix = "Subject: ";
    let parsedSubject = "";
    if (lines[0].startsWith(subjectPrefix)) {
        parsedSubject = lines[0].substring(subjectPrefix.length);
    }
    composeView.setSubject(parsedSubject);
    const parsedBody = lines.slice(2).join('n').trim();
    console.log(parsedBody);
    await navigator.clipboard.writeText(parsedBody);
} catch (error) {
    console.log('Failed to copy to clipboard');
    console.log(error);
}

I tried pasting in the parsedBody, and logging it too. What’s being logged is completely different from the parasedBody being pasted.

Using .NET objects in XMLSpy Script Editor

I’m trying to import a Guid object into my XMLSpy script editor, as described in the manual CLR.Create. This is necessary in order to use the generated guid in an xml document, but before that it must be converted to a string.
There is a code

var objGuid = CLR.Create("System.Guid");
var guid = objGuid.NewGuid();
confirm(guid);

that generates a guid and can display it in a conform-form, but when I try to insert an “guid” with the “ReplaceText” command
tv.ReplaceText(416, 452, guid);
a type mismatch error appears
tmError
At the same time: an attempt to convert the variable “guid” to a string (guid.toString or guid.ToString()) ends with the error “guid.toString is null or is not an object”. Type of “guid” is unknown
nullError
The “objGuid” object is converted to a string, but such a guid consists entirely of zeros. Type of “objGuid” is object
zeroGuid

Is there any way that will allow me to convert this object to a string correctly?

Thanks!

I tried using a different method CLR.Static, but the result is the same.

Image URL instes of base64 in GrapesJS

Is there any option to insert image URLs into HTML instead of base64 images while creating HTML templates in GrapesJS? Below is a sample HTML created by GrapesJS for template design.

    <body id="iza8">
  <div class="gjs-row">
    <div class="gjs-cell">
    </div>
  </div>
  <div id="ivq2" class="gjs-row">
    <div class="gjs-cell">
    </div>
    <div class="gjs-cell">
    </div>
    <div class="gjs-cell">
    </div>
  </div>
  <img id="ic4q" src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAALIAAAAwCAYAAAC18iC7AAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAACHBJREFUeNrsXV1y2zYQXnnybmXa99AnCH0CUy95rXUCSyeQdQLJJ5B9AjEnMP3Yvog+geUThH7PTJgDtK7YWbQogp9dEKQkBzvDidVCIAF8++HbBUANXl9fIdpx2l9//EoptthdS0K5fHdNO3jM9e6aMMrnJ5++TgeDwQY/p7tri3+PdlcD2PnuupXbdxLh8ObtbnfVhHIN2JJ9g1hyphECtsC/myvbXeXu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2jjPjIWMsAKJpBB6ofK0fYlgoMaKOeOWUSMg3gxtg3EnFlDPvlMPXG9N61MOXzaePCFJu209ZxG1A5lH07s0TIFxNT2pniJGeE7hFkoUet9wXqNToHSwkeijCWH5rydiCoxg0qLvl+ZlcD/T4tQtXE0T9sB2QfEOnKhHn51xSG9aOSube2pjaP5gTgF/s8p5IYZkrMU3btW7grIcv5VJP+flKm6PGBJ8VZAzM0V24JLjlbOIMxPOOxdWlDe0MgJeKLxQOzzqlfKoVGOVi7Bnho9CmnhilynEcRHB+KDZuW+gVyB+Z0Y0cIY90Uq3BcMHqRWftdRvUv48QWCTcquiDjrlI19csUj4KVRawzSKUGkYOWy67bH3xA5YlN+Q4T6QkIVxL4Sj/rOuC3GQ0epkaP1axPgp9na/h4KNXWagt/pkwjkn8x89hWHWE3NGZJkEYEczQXijUf8EirYnhPLJV2z8ruIhaM37r6GkIFXAfRccacHVP8WYAAHOI1SI+CyyQAAAABJRU5ErkJggg=="/>
</body>

image src=” should be image URL instead of base64.

I am using below code for GrapeJs code

var editor = grapesjs.init({
   container: '#gjs',
    plugins: ['gjs-blocks-basic', 'grapesjs-plugin-forms'],
    pluginsOpts: {
    'grapesjs-plugin-forms': {/* Options */}
},
// Your configuration options
});

can you help resolve this issue?

I am writing code to get a list of patients and prescribe drug for any of the patient selected. I am using javascript for the code. I needed to fetch the data with fetch api and then loop them over the select html element. the fetch api works well, fetches the data but however, the map function only returns the last member in the list.

const getData = async(url) => {
  response = await fetch(url, {
    method: "GET",
  });
  return response;
};

function setPxt(data) {
  const pxtbox = document.querySelector(".pxt");

  const pxtselect = document.createElement("div");
  let pxt = {};
  const handleChange = (e) => {
    e.preventDefault();
    pxt = e.target.value;
  };
  const form = document.querySelector(".drugs");
  const legend = document.createElement("div");
  legend.innerHTML = `<p>Prescribe Drug for ${data.firstname}</p>`;
  form.append(legend);
  const selected = document.querySelector("input");
  selected.type = "text";
  selected.value = pxt.id;
  selected.name = "pxt_id";
  form.append(selected);
  data.map((pxt) => {
    pxtselect.innerHTML = ` 
    <select key =${pxt.id}> 
     <option value=${pxt.id}>${pxt.firstname}${pxt.lastname}</option>
    </select>
    `;
    pxtbox.append(pxtselect);
  });

}

function setData() {
  const url = "http://localhost:8000/patients/";
  getData(url)
    .then((response) => response.json())
    .then((data) => {
      console.log(data);
      if (data) {
        setPxt(data);
        console.log(data);
      } else if (!data) {
        const box = document.querySelector(".pxt");
        box.innerHTML = `<p>No Patients Data</p>`;
      }
    });
}

setData();

you will notice the select at the top part of the image with only one member of the list I fetched

Module Not Found Error while trying to run Hello World program in node.js

Tried executing myfirst.js program from the terminal (Directory/command mentioned below). I was expecting a run window or a browser popup.

Typed node myfirst.js in the terminal while being in the same directory. The error I get:

node:internal/modules/cjs/loader:1147
  throw err;
  ^

Error: Cannot find module 'C:Users{UserName}myfirst.js'
    at Module._resolveFilename (node:internal/modules/cjs/loader:1144:15)
    at Module._load (node:internal/modules/cjs/loader:985:27)
    at Function.executeUserEntryPoint [as runMain] (node:internal/modules/run_main:135:12)
    at node:internal/main/run_main_module:28:49 {
  code: 'MODULE_NOT_FOUND',
  requireStack: []
}
Node.js v20.11.1

Exact directorycommand: C:Users{UserName}>node myfirst.js

Path where node is installed: C:Program Filesnodejs

Path of file: C:Users{UserName}myfirst.js

Any help would be appreciated.

Substring issue when combined with map or reduce. Am I doing something wrong?

According to spec, when a second argument is omitted, substring should return n characters from the end of the string.

If embedded in an array map or reduce, substring with a single argument seems to do nothing.

I have tried the following in both nodejs and in the browser console (firefox), however get “incorrect” output:

let a = [["g9qleb3ycfzs2rgrqebjtqol",1],["amjjvjvz3d7hvl7eu9k9alfj",1]]

let b = a.reduce((p,[x, y]) => [ ...p, [ x.substring(1), y ] ],[])
let c = a.map(([x, y]) => [ x.substring(1), y ]);

// Expected: [["l",1],["j",1]]
// Received: [["g9qleb3ycfzs2rgrqebjtqol",1],["amjjvjvz3d7hvl7eu9k9alfj",1]]
console.log(b) 

// Expected: [["l",1],["j",1]]
// Received: [["g9qleb3ycfzs2rgrqebjtqol",1],["amjjvjvz3d7hvl7eu9k9alfj",1]]
console.log(c) // should return: [["l",1],["j",1]]

When I use two arguments for the substring method (e.g. to return first value of string), it works as expected:

let a = [["g9qleb3ycfzs2rgrqebjtqol",1],["amjjvjvz3d7hvl7eu9k9alfj",1]]

let b = a.reduce((p,[x, y]) => [ ...p, [ x.substring(0,1), y ] ],[])
let c = a.map(([x, y]) => [ x.substring(0,1), y ]);

// Expected: [["g",1],["a",1]]
// Received: [["g",1],["a",1]]
console.log(b) 

// Expected: [["g",1],["a",1]]
// Received: [["g",1],["a",1]]
console.log(c) // should return: [["l",1],["j",1]]

Does anyone have any insight to this?

I have a problem with implementing Video call with WebRTC peer connection

import {
    mediaDevices,
    RTCPeerConnection,
    RTCView,
    RTCIceCandidate,
    RTCSessionDescription,
    MediaStream,
} from 'react-native-webrtc';

import styles from './callPageStyle';
import { useEffect, useState, useRef } from "react";

const CallPage = ({ route, navigation }) => {

// const navigation = useNavigation();
const userData = useSelector((state) => state.userData);
const dispatch = useDispatch();

const { callerId, calleeId, calleeName, isVideo, isCreator } = route.params;

const [localStream, setLocalStream] = useState(null);
const [remoteStream, setRemoteStream] = useState(null);
const [callStarted, setCallStarted] = useState(false);
const peerConnectionRef = useRef(null);
const remoteRTCMessage = useRef(null);

useEffect(() => {
    const recipientID = isCreator ? calleeId : callerId;
    webSocketService.registerSendCallMessageCallback(recipientID, onNewCall);
    webSocketService.registerAnswerCallMessageCallback(recipientID, onCallAnswered);
    webSocketService.registerICECandidateMessageCallback(recipientID, onICEcandidate);

    const initLocalStream = async () => {
        const stream = await mediaDevices.getUserMedia({ audio: true, video: true });
        setLocalStream(stream);
    };

    const delayProcessCall = setTimeout(() => {
        if (!isCreator) {
            startCall();
        } else {
            initLocalStream();
        }
    }, 2000);

    return () => {
        clearTimeout(delayProcessCall);

        if (localStream) {
            localStream.getTracks().forEach((track) => track.stop());
        }
    };
}, []);


const createPeerConnection = async () => {
    const configuration = {
      iceServers: [
        { urls: 'stun:stun.l.google.com:19302' },
        { urls: 'stun:stun1.l.google.com:19302' },
        { urls: 'stun:stun2.l.google.com:19302' },
      ],
    };
    const peerConnection = new RTCPeerConnection(configuration);
  
    // Use a promise to wait for getUserMedia to complete
    const stream = await mediaDevices.getUserMedia({ audio: true, video: true });
    stream.getTracks().forEach((track) => peerConnection.addTrack(track, stream));
    setLocalStream(stream);
  
    return new Promise((resolve) => {
        peerConnection.onicecandidate = (event) => {
            if (event.candidate) {
            webSocketService.sendICECandidateToPeerServer(userData.id, isCreator ? calleeId : callerId, {
                calleeId: isCreator ? calleeId : callerId,
                rtcMessage: {
                label: event.candidate.sdpMLineIndex,
                id: event.candidate.sdpMid,
                candidate: event.candidate.candidate,
                },
            });
            } else {
                console.log("End of candidates.");
            }
        };
    
        peerConnection.ontrack = (event) => {
            setRemoteStream(event.streams[0]);
        };
    
        peerConnectionRef.current = peerConnection;
        resolve();
    });
};

const startCall = async () => {    
    try {
        console.log("=========sendNewCallToPeerServer===========");
        await createPeerConnection();

        const offer = await peerConnectionRef.current.createOffer();
        await peerConnectionRef.current.setLocalDescription(offer);

        webSocketService.sendNewCallToPeerServer(userData.id, isCreator ? calleeId : callerId, {
            calleeId: isCreator ? calleeId : callerId,
            rtcMessage: offer,
        });

        console.log("=========sendNewCallToPeerServer===========");
    } catch (error) {
      console.error('Error creating offer:', error);
    }
};

const handleAnswer = async () => {    
    try {
        const answer = await peerConnectionRef.current.createAnswer();
        await peerConnectionRef.current.setLocalDescription(answer);

        webSocketService.sendAnswerCallToPeerServer(userData.id, isCreator ? calleeId : callerId, {
            calleeId: isCreator ? calleeId : callerId,
            rtcMessage: answer,
        });

        setCallStarted(true);
    } catch (error) {
        console.error('Error creating answer:', error);
    }
};

const onNewCall = async (payload) => {
    console.log("On New Call !!!");
    const bigData = JSON.parse(payload.body);
    const data = JSON.parse(bigData.data);

    remoteRTCMessage.current = data.rtcMessage;

    await createPeerConnection();
    peerConnectionRef.current.setRemoteDescription(
        new RTCSessionDescription(remoteRTCMessage.current)
    );

    handleAnswer();
};

const onCallAnswered = (payload) => {
    console.log("onCallAnswered !!!");
    const bigData = JSON.parse(payload.body);
    const data = JSON.parse(bigData.data);
    
    remoteRTCMessage.current = data.rtcMessage;
    peerConnectionRef.current.setRemoteDescription(
        new RTCSessionDescription(remoteRTCMessage.current)
    );

    setCallStarted(true);
};

const onICEcandidate = (payload) => {
    console.log("onICEcandidate !!!");
    const bigData = JSON.parse(payload.body);
    const data = JSON.parse(bigData.data);

    let message = data.rtcMessage;

    if (peerConnectionRef.current) {
        peerConnectionRef.current
        .addIceCandidate(new RTCIceCandidate({candidate: message.candidate, sdpMLineIndex: message.label, sdpMid: message.id}))
        .then((data) => {
            console.log("SUCCESS");
        })
        .catch((err) => {
            console.log("Error", err);
        });
    }
};

This is my source code implementing video call feature in react-native expo app.

I am currently using libraries for react-native-webrtc below.
“@config-plugins/react-native-webrtc”: “^7.0.0”,
“react-native-webrtc”: “^111.0.3”,

I am using Android emulator like this:
API level 34
image: system-images/android-34/google_apis/x86_x64

All the logic for getting connection between peers is working well. But have problems with video streaming.
Help me with correcting the source code or giving any advice.
Thanks.

Side by side editing of richtext content in a webapp with quilljs or slatejs

I’d like to create a tool for my users on my website where they can annotate rich text in a splitscreen fashion:
Left is the rich text, loaded before hand that stays untouched.
Right is the annotation on the text ( image, comment).
Both panel are obviously synced when user scrolls down.

The idea and implementation seems like something that would be available out of the box in a wysiwyg (What you see is what you get) javascript library.

I’m trying to fiddle with the quilljs or slatejs libraries to have the desired result, but they seems to require extensive coding and customization.

I’m prepared to build this, but I have the feeling I’m not the first to do this kind of tool. This feels much too complicated for a obviously useful functionality.

Is there some open source javascript library, plug-in with this parallel editing feature or Am I thinking about this the wrong way ?

How does web browser run “.jsx” file during development?

I’m new to react “.jsx” files, I can now run the dev and build test.

I have a question about how browser runs “.js” files. If the project is build, then the browser is running “.js” file, which I understand because browser can run “.js” file.

but during dev, when I check the app source in browser’s dev mode, it shows that in the html file, there is a “.jsx” file!

enter image description here

So how is it possible? can a browser run “.jsx” file? or during dev mode, the dev server (like npm or vite) is doing something secret? the browser shows source code as “.jsx” but actually it’s running other files (hidden by npm or vite)?

How to use forEach method in Javascript?

what should I write inside this function?

array.forEach(function(item){
})

be able to use array in javascript

I have an array and it doesnt function properly, looking to find a solution to this problem.
Suggest something to put in the brackets pls