PDF Editor to replace certain Elements (SAP / JavaScript)

I got the task to create an SAP UI5 Fiori application where you can upload a pdf file and where the application automatically blacks out personal information like the name or the phone number. Or if this is not working, at least black it out by yourself through an editor function. Therefore i need to be able to have access to the text from the pdf file.

I tried to solve this via base64 encoding and i was hoping that i can simply replace the base64 string of for example “John Smith” with the encoded string of “****”. But these strings are not found in the pdf or img encoded base64 string. I could extract the text from the pdf file and replace it there but the task says that the layout and design of the given pdf file should stay the same.

So since the base64 attempt doesnt seem to work i need to build my own pdf editor. The given PDF viewer of SAP lets me view the pdf but not edit it in any way. The same seems to be the case for pdf.js since there are no tutorials on how to build an actual editor with it.

The only tutorials that i could find were some short explanations about the code, but the code itselfs lies behind a $100 paywall..

So what would be the best way to solve this task and build pdf editor?

If things are unclear or need further explanation, let me know!

Updating nested cache in Apollo GraphQL

I am fetching a list of documents from the backend using this query:

gql`
  query GetUserDocuments($userId: Int!, $filters: DocumentFilter) {
    user(userId: $userId) {
      id
      documents(filters: $filters) {
        id
        name
      }
    }
  }
`;

The following object is saved in the Apollo cache

User:{"userId":123}

which has 2 nested collections defined inside

documents({"filter":{"archived": false}})
documents({"filter":{"archived": true}})

the apollo cache looks something like this

User:{"userId":123} {
  __typename: "User",
  userId: 123,
  documents({"filter":{"archived": false}}): []
  documents({"filter":{"archived": true}}): []
}

On the frontend, I would like to handle this cache so that when I archive a given document, I remove it from the collection documents({"filter":{"archived": false}}) and I want to put it in the collection documents({"filter":{"archived": true}}). Similarly, when I unarchive a document, I remove it from the archived list and add it to the unarchived list. Is it possible to do this using a cache update? Or do I have to refetch the data, which I would like to avoid?

I tried using cache.modify, however I am getting 2 collections at the same time:

cache.modify({
  id: cache.identify({ __typename: "User", userId }),
  fields: {
    documents: (documents) => {
      return documents;
    },
  },
});

Open rowContextMenu with Button click on Tabulator Table

I want to have a button at the end of my Table where i can Click and open the rowContextMenu below the Button.

But i also want it to pop up when I rightclick anywhere on the row.

I already tried a few things

var menuButtonFormatter = (cell: any) => {
var menuBtn = document.createElement('button');
          menuBtn.type = 'button';
          menuBtn.innerHTML = '<span class="material-icons" style="color: #707070">more_horiz</span>';
          menuBtn.classList.add('menu-button');
          menuBtn.addEventListener('click', (event) => {
            event.stopImmediatePropagation();
            const myEvent: any = new Event('row-contextmenu');
            myEvent.pageX = event.pageX;
            myEvent.pageY = event.pageY;
            cell.getRow().getElement().dispatchEvent(myEvent);
          });

buttonHolder.appendChild(menuBtn);
          return buttonHolder;

        }

This is the Button

And my Column looks like this:

{
        title: this.$t('actions'),
        field: 'actions',
        // formatterParams: poParams,
        formatter:menuButtonFormatter,
        headerSort: false,
        width: 110,
        frozen: true,
}

I tried many different Things but nothing would work.

I also tried const myEvent: any = new Event('contextmenu'); as the button Event but it also did nothing. Also nothing showed up in the Console

Select the Enum dynamically

I have three enums Country_INDIA, Country_USA,Country_AUSTRALIA. At runtime, the country name is decided (could be one of INDIA or USA or AUSTRALIA). Is there a way I can pick the right enum based on the country name at runtime. For example, if the country name is USA , I want to pick Country_USA enum.

enum Country_INDIA {

  INTREST_RATE = '10%',
  MIN_INVESTMENT_DURATION = "5YRS"

};

