Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Rules for copying text in ordinary plain, plain with all embedded URLs and html formats #100

Open
iG8R opened this issue Oct 30, 2023 · 108 comments
Labels
Seek help Seek help for site rule

Comments

@iG8R
Copy link

iG8R commented Oct 30, 2023

Hi.
Suppose a user selects the following text:

SearchJumper-Text-with-URLs-Video_2023-10-30_231457.webm

Is there a way to give an option to save it into the clipboard in the different following formats:
1. plain text with all embedded URLs under texts' highlights and images (my main concern)

    Just a personal work, maybe not suit you and won't provide support.

📧Mail Me (mailto:[email protected])

    Build with React.js
    UI: Material-UI (https://mui.com/)
    Icons: FontAwesome (https://fontawesome.com/)

(https://github.com/hoothin/SearchJumper/blob/main/demo1.gif) (https://github.com/hoothin/SearchJumper/blob/main/demo3.gif) (https://github.com/hoothin/SearchJumper/blob/main/demo2.gif)

2. html text

<html><body>
<!--StartFragment--><blockquote>
<p dir="auto"><em>Just a personal work, maybe not suit you and won't provide support.</em></p>
</blockquote>
<p dir="auto"><a href="mailto:[email protected]"><strong>📧Mail Me</strong></a></p>
<ul dir="auto">
<li>Build with React.js</li>
<li>UI: <a href="https://mui.com/" rel="nofollow">Material-UI</a></li>
<li>Icons: <a href="https://fontawesome.com/" rel="nofollow">FontAwesome</a></li>
</ul>
<p dir="auto"><animated-image data-catalyst=""><a target="_blank" rel="noopener noreferrer" href="https://github.com/hoothin/SearchJumper/blob/main/demo1.gif" data-target="animated-image.originalLink"><img src="https://github.com/hoothin/SearchJumper/raw/main/demo1.gif" height="221px" style="max-width: 100%; display: inline-block;" data-target="animated-image.originalImage"></a>
      </animated-image><animated-image data-catalyst=""><a target="_blank" rel="noopener noreferrer" href="https://github.com/hoothin/SearchJumper/blob/main/demo3.gif" data-target="animated-image.originalLink"><img src="https://github.com/hoothin/SearchJumper/raw/main/demo3.gif" height="221px" style="max-width: 100%; display: inline-block;" data-target="animated-image.originalImage"></a>
      </animated-image><animated-image data-catalyst=""><a target="_blank" rel="noopener noreferrer" href="https://github.com/hoothin/SearchJumper/blob/main/demo2.gif" data-target="animated-image.originalLink"><img src="https://github.com/hoothin/SearchJumper/raw/main/demo2.gif" height="221px" style="max-width: 100%; display: inline-block;" data-target="animated-image.originalImage"></a></animated-image></p><!--EndFragment-->
</body>
</html>

3. ordinary plain text

    Just a personal work, maybe not suit you and won't provide support.

📧Mail Me

    Build with React.js
    UI: Material-UI
    Icons: FontAwesome
@iG8R iG8R added the Seek help Seek help for site rule label Oct 30, 2023
@hoothin
Copy link
Owner

hoothin commented Oct 31, 2023

You have not even installed SearchJumper. So what are you expecting???

@iG8R
Copy link
Author

iG8R commented Oct 31, 2023

Well, this is my pre-installation preparation. :)

@iG8R
Copy link
Author

iG8R commented Oct 31, 2023

What a beautiful design and smooth operation of the script, wow.

@hoothin
Copy link
Owner

hoothin commented Oct 31, 2023

SearchJumper does not have the ability to extract the HTML of selected elements, which may be added in the future. I didn't have a good idea where to add it.

@iG8R
Copy link
Author

iG8R commented Oct 31, 2023

Is SearchJumper able to intercept what is passed to the clipboard?

If yes, then, usually, when something is copied in the browser, it is transmitted in two versions at once - text/plain and text/html. Maybe then it will be possible to process text/html with SearchJumper?

PS. This feature would be way useful, as when we copy texts from web pages and paste them into applications or forms that don't support pasting texts with richtext/html formatting, we encounter a problem of missing a very important part of these texts - URLs, since usually the overwhelming majority of URLs on any web page are hidden under text descriptions and images.

@hoothin
Copy link
Owner

hoothin commented Oct 31, 2023

No, it can't.
https://developer.mozilla.org/en-US/docs/Web/API/Clipboard/read .
On firefox, only addon can do that, but not greasemonkey script.

@iG8R
Copy link
Author

iG8R commented Oct 31, 2023

What a pity :(

@hoothin
Copy link
Owner

hoothin commented Nov 1, 2023

You can try %element now

  • copy inner text with url or img of select elements
    c:%element{}
  • copy html of select elements
    c:%element{}.prop(innerHTML)
  • copy plain text
    c:%s

@iG8R
Copy link
Author

iG8R commented Nov 1, 2023

Amazing!
Thank you very much!
Is it possible to customize how the copied text+URL will look, for example, currently it is copied like this

[📧Mail Me](mailto:[email protected])

Build with React.js
UI: [Material-UI](https://mui.com/)
Icons: [FontAwesome](https://fontawesome.com/)

E.i. with [ ] around text and ( ) around the URL.
Make it possible for it to look text (URL) or {text | URL}, or text [URL] etc.

@iG8R
Copy link
Author

iG8R commented Nov 1, 2023

Some texts reveal bugs in their processing, but this in no way diminishes how cool it is!


Icons: [FontAwesome](https://fontawesome.com/)

[![](https://github.com/hoothin/SearchJumper/raw/main/demo1.gif)](https://github.com/hoothin/SearchJumper/blob/main/demo1.gif)
      
        [
          
        
            ![demo1.gif](https://github.com/hoothin/SearchJumper/raw/main/demo1.gif)
          ](https://github.com/hoothin/SearchJumper/blob/main/demo1.gif)
        
        
          
            
              
            
            
              
              
            
          
          [
            
              
            
          ](https://github.com/hoothin/SearchJumper/blob/main/demo1.gif)
        
      [![](https://github.com/hoothin/SearchJumper/raw/main/demo3.gif)](https://github.com/hoothin/SearchJumper/blob/main/demo3.gif)
      
        [
          
        
            ![demo3.gif](https://github.com/hoothin/SearchJumper/raw/main/demo3.gif)
          ](https://github.com/hoothin/SearchJumper/blob/main/demo3.gif)
        
        
          
            
              
            
            
              
              
            
          
          [
            
              
            
          ](https://github.com/hoothin/SearchJumper/blob/main/demo3.gif)
        
      [![](https://github.com/hoothin/SearchJumper/raw/main/demo2.gif)](https://github.com/hoothin/SearchJumper/blob/main/demo2.gif)

@iG8R
Copy link
Author

iG8R commented Nov 1, 2023

On https://www.twitch.tv/directory

SearchJumper-Text-URL-some-issue-01-Video_2023-11-01_123134.webm

@hoothin
Copy link
Owner

hoothin commented Nov 2, 2023

I've optimized a little, but this is just a experimenting and I think addon like Copy as Markdown will be better.
Anyway, you can try %element{}.prop(outerHTML).replace() for more possibilities.

@iG8R
Copy link
Author

iG8R commented Nov 2, 2023

Thank you for advice.
Copy as Markdown - very good addon, but it only copies connected pair [link title](URL)or [page title](URL), not entire selected text with URLs.
As for the Markdown format - it is used mostly among among specialists (typesetting, design, IT), for common people, like parents or friends such a text format would be incomprehensible and confusing. That’s actually why I asked for the ability to customize the text-link design type, so that it would be convenient for everyone with whom you communicate and send information.
Of course, it is possible to use wildcard substitution manually, but it would be much more convenient for any user, even Vim fans, if there was an option to set formatting options initially.

@hoothin
Copy link
Owner

hoothin commented Nov 2, 2023

It's easy with %element.replace, like

  • copy text with url like txt(url) without image
c:%element{}.replace(/!\[.*?\]\(.*?\)/g,"").replace(/\[(.*?)\](\(.*?\))/g,"$1$2")

@hoothin
Copy link
Owner

hoothin commented Nov 2, 2023

  • copy text with url like {txt | url} without image
c:%element{}.replace(/!\[.*?\]\(.*?\)/g,"").replace(/\[(.*?)\]\((.*?)\)/g,"{ $1 | $2 }")

@iG8R
Copy link
Author

iG8R commented Nov 2, 2023

Thanks a lot!

@iG8R
Copy link
Author

iG8R commented Nov 2, 2023

Unfortunately, the new rules do not work as well as the first ones.
I know that the script still needs to be optimized, so the data below is just for information on how things are at the moment.

image
image

  1. c:%element{}
 [📧Mail Me](mailto:[email protected]) 
Build with React.js
UI:  [Material-UI](https://mui.com/) 
Icons:  [FontAwesome](https://fontawesome.com/) 
[![](https://github.com/hoothin/SearchJumper/raw/main/demo1.gif)](https://github.com/hoothin/SearchJumper/blob/main/demo1.gif) 
[![demo1.gif](https://github.com/hoothin/SearchJumper/raw/main/demo1.gif)](https://github.com/hoothin/SearchJumper/blob/main/demo1.gif) 
[![](https://github.com/hoothin/SearchJumper/raw/main/demo3.gif)](https://github.com/hoothin/SearchJumper/blob/main/demo3.gif) 
[![demo3.gif](https://github.com/hoothin/SearchJumper/raw/main/demo3.gif)](https://github.com/hoothin/SearchJumper/blob/main/demo3.gif) 
[![](https://github.com/hoothin/SearchJumper/raw/main/demo2.gif)](https://github.com/hoothin/SearchJumper/blob/main/demo2.gif) 

[Click on text to copy a link to the clipboard - javascript ![](data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAACDklEQVR4Ae1VA6wcURR9tW23+95s7cZVUNuKaiOsu3dqB7UV1EFt27btjup2el6y+ObMFv+f5OwObuacqzyWilQ4CYs8tQwSJw3ilcIu/n6qJ5dJ4gNow8SdD1Q6Nws3DFVpBwO/QBvcYa9n6VwVlALItkIkE8TH+w1ITmVuAuLzIfLFUpW+QVPE0prEt/oN/EJMR1fEP08sUwoCLyJku9qmIlmD8+DjN/3PLZPKVGFuwKTShSFwMIKJKzp5vAzQyVsO9x/9Q3kf9/ndmQOqn172OsLwaRBszwBLFS1Cz/keR4bSJKWrRUpz2WsWARbx1oE19IvOthfVzGD5xLgIFZrtxK6/95f1rukTw+Qz5odGXODdhZCgcuSTTxQ3SNmMeAMm+yR36iuglIcDAn4jukVibqD3NpXOjJgVEWJewWjDjxMEZ04BgjX8Il8iCP0Cd5gqbyLbg5geuP8MPpFVYG7AmCQKoKxjIPIUtCPwluHjg3TVW8exc8EiT1NTFd2M8Ur5qNMshw1CndGOE1GMjHBw58W+CH03wWOy92APa7yoLk0ETkTErEGLnr+ZVjaHkwZ2ghpox8Kv4DkYWwwOkBvBnIYcLjnthso7IcNpENyN/3cxGZItS5bY8jXrbEmWAHwiT0ld5W2Queo/iJ5oVCFvxO+4ZCBuOGpAljUx/I8MJAP/vgEn+K8ZCD9S8Rsz4IeXsWZCowAAAABJRU5ErkJggg==) Stack Overflowhttps://stackoverflow.com › questions › click-on-text-t...](https://stackoverflow.com/questions/51625169/click-on-text-to-copy-a-link-to-the-clipboard) Stack Overflowhttps://stackoverflow.com › questions › click-on-text-t...

  1. c:%element{}.replace(/![.?](.?)/g,"").replace(/[(.?)]((.?))/g,"$1 $2")
 📧Mail Me (mailto:[email protected]) 
Build with React.js
UI:  Material-UI (https://mui.com/) 
Icons:  FontAwesome (https://fontawesome.com/) 
 (https://github.com/hoothin/SearchJumper/blob/main/demo1.gif) 
 (https://github.com/hoothin/SearchJumper/blob/main/demo1.gif) 
 (https://github.com/hoothin/SearchJumper/blob/main/demo3.gif) 
 (https://github.com/hoothin/SearchJumper/blob/main/demo3.gif) 
 (https://github.com/hoothin/SearchJumper/blob/main/demo2.gif) 

Click on text to copy a link to the clipboard - javascript Stack Overflowhttps://stackoverflow.com › questions › click-on-text-t... (https://stackoverflow.com/questions/51625169/click-on-text-to-copy-a-link-to-the-clipboard) Stack Overflowhttps://stackoverflow.com › questions › click-on-text-t...

@hoothin
Copy link
Owner

hoothin commented Nov 2, 2023

So?
I think it works as I expected. What's your expected behavior?

@iG8R
Copy link
Author

iG8R commented Nov 2, 2023

image

@hoothin
Copy link
Owner

hoothin commented Nov 2, 2023

![] means image with no alt info
(https://github.com/hoothin/SearchJumper/blob/main/demo1.gif) means this is a link but without text (which was image there).
If you don't want to save links without text, add another replace like c:%element{}.replace(/!\[.*?\]\(.*?\)/g,"").replace(/\[ *\]\(.*?\)\s*/g,"").replace(/\[(.*?)\]\((.*?)\)/g,"{ $1 | $2 }").

I don't know why you can't get all links but I get this result on my Chrome.

{ Click on text to copy a link to the clipboard - javascript Stack Overflowhttps://stackoverflow.com › questions › click-on-text-t... | https://stackoverflow.com/questions/51625169/click-on-text-to-copy-a-link-to-the-clipboard } Stack Overflowhttps://stackoverflow.com › questions › click-on-text-t...Aug 1, 2018 — 2 Answers 2 · Create a <textarea> element to be appended to the document. · Set its value to the string that we want to copy to the clipboard. { 2 answers | https://stackoverflow.com/a/51625261 }   ·  Top answer: If you want to ensure compatibility with all major browsers, you can use the following ... { Copy a text when a link or button is clicked - Stack Overflow | https://stackoverflow.com/questions/19606221/copy-a-text-when-a-link-or-button-is-clicked } Oct 26, 2013 { How to copy the link href itself to the clipboard when clicked | https://stackoverflow.com/questions/54699045/how-to-copy-the-link-href-itself-to-the-clipboard-when-clicked } Feb 14, 2019 { How to create a copy text link? - html - Stack Overflow | https://stackoverflow.com/questions/64406456/how-to-create-a-copy-text-link } Oct 17, 2020 { JavaScript: copy text to clipboard and append source hyperlink | https://stackoverflow.com/questions/31968274/javascript-copy-text-to-clipboard-and-append-source-hyperlink } Aug 12, 2015 { More results from stackoverflow.com | https://www.google.com/search?q=html+copying+text+with+links+site:stackoverflow.com&newwindow=1&sca_esv=578743716&sa=X&ved=2ahUKEwiF2Zz516SCAxXdnGoFHcx2Df0QrQIoBHoECBsQBQ }

@iG8R
Copy link
Author

iG8R commented Nov 2, 2023

SearchJumper-Rules-for-Text-URL-Video_2023-11-02_085110.webm

@hoothin
Copy link
Owner

hoothin commented Nov 2, 2023

I need more informations like platform os

@iG8R
Copy link
Author

iG8R commented Nov 2, 2023

This is me using Firefox :(

I just checked, under the same conditions in EDGE and Chrome - that's right, everything works there as you say, links are not eaten.

  • OS: Microsoft Windows [Version 10.0.19045.2673] 64bit
  • Browser: Firefox 119.0 64bit
  • Browser: Chrome 118.0.5993.90 (Official Build) (64-bit)
  • Browser: Edge 118.0.2088.69 (Official build) (64-bit)

@hoothin
Copy link
Owner

hoothin commented Nov 2, 2023

Thanks, firefox has multiple range. I've fixed.

@iG8R
Copy link
Author

iG8R commented Nov 2, 2023

On the contrary, I am very grateful that my question is being treated with such attentiveness and care.

@iG8R
Copy link
Author

iG8R commented Nov 3, 2023

Thanks a lot!
Is it possible for the formatting of the copied text to be preserved, i.e. if the original text contains line breaks, the copied text would also have the same line breaks?
For example, the example above.

Was:
Click on text to copy a link to the clipboard - javascript Stack Overflowhttps://stackoverflow.com › questions › click-on-text-t... (https://stackoverflow.com/questions/51625169/click-on-text-to-copy-a-link-to-the-clipboard) Stack Overflowhttps://stackoverflow.com › questions › click-on-text-t...Aug 1, 2018 — 2 Answers 2 · Create a <textarea> element to be appended to the document. · Set its value to the string that we want to copy to the clipboard. 2 answers (https://stackoverflow.com/a/51625261)   ·  Top answer: If you want to ensure compatibility with all major browsers, you can use the following ... Copy a text when a link or button is clicked - Stack Overflow (https://stackoverflow.com/questions/19606221/copy-a-text-when-a-link-or-button-is-clicked) Oct 26, 2013 How to copy a HyperText link into clipboard without losing the ... (https://stackoverflow.com/questions/53003980/how-to-copy-a-hypertext-link-into-clipboard-without-losing-the-link-properties) Oct 26, 2018 How to create a copy text link? - html - Stack Overflow (https://stackoverflow.com/questions/64406456/how-to-create-a-copy-text-link) Oct 17, 2020 JavaScript: copy text to clipboard and append source hyperlink (https://stackoverflow.com/questions/31968274/javascript-copy-text-to-clipboard-and-append-source-hyperlink) Aug 12, 2015 More results from stackoverflow.com (https://www.google.com/search?q=html+copying+text+with+links+site:stackoverflow.com&newwindow=1&sca_esv=578730287&sxsrf=AM9HkKkGnlxPaXxzD4fFPKm3k_apsQD63A:1698970246764&sa=X&ved=2ahUKEwj9-6qwxaaCAxUSGhAIHdBgA10QrQIoBHoECAwQBQ)

Became:

Click on text to copy a link to the clipboard - javascript  
Stack Overflow
https://stackoverflow.com › questions › click-on-text-t... (https://stackoverflow.com/questions/51625169/click-on-text-to-copy-a-link-to-the-clipboard) 
Aug 1, 2018 — 2 Answers 2 · Create a <textarea> element to be appended to the document. · Set its value to the string that we want to copy to the clipboard.
2 answers (https://stackoverflow.com/a/51625261)   ·  Top answer: If you want to ensure compatibility with all major browsers, you can use the following ... 
Copy a text when a link or button is clicked - Stack Overflow (https://stackoverflow.com/questions/19606221/copy-a-text-when-a-link-or-button-is-clicked) Oct 26, 2013
How to copy a HyperText link into clipboard without losing the ... (https://stackoverflow.com/questions/53003980/how-to-copy-a-hypertext-link-into-clipboard-without-losing-the-link-properties) Oct 26, 2018
How to create a copy text link? - html - Stack Overflow (https://stackoverflow.com/questions/64406456/how-to-create-a-copy-text-link) Oct 17, 2020
JavaScript: copy text to clipboard and append source hyperlink (https://stackoverflow.com/questions/31968274/javascript-copy-text-to-clipboard-and-append-source-hyperlink) Aug 12, 2015
More results from stackoverflow.com (https://www.google.com/search?q=html+copying+text+with+links+site:stackoverflow.com&newwindow=1&sca_esv=578730287&sxsrf=AM9HkKkGnlxPaXxzD4fFPKm3k_apsQD63A:1698970246764&sa=X&ved=2ahUKEwj9-6qwxaaCAxUSGhAIHdBgA10QrQIoBHoECAwQBQ) 

@hoothin
Copy link
Owner

hoothin commented Nov 3, 2023

Yes, you can try 1.6.30.21
But there are two things I have no idea how to work out for now.

  1. If there are link breaks inside links. It must remove the breaks to combine text with link
  2. Some text do not show as their actual order because of css style, for example, Stack Overflow is over Click on text

@iG8R
Copy link
Author

iG8R commented Nov 3, 2023

Almost perfect!
Is it possible to make line breaks take into account <div> tags, so that the sequence of paragraphs is not disrupted in this way?
For example.

Click on text to copy a link to the clipboard - javascript  Stack Overflow https://stackoverflow.com › questions › click-on-text-t... (https://stackoverflow.com/questions/51625169/click-on-text-to-copy-a-link-to-the-clipboard)
Aug 1, 2018 — 2 Answers 2 · Create a <textarea> element to be appended to the document. · Set its value to the string that we want to copy to the clipboard.
2 answers (https://stackoverflow.com/a/51625261)  
·
Top answer: 
If you want to ensure compatibility with all major browsers, you can use the following ...
Copy a text when a link or button is clicked - Stack Overflow (https://stackoverflow.com/questions/19606221/copy-a-text-when-a-link-or-button-is-clicked)
Oct 26, 2013
How to copy a HyperText link into clipboard without losing the ... (https://stackoverflow.com/questions/53003980/how-to-copy-a-hypertext-link-into-clipboard-without-losing-the-link-properties)
Oct 26, 2018
How to create a copy text link? - html - Stack Overflow (https://stackoverflow.com/questions/64406456/how-to-create-a-copy-text-link)
Oct 17, 2020
JavaScript: copy text to clipboard and append source hyperlink (https://stackoverflow.com/questions/31968274/javascript-copy-text-to-clipboard-and-append-source-hyperlink)
Aug 12, 2015
More results from stackoverflow.com (https://www.google.com/search?q=html+copying+text+with+links+site:stackoverflow.com&newwindow=1&sca_esv=579018559&sxsrf=AM9HkKlEMH1ZH33OGONuKEoWlgnKiuJlmQ:1698973121166&sa=X&ved=2ahUKEwiNzfqK0KaCAxURLhAIHXfCAwcQrQIoBHoECBEQBQ)

image
image

@hoothin
Copy link
Owner

hoothin commented Nov 3, 2023

No, as I said, it's because css style. .TbwUpd.ojE3Fb has position: absolute so it's over LC20lb MBeuO DKV0Md.
I can't enumerate all the possibility of css unless I calculate every position of elements, that's unworkable.

@iG8R
Copy link
Author

iG8R commented Nov 14, 2023

Is it possible to have an option where the desired text is not immediately highlighted after opening the searched page, but after bringing up the Find panel?

The thing is, in a search query, there are often quite a few words, and when the page opens and all these words are highlighted, it's overwhelming for the eyes. It would be convenient to first glance over the page, and if what we were looking for is not immediately found, then the highlighting of search words or phrases is called up for clarification.

@hoothin
Copy link
Owner

hoothin commented Nov 14, 2023

Just uncheck the Highlight the site opened from the search engine

@iG8R
Copy link
Author

iG8R commented Nov 14, 2023

Oh!

Is it possible to add to this so that the last selected Word mode is remembered? Otherwise, every time you open a page and bring up the Find bar, there is always a search by phrase.
And when closing the Find bar using Ecs or by clicking on X, so that the text you are looking for is not erased from the Find bar?
And also, I don't know if it's a glitch or not, but right after loading the page, until you click on it, the search bar can't be bring up.

IMHO, the following scenario would be the most convenient, because the search almost always consists of at least 2-3 words:
opens the page you are looking for, nothing is highlighted on it, if you cannot find the information you need at first glance, the Find bar is called. Once the information is highlighted and localized, the Find bar is hidden along with the highlighting, but if the search words need to be highlighted again, the Find bar is brought up again.

@iG8R
Copy link
Author

iG8R commented Nov 14, 2023

SearchJumper-Search-query-delete-2023-11-14.14-18-53.webm

@hoothin
Copy link
Owner

hoothin commented Nov 14, 2023

Nice suggestion. It's done now.

On a side note, it would be great if you could recommend SearchJumper to your friends.

@iG8R
Copy link
Author

iG8R commented Nov 14, 2023

From the very first day when I saw this beautiful script and started using SearchJumper, I recommend it to all my friends :)

@iG8R
Copy link
Author

iG8R commented Nov 15, 2023

Some issues:

SearchJumper-FindBar-search-page-issue-Video_2023-11-15_15-10-42.webm

@hoothin
Copy link
Owner

hoothin commented Nov 15, 2023

Thank you for report. It's a bug of addon. It's fixed now. https://greasyfork.org/scripts/479610

@iG8R
Copy link
Author

iG8R commented Nov 15, 2023

SearchJumper-FindBar-search-page-issue-02-Video_2023-11-15_16-28-46.webm

@hoothin
Copy link
Owner

hoothin commented Nov 16, 2023

It's not a bug, one more Esc will clear all cached words. But it seems to be unsuitable. I will change it later.

@iG8R
Copy link
Author

iG8R commented Nov 19, 2023

Hi.
Long time no see:)
I came with some issues, as always...

  1. The dialog "Modify searching word" doesn't appear in the "single word" mode, but appear in the "phrase" one
  2. Removing words from the Find bar doesn't remove marks on the leftmost vertical indicator bar
  3. When using only 1 word in the Find bar:
    • also the dialog "Modify searching word" doesn't appear in the "word" mode. There is only 1 word, in this case SearchJumper should not distinguish between modes for displaying this dialog box.
    • how could it be possible to search for the whole word not as part of others?
  4. The Esc key doesn't work. Can the Esc key be used to hide the search panel? It would be convenient, after finishing the search, when actively using the keyboard, not to switch to the mouse to click the close button, but to press the Esc key.

Example page: https://github.com/doublecmd/doublecmd/wiki/Plugins

SearchJumper-Searching-whole-word-Esc-Video_2023-11-19_03-35-34.webm

@hoothin
Copy link
Owner

hoothin commented Nov 19, 2023

Let me explain,

  1. Word-mode is not an editable mode, as it will cut the ties between words in single input. so I disable double click to stop showing "Modify searching word" dialog. You need to click the edit icon to edit words in word-mode.
  2. If you input words with space, it's not possible to search for the whole word until you toggle it. Just like /\bPlugins\b/, \b means edge of word.
    I tested Esc but it words well, do you have more information?

@hoothin
Copy link
Owner

hoothin commented Nov 19, 2023

I've reproduced Esc bug under firefox, thank you, I'll fix it soon.

@iG8R
Copy link
Author

iG8R commented Nov 19, 2023

  1. Why not make this dialog available in both modes? For the simple editing use - the "Edit search text" button, and for gourmets, who need to use RegEx and more precise search - the "Modifying searching word" dialog.
  2. I didn't input the word with space... How could I toggle it without using RegEx?
  3. As for the Esc key - I'll show its behavior in more details in the screencast.
SearchJumper-Searching-whole-word-Esc-Video_2023-11-19_04-48-40.webm

@hoothin
Copy link
Owner

hoothin commented Nov 19, 2023

Because that will cut the ties between words. Imagine that one people input "copy text", how can I link the words if people modify copy to /copy\d+/ as copy is just a part of copy text? /copy\d+/ text is illegal.
If you input single word, the fastest way to modify it is pressing backspace.

@iG8R
Copy link
Author

iG8R commented Nov 19, 2023

First, regarding the search for a single word - what needs to be done to search for it as a whole, rather than as part of another word with minimal user intervention?
Regarding the search when there are 2 or more words. Is it possible to implement 2 search submodes in each mode?
When the user enters 2 or more words and performs a search in:

  1. "phrase" mode.
    • Submode 1: The phrase "copy text" will be searched as "copying text", "precopy texts", etc. That is, the main requirement is for the roots "copy" and "text" to be present in words with only spaces (or a non-word class characters?) in between.
    • Submode 2: The search will be conducted for the phrase as a whole, meaning "copy text" in the search query will only correspond to "copy text" in the text.
    • When the "Modifying searching word" dialog box is invoked in this mode, it is up to the user to decide whether they want to use RegEx or not and how they want to change the search phrase.
  2. "word" mode. Similar submodes as in "phrase", i.e. by the root of the word and the exact match.

@hoothin
Copy link
Owner

hoothin commented Nov 19, 2023

I think it's easy to Input /\bcopy\b/ instead of copy when search.
If you want to search "copying text", "precopy texts", /\w*copy\w*\s\w*text\w*/i will work.
By the way, it already search by whole word after installed SearchJumper levenshtein addon, there are some bugs but it's fixed now.

@iG8R
Copy link
Author

iG8R commented Nov 19, 2023

Thanks a lot for mending the issues.
Regarding manual distinction between two submodes - searching for the desired word in its whole form (/\bcopy\b/) or as a root of other words (copy).
IMHO, 99,(9)% of those who use or will use SearchJummper, regex is like a second foreign language for them. And even those who occasionally use regex, do not always remember all the commands, so they have to dig into its documentation again.
Again IMHO, the purpose of computer programs is to facilitate routine processes when performing certain tasks. So why not transfer the function of composing the necessary request for these 2 submodes to the broad and powerful shoulders of SearchJummper? Just to have an option, like in any Find window, where you can check whether to search for the word as a whole or as the root of the words present in the text.
For example, here's what the Find windows look like in Notepad++ or Total Commander:

image

@hoothin
Copy link
Owner

hoothin commented Nov 20, 2023

Indeed, that's true. However, I personally find the multitude of options quite bothersome. For me, using a single regular expression to solve tasks is the simplest approach.

But I can try adding an option for a toggle switch addon to achieve a similar effect. Once I have it ready, I will let you know.

@hoothin
Copy link
Owner

hoothin commented Nov 20, 2023

It's done, you can toggle addon by switch the checkbox.
image

Now, any search mode can be achieved using an addon. If you need any other search modes, please list the specific requirements for the desired mode, and I can help write an addon to fulfill those requirements.

@iG8R
Copy link
Author

iG8R commented Nov 20, 2023

Thank you so much!
Unfortunately, I encountered some bugs.

PS. Is it possible to make this checkbox dialog in the color theme corresponding to the Find bar, i.e. in black?

SearchJumper-search-whole-word-Video_2023-11-20_16-35-37.webm

@hoothin
Copy link
Owner

hoothin commented Nov 20, 2023

Have you updated addon?

@iG8R
Copy link
Author

iG8R commented Nov 20, 2023

Yes.

@iG8R
Copy link
Author

iG8R commented Nov 20, 2023

I'm rather confused how the "After enabling, select some text and long press the right mouse to bring up the toolbar" function works.
Also, if you disable it, the ability to configure tiles and their appearance when selecting text disappears.

SearchJumper-toolbar-mouse-buttons-Video_2023-11-20_20-22-25.webm

@hoothin
Copy link
Owner

hoothin commented Nov 21, 2023

The bug of addon is fixed.
Function key is prepared for right mouse, without function key, you need to long press right mouse. I'll change the description later.

@iG8R
Copy link
Author

iG8R commented Nov 21, 2023

SearchJumper somehow also reacts to a long press of the middle mouse button.

SearchJumper-MButton-Video_2023-11-21_03-00-05.webm

@hoothin
Copy link
Owner

hoothin commented Nov 21, 2023

Yes, cause some user use right mouse for Mouse Gestures software.

@iG8R
Copy link
Author

iG8R commented Nov 21, 2023

Yes, I know that many Mouse Gestures software use the right mouse button, but what about the middle one? In my case, it bound to a long click to open a program window that works with the clipboard.

@hoothin
Copy link
Owner

hoothin commented Nov 21, 2023

So you want to disable middle mouse in SearchJumper while long press?

@iG8R
Copy link
Author

iG8R commented Nov 21, 2023

Well, not immediately block it, maybe someone uses it, maybe just add settings for the middle mouse button?
It just so happens now that the left mouse button seems to be configured, but it turns out that this setting also affects the middle button.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Seek help Seek help for site rule
Projects
None yet
Development

No branches or pull requests

2 participants