jQuery Scrapping & Formatting Inputted Paste

Discussion in 'Javascript' started by TIMinion, Sep 30, 2020.

  1. TIMinion

    TIMinion

    Joined:
    Sep 29, 2020
    Messages:
    2
    Likes Received:
    0
    What I'm Working On
    This is for a help / tutorial / fan based website in which some content and resources will be shown on the external site. Amongst their lengthy API does not include their newsfeed what has been recently added and whatnot. I am working on a manual method for a few helpers of the site, upon this feed coming available, they can simply copy and paste, very little experience needed.

    Example Post To Paste


    Lorem ipsum dolor sit amet, consectetur adipiscing elit. Quisque vitae nisi ultricies, dapibus augue sit amet, malesuada lorem. Suspendisse ultricies ante quam, sit amet pellentesque erat interdum et. Sed interdum.

    - Released Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nulla fermentum.
    - Released Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nulla fermentum.
    - Released Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nulla fermentum.
    - Changed Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nulla fermentum.
    - Changed Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nulla fermentum.
    - Changed Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nulla fermentum.
    - Increased Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nulla fermentum.
    - Fixed Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nulla fermentum.
    - Fixed Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nulla fermentum.

    - [Category_1] Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nulla fermentum.

    - [Category_2] Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nulla fermentum.
    - [Category_2] Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nulla fermentum.

    - [Category_3] Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nulla fermentum.

    Lorem ipsum dolor sit amet, consectetur adipiscing elit. Morbi a venenatis enim. Aenean tempor, enim a convallis volutpat, lectus lorem.​

    Enter Paste On CodePen

    Problems Occuring
    I do not know how to call the function `enableSelectBoxes();` for the newly appened items without breaking the existing ones. Upon pasting the example above, the three existing will break, but all new ones will be good.

    Question On How To
    I have looped through the paste twice and there are a few things I would like to know how to do
    1. Within the select options, how can I add `<selected>` on the correct option either during or after the loops?
    2. How can I isolate all above this scope, my example shows one paragraph where there might be multiple
    3. Same as above, but all below this scope.
     
    TIMinion, Sep 30, 2020
    #1
    1. Advertisements

  2. TIMinion

    sunfighter

    Joined:
    Nov 27, 2019
    Messages:
    122
    Likes Received:
    17
    With out examples it's hard to understand how you are doing things. How is a single item added to the page by your helpers?
    But, I have some questions. Why use CSS to control a simple HTML SELECT? Why use INPUT boxes for the article, they are non expanding?


    Would you be willing to use a database and PHP to form your page?
     
    sunfighter, Sep 30, 2020
    #2
    1. Advertisements

  3. TIMinion

    TIMinion

    Joined:
    Sep 29, 2020
    Messages:
    2
    Likes Received:
    0
    This does have an example, please copy the text within `Example Post To Paste` and go to the CodePen (link reads [Enter Paste On CodePen]) where you can enter it into the text area. It appears you have perhaps missed this so I will await your response before replying to any further quesitons you may have.
     
    TIMinion, Sep 30, 2020
    #3
    1. Advertisements

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments (here). After that, you can post your question and our members will help you out.