enum Country_USA {

  INTREST_RATE = '3%',
  MIN_INVESTMENT_DURATION = "3YRS"
};

enum Country_AUSTRALIA {

  INTREST_RATE = '5%',
  MIN_INVESTMENT_DURATION = "2YRS"
};

let country_enum = "Country_"+"USA" 

console.log(country_enum.INTREST_RATE); // get the interst rate from 'Country_USA' enum

How to make SwiperJs vertical mode, swipes BTT (from Bottom to Top)?

I’m using swiperJs on a React project to to escalate from a number to another. but the number is always raising up (like a stats of total gaining). So I wanna make it scroll/swipe from bottom to top but it works upside down.

they have a prop there: ‘rtl’, which is the solution but for the horizontal swiper.
https://swiperjs.com/demos#rtl
is there any props like this or another way to change the direction of the swiper vertically?
the red arrow is the current behavior , the green arrow is the wanted behavior

How to make the score display the highest at the top [closed]

I want to sort the score from high to low. what code do I need to add? I’m just starting to learn about JavaScript and I got this source from others

//Renders high scores stored in local storage
function renderHighScores() {
    // Clear content
    scoresEl.innerHTML = "";
    show(highScoresEl);
    highScores = JSON.parse(localStorage.getItem("scores"));
    for (let i = 0; i < highScores.length; i++) {
        let scoreItem = document.createElement("div");
        scoreItem.className += "row mb-3 p-2";
        console.log(scoreItem)
        scoreItem.setAttribute("style", "background-color:#fdf8f8;");
        scoreItem.textContent = `${(i + 1)}. ${highScores[i].username} - ${highScores[i].userScore}`;
        scoresEl.appendChild(scoreItem);
    }
}

Can someone help me to figure out how to solve this?

js net::ERR_ABORTED 404 (Not Found)

I use Allure report in Azure DevOps, and hosted this report in Azure Storage Account. I want share this report in my confluence page. For implement this i use macro “HTML include”. But when i try to share my allure report i have error “js net::ERR_ABORTED 404 (Not Found)”

My structure in azure storage account like this:
enter image description here

My index.html like this:

<!DOCTYPE html>
<html dir="ltr">
<head>
    <meta charset="utf-8">
    <title>Allure Report</title>
    <link rel="favicon" href="favicon.ico?v=2">
    <link rel="stylesheet" type="text/css" href="styles.css">
        <link rel="stylesheet" href="plugins/screen-diff/styles.css">
</head>
<body>
<div id="alert"></div>
<div id="content">
    <span class="spinner">
        <span class="spinner__circle"></span>
    </span>
</div>
<div id="popup"></div>
<script src="app.js"></script>
    <script src="plugins/behaviors/index.js"></script>
    <script src="plugins/packages/index.js"></script>
    <script src="plugins/screen-diff/index.js"></script>
</body>
</html>

I investigated my issue, and if i added an absolute path to “script src” for example “<script src=”https://”<my_allure_report_url>”/$web/$(Build.BuildNumber)/app.js”>”
I have other errors something like this:
https://”<confluence___url>”/pages/widgets/executors.json 404 (Not Found)” etc.
enter image description here

First off all i dont understand why if i try use HTML include confluence rewrite path to this file ?
Furthermore what i need to do for resolve my problem with share allure report to confluence page ? Maybe i need modify index.html, or configure Azure CND, or install some custom plagin to confluence server ?

Any ideas ? Please helm me.

P.S. I need to use Azure storage account for my static allure report. Because only in storage account i can store a lot of report. If i right understand in azure storage static web site i cant configure web.config and use it. In Allure documentation they recommended use this solution:

“Please note If you use Azure Website or IIS in general some file types used by Allure are not enabled by default. Please, add mimetypes as shown below to your web.config in order to enable support of .json and .woff file types.”

<configuration>
    <system.webServer>
        <staticContent>
            <mimeMap fileExtension=".json" mimeType="application/json" />
            <mimeMap fileExtension=".woff" mimeType="application/x-font-woff" />
     </staticContent>
    </system.webServer>
