GithubHelp home page GithubHelp logo

angular-mention-highlight's Introduction

Project

This project was generated with Angular CLI version 6.0.8. Is a input highlight by names brought from the bank for the api, besides that the text is salved with highlights.

Development server

Run ng serve for a dev server. Navigate to http://localhost:4200/. The app will automatically reload if you change any of the source files. The project need api NodeJs for get the names and post/put the text with highlights.

Metods

  • monitoringInput (): It is called every time the user types, checks if there are any tags to be added in the historySelected list, which stores the names to be highlighted by testing so that repeated names are not inserted;

  • seachTagsHighlight (): Searches the words for highlight checking and to be deleted;

  • refreshHighlight (): Search and highlight the reserved words, stored in the variable historySelected;

  • buildQuery (): Constructs the string that will be used as an expression for word search;

  • verifyWords (): Checks if any reserved word has been broken;

  • deleteWord (): Cuts the broken value of the string, which is the current value of the input, and returns the cursor to this place;

  • search (): Activated after typing "@", it searches for bank items from the 3rd letter entered and these values ​​will be entered in the mention possibilities (the items of the mention)

  • ModelItem (): It modifies the value of the mention to be inserted in the input;

  • saveText (): Saves the current text of the input and the value of the list of highlights in the database;

  • selectFavorite (): Captures the chosen value from the list of favorites in the input and inserts in the list of names to be highlighted (historySelected); setInText (): Inserts the value at the current cursor position;

  • saveObject (): Constructs a list of objects that hold _id and the name of items that have already been pulled from the database;

  • ShowItem (): Gives a console showing the id of the item that was clicked;

  • download (): It pulls the texts inserted in the bank and creates a dropdown on top of that;

  • insertText (): It takes the value of the selected text, inserts in the text and captures the new reserved words, so that they are inserted in the vector of the values ​​to be highlighted;  

  • initializeText (): Where it is checked if there is any content saved for that input, if it is confirmed the input will already be opened with the saved value;

  • insertDatabase (): Inserts the value of the input into the database;

  • insertTextInInput (): Inserts the desired text into the input;

  • verifyPostOrPutData (): Check if there is already a value in the database and depending on it it will insert or update this value;

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.