1

examples:

$('.title').on('click', function(){
    do_something();
}

$('.title').on('contextmenu', function(){
    do_something();
}

I have a lot of such functions in a .js file.

Each time I need to edit the function (Notepad++) I need to press Ctrl F and search for title then press Enter several times while it is not found.

Because title and click and contextmenu are used a lot inside other functions.

Supprised but there are no names of jquery functions in the function list. There is only a word - function - totally useless.

I tried Atom and Sublime - the same situation. Pure js functions are there, but jquery functions are missing.

So what is your practice? How do you find desired jq function inside a large js file?

Is there an editor, for Windows, having the names of jq functions on the sidebar?

If not - a potential solution could be a simple plugin for npp which should find the above function directly if title click or title context is typed into the search box.

Is it possible to create that plugin in javascript? If yes - please some help - where to start.

The third solution is a browser-based code editor, but that's probably too complicated fur such a minor task - have a function in a function list.

Any help?

7
  • Control-F for $('.title').on('click'? Also, rather than selecting .title each time, you might select it just once: $title = $('.title'); then use and search with $title.on('click'... Commented Jan 20, 2019 at 8:47
  • $('.title').on('click' or $('.title').on('contextmenu' is a lot of typing (brackets, quotes...). Can't understand the second part of your comment, pls Commented Jan 20, 2019 at 8:50
  • You just have to store the selection in a variable. More efficient, less time spent typing, less time spent searching, better all around. Commented Jan 20, 2019 at 8:54
  • @CertainPerformance so, for example - $var = $('.title').on('click'). That's written somewhere in the body of .js file. Now - Ctrl-F and type $var - what is find is $var and not $('.title').on('click'). If I'm wrong, pls write a complete example. Commented Jan 20, 2019 at 9:00
  • No, see first comment - $title = $('.title'); then use and search with $title.on('click'... Assign the collection to a variable so you can re-use it, assigning the handler to a variable doesn't help Commented Jan 20, 2019 at 9:01

1 Answer 1

1

Type comments above your functions and then search for those comments it will help you allot.

Sign up to request clarification or add additional context in comments.

1 Comment

Fine. And would be better with a comment list. Doesn't exists in npp. Unbelievable.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.