</configuration> 

But it not work for Azure storage account. It work only for Azure web app.

How to make the scroll bar show how much you scrolled for the whole page

I have some code. It only shows how much you scrolled in the navbar, not how much you scrolled in the actual webpage.

I think its the problem with the javascript code. When I tried changing it to document instead of nav, errors came on the console.

const nav = document.querySelector('nav');
    const progress = () => {
        let scroll = nav.scrollTop;
        let height = nav.scrollHeight - nav.clientHeight;
        let scrollProgress = (scroll / height) * 100;
        document.getElementById("scroll-progress").style.width = scrollProgress + "%";
    }

    nav.addEventListener('scroll', progress);
 nav {
        justify-content: center;
        width: 100%;
        font-weight: 900;
        color: white;
        background-color: black;
        z-index: 50;
        height: 100px;
        overflow: auto;
    }

    .nav-items {
        display: flex;
        justify-content: center;
        align-items: center;
    }

    .nav-sec, .section-navigate {
        display: flex;
        padding: 0px;
        list-style-type: none;
        justify-content: center;
        align-items: center;
        margin: 0px;
    }

    .navigate {
        cursor: pointer;
    }

    .section-navigate {
        display: flex;
        justify-content: center;
        align-items: center;
        margin: 0px;
        flex-wrap: wrap;
    }

    .link {
        width: 300px;
        height: 60px;
        display: flex;
        justify-content: center;
        align-items: center;
        cursor: pointer;
    }

    .scroll {
        width: 100%;
        height: 4px;
        background-color: lightgray;
    }

    #scroll-progress {
        width: 0%;
        height: 4px;
        background-color: green;
    }
Hello, I have edited your code to make it so it will show the scroll of the navigation bar. If you need anything, please ask me. DONT FORGET TO MARK THIS ANSWER CORRECT!



    <header>
            <section class="close">
                <div class="sec-contain">
                    <h1 class="sec-head">
                        FIRST THINGS FIRST
                    </h1>
                    <p class="sec-text">
                        Lorem ipsum 
                    </p>
                    <p class="sec-text">
                        Vivamus dictum aliquam posuere. 
                    </p>
                    <p class="sec-text">
                        Vestibulum iaculis ligula 
                    </p>
                </div>
            </section>
        </header>
        <nav class="nav" id="navigation">
                <div class="nav-items">
                    <ul class="nav-sec">
                        <li class="current-sec">
                            <p class="current" id="text">
                               First Thing's First 
                            </p>
                        </li>
                        <li class="navigate">
                            <ul id="btn" class="nav-list">Take Me To</ul>
                        </li>
                    </ul>
                </div>
                <div class="modal" id="jump-links">
                    <div class="close" id="close-btn">&times;</div>
                    <ul class="section-navigate">
                        <li class="link close"><a href="#one">First Things Second</a></li>
                        <li class="link close"><a href="#two">First Second Third Things Third</a></li>
                        <li class="link close"><a href="#three">Seven</a></li>
                        <li class="link close"><a href="#four">Last Things First</a></li>
                    </ul>
                </div>
                
            </nav>
            <div class="scroll">
                    <div class="scroll-bar" id="scroll-progress"></div>
                </div>
        <main>
            <div class="anchor" id="one"></div>
            <section class="close" id="one-txt">
                <div class="sec-contain">
                    <h1 class="sec-head">
                        FIRST THINGS SECOND
                    </h1>
                    <p class="sec-text">
                        Lorem ipsum dolor sit amet
                    </p>
                    <p class="sec-text">
                        Lorem ipsum dolor si
                    </p>
                </div>
                <div class="anchor" id="two"></div>
            </section>
            <section class="close">
                <div class="sec-contain">
                    <h1 class="sec-head">
                        FIRST SECOND THIRD THINGS THIRD
                    </h1>
                    <p class="sec-text">
                        Lorem ipsum dolor sit amet,
                    </p>
                    <p class="sec-text">
                        Ut imperdiet tortor eget
                    </p>
                    <p class="sec-text">
                        Donec finibus augue
                    </p>
                    <p class="sec-text">
                        Donec in suscipit 
                    </p>
                </div>
                <div class="anchor" id="three"></div>
            </section>
            <section class="close">
                <div class="sec-contain">
                    <h1 class="sec-head">
                        SEVEN
                    </h1>
                    <p class="sec-text">
                        sevensevensevensevensevensevenseven
                    </p>
                </div>
                <div class="anchor" id="four"></div>
            </section>
            <section class="close">
                <div class="sec-contain">
                    <h1 class="sec-head">
                        LAST THINGS FIRST
                    </h1>
                    <p class="sec-text">
                        Lorem ipsum dolor sit amet
                    </p>
                    <p class="sec-text">
                        Duis sed felis ac iis feugiat elit. Duis tempus feugiat risus ut placerat. Cras sit amet ligula urna.
                    </p>
                    <p class="sec-text">
                        Cras eu mattis odio. 
                    </p>
                    <p class="sec-text">
                        Ut cursus sit 
                    </p>
                </div>
            </section>
        </main>
        <section id="end-stick" class="close">
            <div class="sec-contain">
                <h1 class="sec-head">
                    SECOND THINGS LAST
                </h1>
                <p class="sec-text">
                    Lorem ipsum dolor sit amet,
                </p>
                <p class="sec-text">
                    Class aptent taciti socios
                </p>
                <p class="sec-text">
                    Praesent nec sollicitudin nibh
                </p>
            </div>
        </section>

