Is there a way to extract HTML, CSS and JS code from pages designed by Elementor or any other page builder like Elementor that generates raw code?

I have designed a site in WordPress using Elementor. Now I want to export HTML, CSS and JS code from the pages I have designed. Is there a way to do that? Or is there any other page builder like Elementor that I can use outside WordPress which can generate raw HTML, CSS and JS code for me?

Thanks in advance…

Making a Dynamic callable typescript interface property

This is the part of palette, i am using a IPalette interface right here:

{
  criticalColor: '#EF5350',
  warningColor: '#FFCA28',
  grayColorAlpha: (opacity: number) => `rgba(200, 209, 232, ${opacity})`,
  criticalColorAlpha: (opacity: number) => `rgba(239, 83, 80, ${opacity})`,
}

And the problem is that I want to create an interface with dynamic properties, both for keys as a string, and if the key is callable as well. This is what I can do, but it looks not so well, looking for a way to avoid repeating logic:

export type alphaColorProcessing = (opacity: number) => string | string[];

export interface IPalette {
  [key: string]: string | string[] | alphaColorProcessing;
  grayColorAlpha: alphaColorProcessing;
  criticalColorAlpha: alphaColorProcessing;
}

How do I apply decorators on specific files in Visual Studio

I am creating a Visual Studio extension. I want to Highlight Few lines in a file I am showing in VS code. But I am not able to apply decorators on the required file. I want to apply decorator on a file which is shown in viewColumn: vscode.ViewColumn.Beside. But I am not able to get this file in the response of vscode.window.visibleTextEditors. Please help me to apply decortors on specific file

How to change iframe src when a button is pressed

I tried to change src of an iframe, to change trailers, but after trying to utilize the answer of a different post: iframe src change on button click but I still couldn’t get it to work

function newSrc() {
  var e = document.getElementById("Menu_trailers");
  var newSrc = e.options[e.selectedIndex].value;
  document.getElementById("trailer").src=newSrc;
}
      <figure class="trailer">
        <iframe src="https://www.youtube.com/embed/sfAc2U20uyg" id="trailer"> </iframe>
      </figure>
      <section class="button_trailer">
        <select id="Menu_trailers">
          <option value="https://www.youtube.com/embed/sfAc2U20uyg">Trailer 1</option>
          <option value="https://www.youtube.com/embed/o-L1mMZ31hM">Trailer 2</option>
        </select>
        <button onclick="newSrc();" class="button_next_trailer">Change trailer</button>
      </section>

Update nested JSONB in postgresql using sequelize

Hey guys please am new to sequelize with postgresql, am using NodeJS to update a nested info in the database but i can’t seem to figure this out