Please help me fix the problem. THE QUICK BROWN FOX JUMPED OVER THE LAZY DOG . IM DOING THIS BECAUSE STACKOVERFLOW SAID THAT MY POST IS MOSTLY CODE AND I SHOULD ADD SOME DETAILS LOL

Check isValidDate in JavaScript

I’m currently using a JavaScript function to check if a given string represents a valid date. However, I’ve encountered a problem where certain non-date strings, like “SA-0001” or simple numbers inside strings like “1”, are erroneously being identified as valid dates.

function isValidDate(val) {
    if (typeof val === 'number') {
        return false;
    }
    const str = new Date(val);
    if (str != 'Invalid Date') {
        return true;
    } else {
        return false;
    }
}

In the incoming string, the format for valid date string varies and is not fixed, such as ‘yyyy-mm-dd’, and I aim to avoid restricting the backend to a specific format. How can I accurately determine if a given value represents a valid date without imposing a fixed format constraint?

Ex.

  • Input: ‘1999-01-01’ Expected result: true
  • Input: ’01-01-1999′ Expected result: true
  • Input: ’01-1999-01′ Expected result: true
  • Input: ‘Fri Mar 15 2024 18:19:30’ Expected result: true
  • Input: ’01-01′ Expected result: false
  • Input: ’01’ Expected result: false
  • Input: ‘sa-0001’ Expected result: false

How do I append an input element with an attribute of checkbox?

I am new to JavaScript and attempting to create a to-do list. How can I append an input with a checkbox attribute to my code so that paragraphs can be checked off once completed?

Here is my code below:

// ! DOM ELEMENTS

const taskInput = document.getElementById('taskInput');
const taskList = document.getElementById('taskList');


// ! ADD TASK

function addTask() {
  if (taskInput.value === '') {
    alert('Oh no... You have not written anything?');
  } else {
    let paragraph = document.createElement('p');
    paragraph.textContent = taskInput.value;
    taskList.appendChild(paragraph);
    saveTasks();
  }

  taskInput.value = '';
}
<div class="container">
  <h1>TO DO LIST</h1>

  <input type="text" id="taskInput" placeholder="ENTER TASK HERE!">

  <button id="addButton" click="addTask()">ADD</button>

  <div id="taskList">
  </div>

  <p> lorem 10</p>

</div>

Webpack unable to load FontAwesome Kit (6.x) via NPM into JS of App?

I have an app in which I’m trying to load some JS into their own .js files (i.e. bootstrap will be loaded via bootstrap.hash.js, fontawesome will be fontawesome.hash.js)

I’m using webpack to do this – but am struggling with fontawesome and their kits specifically (I have a pro subscription). I can load fontawesome via CSS/Fonts no problem – but wanted to use some of the other features available only to JS+SVGs (like layering and masking).

I can load fontawesome pro, it works great. Locally I can have webpack load up the all.min.js and it puts it in the fontawesome.hash.js for me – but I need to do that with the kit as it has custom icons that I have added.

This is an example of a working webpack.config.js that loads fontawesome into it’s own .js file and puts it in my template:

const autoprefixer = require("autoprefixer");
const {CleanWebpackPlugin} = require("clean-webpack-plugin");
const MiniCssExtractPlugin = require("mini-css-extract-plugin");
const HtmlWebPackPlugin = require("html-webpack-plugin");
const path = require("path");
const CssMinimizerPlugin = require("css-minimizer-webpack-plugin");
const TerserPlugin = require("terser-webpack-plugin");
//const BundleAnalyzerPlugin = require('webpack-bundle-analyzer').BundleAnalyzerPlugin;

module.exports = {
    mode: "production",
    entry: {
        vendor: "./static/myapp/src/js/vendor.js",
        fontawesome: "@fortawesome/fontawesome-pro/js/all.min.js",
        main: "./static/myapp/src/js/main.js",
    },
    output: {
        filename: "[name].[contenthash].js",
        path: path.join(__dirname, "static/myapp/dist/js/"),
        publicPath: "/static/myapp/dist/js/",
    },
    optimization: {
        minimizer: [
            new CssMinimizerPlugin(),
            new TerserPlugin(),
        ],
        splitChunks: {
            cacheGroups: {
                bootstrapCss: {
                    name: 'bootstrap',
                    test: /bootstrap.scss$/,
                    chunks: 'all',
                    enforce: true,
                },
                // fontawesomeCss: {
                //     name: 'fontawesome',
                //     test: /fontawesome.scss$/,
                //     chunks: 'all',
                //     enforce: true,
                // },
                fontawesomeJs: {
                        name: 'fontawesome',
                        test: /[\/]@fortawesome[\/]fontawesome-pro[\/]js[\/]all.min.js$/,
                        chunks: 'all',
                        enforce: true,
                    },
            },
        },
    },
    module: {
        rules: [
            {
                test: /.(scss)$/,
                use: [
                    MiniCssExtractPlugin.loader,
                    {
                        loader: "css-loader",
                        options: {sourceMap: true}
                    },
                    {
                        loader: "postcss-loader",
                        options: {postcssOptions: {plugins: [autoprefixer()]}}
                    },
                    {
                        loader: 'sass-loader',
                        options: {
                            sassOptions: {
                                includePaths: ['./static/myapp/src/css'],
                            },
                        },
                    },
                ],
            },
            {
                test: /.(woff(2)?|ttf|eot|svg)(?v=d+.d+.d+)?$/,
                type: 'asset/resource',
                generator: {
                    filename: 'fonts/[name][hash].[ext]',
                },

            },
        ],
    },
    plugins: [
        //new BundleAnalyzerPlugin(),
        new MiniCssExtractPlugin({
            filename: '../css/[name].[contenthash].css',
            chunkFilename: '../css/[name].[contenthash].css',
        }),
        new CleanWebpackPlugin(),
        new HtmlWebPackPlugin({
            template: path.join(
                __dirname,
                "static/myapp/src/html/webpack_bundles.html"
            ),
            filename: path.join(
                __dirname,
                "templates/myapp/webpack_bundles.html"
            ),
            // Use our template to control placement of the bundles
            inject: false,
            chunks: ['bootstrap', 'fontawesome', 'vendor', 'main'],
            chunksSortMode: 'manual',
            scriptLoading: "blocking",
        }),
    ],
};

Here is a non-working webpack.config.js where I try to load my kit (which is installed via npm):