UpdateFacts: async function (req, res, next) {
    const {text} = req.body
    const {id} = req.params

    if(!id){
      return res.status(400).send({message:'please provide id'})
    }

    if(!Object.keys(req.body).length){
      return res.status(400).send({message:'please provide text'})
    }

    const checkIfFactExist = await Facts.findOne({
      where: {
        id
      }
    })

    if(!checkIfFactExist){
      return res.status(404).send({message:'this id does not exist'})
    }

    try {
      if(text){
        checkIfFactExist.data.text = text
      }

      checkIfFactExist.save()
      return res.status(200).send({message:'updated'})
    } catch (error) {
      return res.status(500).send(error.message)
    }

data is the column and text is the field am trying to change but its not working please any fix on this?

Three.js skinning issue from OpenAssetImport-converted model

I’ve been trying to understand the maths behind Three.JS’s skinning and I’ve been stuck there for a while.

My use case is loading “any” 3D model that is passed through OpenAssetImport and saved in a custom model format (mostly built for a custom native render, but it’s just a representation of assimp’s data structures).

In this model format I track:

  • Meshes (obviously)
  • Nodes (as in the ‘assimp’ definition of nodes)
  • Bones

For each bone, I track:

  • The node which it is attached to
  • The individual ‘bind matrix’ as defined by assimp

I’m then struggling to re-construct the skeleton in Three.JS. My attempt is this:

  • Generate all the ‘nodes’ (as in, ‘assimp’ nodes) as simple THREE.Object3D
  • Attach the meshes when required
  • For each bone
    • Find the node (THREE.Object3D) it’s attached to
    • Create a new THREE.Bone
    • Apply assimp’s ‘bind matrix’ to the ThreeJS bone with bone.applyMatrix(assimpBone.bindMatrix)
    • Set the THREE.Bone as a child of the THREE.Object3D
  • Create a THREE.Skeleton with the array of THREE.Bone objects
  • Attach it to the mesh with ‘attached’ bind mode

However, for some models this works, while for others I have big errors with meshes being de-formed (even if the base mesh is still at least recognizable).

Example mesh loaded with skinning disabled:

no-skinning horse

Same mesh loaded with skinning enabled:

skinned horse

is there a way to compile a JavaScript string, store and use variables from the compiled string?

I am trying to build an HTML preprocessor that would help me out with my electron project. I have looked at other preprocessors and none meets my expectations so I decided to create mine. Here is an example of the code format or syntax.

{{@import Button from './components/Out'}}

{{@Component {
    name: 'Button',
    useStrict: true,
    props: {
        name: '',
        className: '',
        values: ''
    }
}}}
    {{@include './index', {
        name: props.name
    }}}
    <button class={{props.className}}>{{{name}}}</button>

    {{@if (avatar !== null || avatar !== undefined) }}
        <li class={{`${props.name}`}}>
            this is a test {{avatar}}
        </li>

        {{@each field in values}}
            <span class="d-flex">
                {{field.name}}
                <small>
                     power level: <b>{{field.power}}</b>
                </small>
            </span>
        {{/each}}
    {{/if}}

    <Button name="" text="" value="" href=""/>


{{/Component}}

//---- the problem is below; compiling the code and storing the values of each global variable
<@
    let avatar = 'My avatar is on the run';

    const values = [{name: 'Batman', power: '200kilowatts'}, {name: 'Spiderman', power: '60watts'}];

    const func = () => {
        let name = 'David';
        script = name;
    }
@>

I have parsed the entire file or code, and everything works fine but compiling that script.

NB: I used Esprima to extract the script’s global variables.

First, I thought of using the window object to compile the script, that way, I can get each variable’s value by calling window[variableName] I am using node js so I imported Jsdom but unfortunately it didn’t work, window[variableName] kept returning undefined.

Then I thought of eval, but that also brought up issues because I can’t make use of the variables in eval, so I thought of dynamically creating those variables first or saving them in the global object, but it certainly won’t work, at least as far as I know.

Sorry for the long description.. the summary is, that I need to be able to get each variable’s value after the string has been compiled. I have tried finding js-engines or js-compilers that can be installed with npm but not much luck with that. Also just in case, someone says they found a similar preprocessor, please, I have done my research and there isn’t any similar. I placed a lot of functionality to this preprocessor and it’s an important component for my electron project… So any help is perfect…. thank you for your time.

How to disable click event on video element in youtube

I am currently working on a chrome extention for youtube and I want to disable the option for the user to pause/play the video by clicking on it.

I saw some posts that say “video.off(‘click’);” but it dosent work.

I tried this one also :

video.addEventListener('click', function(event){
    console.log("preventing?")
    event.preventDefault();
});

but still it doesn’t do nothing.

I would love some help if possible – Thank you all in advance!

here is the video element of youtube

Accessibility: How can I set the position of the cursor in the input when navigating arrow keys?

I have developed an arrow-keys navigation within a table. Navigation is possible with arrow keys up, down, left and right. How can the cursor always be set to the right in the input during navigation?

My Stackblitz: https://stackblitz.com/edit/stackoverflow-72056135-ube6hj?file=app%2Ftable-basic-example.ts

My code:

// HTML

 <input class="edit-input || focus-cell" type="text"[formControl]="rowControl.get(column.attribute)" appArrowKeyNav>

// TS

/**
   * Use arrowKeys
   * @param object any
   */
  move(object) {
    const inputToArray = this.inputs.toArray();
    let index = inputToArray.findIndex((x) => x.element === object.element);
    switch (object.action) {
      case 'UP':
        index -= this.columns.length;
        break;
      case 'DOWN':
        index += this.columns.length;
        break;
      case 'LEFT':
        index--;
        break;
      case 'RIGTH':
        index++;
        break;
    }

    if (index >= 0 && index < this.inputs.length) {
      inputToArray[index].element.nativeElement.focus();
    }
  }

How to structure my Firestore collections and documents

I’m working in React Native with JavaScript where i use Firebase v9.
So far i have a flatList which contains different category-items and the user can click on each category and then add tasks that belongs to that category and also see the tasks in that category in a flatList.
But i can’t figure it out how to store those tasks in Firestore after spending a couple of days….. so i have added some dummy field in Firestore manually to show what i want to do:
enter image description here

So in category ”cleaning” i want to add the tasks ”cleaning windows” and ”vacuum” for example.
So far i can only add the categories, which is done by this way:

const addToFirebase = async() => {
    if(dataFetch) {
      await setDoc(doc(db, "users", `${firebase.auth().currentUser.uid}`), {
        categories: categories || undefined
      }, {merge: true});
    }
  };

Is this just bad Firestore structur or does anyone have a solution for this?

TypeError: Cannot read properties of undefined (reading ‘member’)

Can someone help me figure out this error? I really dont know what to do. I tried my best to get rid of this error, but nothing worked. I will be very grateful if you try to help me.

const Command = require("../Structures/Command.js");

/**
 * @param {Client} client
 * @param {Message} message
 * @param {String[]} args 
 */

module.exports = new Command({
    name: "userinfo",
    description: 'info',

    async run(client, message, args) {
        const user = message.mentions.member.first() || message.member.user.username;
        const member = message.guild.members.cache.get(user.id);

        const embed = new MessageEmbed()
            .setColor('DARK_RED')
            .setAuthor({ name: user.username, iconURL: user.avatarURL({ dynamic: true }) })
            .setDescription("Kdo to je")
            .setThumbnail(user.displayAvatarURL({ dynamic: true }))
            .addFields(
            { name: "Username", value: user.username, inline: true }, 
            { name: "Tag", value: user.discriminator, inline: true }, 
            { name: "Bot", value: user.bot, inline: true }, 
            { name: "Nickname", value: member.nickname || "None", inline: true },
            { name: "Joined:", value: new Date(member.joinedTimestamp()).toDateString(), inline: true },
            { name: "Discord user since:", value: new Date(user.createdTimestamp()).toDateString(), inline: true },
            { name: "Roles count:", value: member.roles.cache - 1, inline: true },

            )

        return message.channel.send({ embeds:  });
    }

})

Decision for a button by input value in cypress

I have the following code, which is responsible for the state of a checkbox slider (on/off).

When the button is on:

      <div _ngcontent-ofr-c662="" class="pull-right switch switch-small">
       <div _ngcontent-ofr-c662="" class="col-auto"><label _ngcontent-ofr-c662="" class="o-switch">
<input _ngcontent-ofr-c662="" type="checkbox" ng-reflect-model="true" ng-reflect-is-disabled="false" ng-reflect-options="[object Object]" class="ng-untouched ng-valid ng-dirty"><span _ngcontent-ofr-c662="" data-off="No" data-on="Yes" class="switch__obj"></span></label></div>
       <label _ngcontent-ofr-c662="" for="chkAllowCancelOrReschedule"></label>
    </div>

And when the button is off:

 <div _ngcontent-ofr-c662="" class="pull-right switch switch-small">
       <div _ngcontent-ofr-c662="" class="col-auto"><label _ngcontent-ofr-c662="" class="o-switch">
<input _ngcontent-ofr-c662="" type="checkbox" ng-reflect-model="false" ng-reflect-is-disabled="false" ng-reflect-options="[object Object]" class="ng-untouched ng-valid ng-dirty"><span _ngcontent-ofr-c662="" data-off="No" data-on="Yes" class="switch__obj"></span></label></div>
       <label _ngcontent-ofr-c662="" for="chkAllowCancelOrReschedule"></label>
    </div>

The only state that changes is that of the variable ng-reflect-model

How can I check this status and if it is true, press that button, and if it is off nothing happens and the test continues?

I hope I put all the details and didn’t miss something.

Thank you.