const autoprefixer = require("autoprefixer");
const {CleanWebpackPlugin} = require("clean-webpack-plugin");
const MiniCssExtractPlugin = require("mini-css-extract-plugin");
const HtmlWebPackPlugin = require("html-webpack-plugin");
const path = require("path");
const CssMinimizerPlugin = require("css-minimizer-webpack-plugin");
const TerserPlugin = require("terser-webpack-plugin");
//const BundleAnalyzerPlugin = require('webpack-bundle-analyzer').BundleAnalyzerPlugin;

module.exports = {
    mode: "production",
    entry: {
        vendor: "./static/myapp/src/js/vendor.js",
        fontawesome: "@awesome.me/kit-123456abc/icons/js/all.min.js",
        main: "./static/myapp/src/js/main.js",
    },
    output: {
        filename: "[name].[contenthash].js",
        path: path.join(__dirname, "static/myapp/dist/js/"),
        publicPath: "/static/myapp/dist/js/",
    },
    optimization: {
        minimizer: [
            new CssMinimizerPlugin(),
            new TerserPlugin(),
        ],
        splitChunks: {
            cacheGroups: {
                bootstrapCss: {
                    name: 'bootstrap',
                    test: /bootstrap.scss$/,
                    chunks: 'all',
                    enforce: true,
                },
                // fontawesomeCss: {
                //     name: 'fontawesome',
                //     test: /fontawesome.scss$/,
                //     chunks: 'all',
                //     enforce: true,
                // },
                fontawesomeJs: {
                        name: 'fontawesome',
                        test: /[\/]@awesome.me[\/]kit-123456abc[\/]icons[\/]js[\/]all.min.js$/,
                        chunks: 'all',
                        enforce: true,
                    },
            },
        },
    },
    module: {
        rules: [
            {
                test: /.(scss)$/,
                use: [
                    MiniCssExtractPlugin.loader,
                    {
                        loader: "css-loader",
                        options: {sourceMap: true}
                    },
                    {
                        loader: "postcss-loader",
                        options: {postcssOptions: {plugins: [autoprefixer()]}}
                    },
                    {
                        loader: 'sass-loader',
                        options: {
                            sassOptions: {
                                includePaths: ['./static/myapp/src/css'],
                            },
                        },
                    },
                ],
            },
            {
                test: /.(woff(2)?|ttf|eot|svg)(?v=d+.d+.d+)?$/,
                type: 'asset/resource',
                generator: {
                    filename: 'fonts/[name][hash].[ext]',
                },

            },
        ],
    },
    plugins: [
        //new BundleAnalyzerPlugin(),
        new MiniCssExtractPlugin({
            filename: '../css/[name].[contenthash].css',
            chunkFilename: '../css/[name].[contenthash].css',
        }),
        new CleanWebpackPlugin(),
        new HtmlWebPackPlugin({
            template: path.join(
                __dirname,
                "static/myapp/src/html/webpack_bundles.html"
            ),
            filename: path.join(
                __dirname,
                "templates/myapp/webpack_bundles.html"
            ),
            // Use our template to control placement of the bundles
            inject: false,
            chunks: ['bootstrap', 'fontawesome', 'vendor', 'main'],
            chunksSortMode: 'manual',
            scriptLoading: "blocking",
        }),
    ],
};

However that gives me this error:

ERROR in fontawesome
Module not found: Error: Package path ./icons/js/all.min.js is not exported from package /Users/me/project/myapp/node_modules/@awesome.me/kit-123456abc (see exports field in /Users/me/project/myapp/node_modules/@awesome.me/kit-123456abc/package.json)

I can see the file if I open my node_module directory and navigate to it.

If I open the package.json it says in the error I see these relevant parts:

    // Other similar stuff before this

    "./icons/sharp/solid": {
      "types": "./icons/modules/sharp/solid.d.ts",
      "import": "./icons/modules/sharp/solid.mjs",
      "require": "./icons/modules/sharp/solid.js",
      "default": "./icons/modules/sharp/solid.js"
    },
    
    "./icons/sharp/thin": {
      "types": "./icons/modules/sharp/thin.d.ts",
      "import": "./icons/modules/sharp/thin.mjs",
      "require": "./icons/modules/sharp/thin.js",
      "default": "./icons/modules/sharp/thin.js"
    },
    
    
    "./icons/kit/custom": {
      "types": "./icons/modules/kit/custom.d.ts",
      "import": "./icons/modules/kit/custom.mjs",
      "require": "./icons/modules/kit/custom.js",
      "default": "./icons/modules/kit/custom.js"
    },
    
    "./icons/css/*.css": {
      "default": "./icons/css/*.css"
    },
    "./icons/less/*.less": {
      "default": "./icons/less/*.less"
    },
    "./icons/scss/*.scss": {
      "default": "./icons/scss/*.scss"
    },

    // Other stuff after this

So I changed my webpack to include what I thought might be the appropriate thing:

entry: {
   // ...
   fontawesome: ["@awesome.me/kit-123456abc/icons/classic/solid", "@awesome.me/kit-123456abc/icons/kit/custom"],
   // ...
},

It builds the fontawesome.hash.js file and inserts it into my html – but the file is empty.

The file only contains:

(()=>{"use strict"})();

Any help would be hugely appreciated!

React Native Styling doesn’t work unless it’s inline

I simply have 2 text elements that I want to style but giving them css via style file doesn’t change anything. However when I gave them inline css it works. I removed everything in case there are some conflicts but it still doesn’t work and here’s the whole file;

index.js

/* eslint-disable no-const-assign */
import React from 'react';
import { View, Text } from 'react-native';
import styles from './style';

/**
 * creates a video screen view
 *
 * @param {object} props - props
 * @param {object} props.route - current route object
 * @returns {module:JSX.Element} - JSX.Element
 */
const Video = ({ route }) => {
  return (
    <View style={styles.stoppedContainer}>
      <View>
        <Text style={styles.redText}>Top</Text>
      </View>
      <View>
        <Text>Bottom</Text>
      </View>
    </View>
  );
};

export default Video;

Here’s the css

style.js

import { StyleSheet } from 'react-native';

/**
 * @returns {object} - object
 */
const styles = () => {
  return StyleSheet.create({
    stoppedContainer: {
      flex: 1,
      display: 'flex',
      flexDirection: 'column-reverse',
    },
    redText: {
      color: 'red',
      fontSize: 30,
    },
  });
};

export default styles;

Dont show in other select

I have a modal with chips and serial codes, when I select a chip I can change the serial code, but I don’t want to show the same serial code if it is selected by another select, I can’t do it, can anyone help?

var chipsSelecionados = [];
$("input[name='inventarios[]']").each(function() {
  var id = $(this).val();
  chipsSelecionados.push(id);
});


var optionsChips = seriais.map(function(seriais) {
  //se o selecionado
  var id = seriais.id;
  if ($.inArray(id.toString(), chipsSelecionados) === -1) {
    return "<option value='" + seriais.id + "'>" + seriais.serial + "</option>";
  }
}).join("");



$('#modal-buscar-linha').modal("hide");

var novaLinha = "<tr>" +
  "<input type='hidden' name='inventarios[]' value='" + idChip + "'>" +
  "<td style='vertical-align: middle;'><select class='form-control' style='margin: 0 auto;'>" + optionsChips + "</select></td>" +
  "<td>" + agenda + "</td>" +
  "<td style='vertical-align: middle;'><select class='form-control' style='margin: 0 auto;'><option>Não selecionar</option>" + options + "</select></td>" +
  "<td class='text-center'>" +
  "<button class='btn btn-danger delete-button' type='button'><i class='fa fa-trash' aria-hidden='true'></i></button>" +
  "</td>" +
  "</tr>";
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.7.1/jquery.min.js"></script>

I can’t change the text of an element using textContent on Reddit

I need to highlight the text in the comment form and change the highlighted part to another word

But reddit won’t let me change the comment form in any way, the text just doesn’t change, I don’t know what to do anymore

I’m making a plugin for chrome and this functionality will be in my plugin.

I also tried to change the text in the form via the console, nothing works either

enter image description here