Bug 21582 added CodeMirror to the system preferences IntranetUserJS and OPACUserJS. Prior to this addition, if you wanted to search for something in one of these preferences you could use Firefox's built in "Find in This Page..." functions to search for content anywhere inside of the two UserJS system preferences. Since the addition of CodeMirror, you can only search for content in the two UserJS system preferences if the content is displayed on the screen. This makes it difficult to search for something on, say, line 500 of IntranetUserJS, unless you've already scrolled down to line 500 - or you've opened up CodeMirror to show every line in the preference you want to search through. It looks like CodeMirror has an addon for searching through CodeMirror content, so I'm wondering if this addon could be incorporated into Koha wherever we're using CodeMirror.
It seems to work on their demo, without additional addon: https://codemirror.net/demo/complete.html Maybe we need to upgrade (no idea how big it could be) to the newest version, but I do not see something in the changelog.
(In reply to George Williams (NEKLS) from comment #0) > you can only search for > content in the two UserJS system preferences if the content is displayed on > the screen. I don't see how this is connected to the addition of CodeMirror. It has always been the case that you can't search the page for text which is hidden.
Owen, If you're in 18.05 and you go to preferences.pl?tab=opac and hit the "Click to edit" link for OPACUserJS and then search for a word that appears in the textarea for #pref_OPACUserJS using the browser's built in "Find in this page..." feature, Firefox will search all of #pref_OPACUserJS - even if the text you're searching for is not visible on the page. When you hit "Click to edit" you get about 16 lines of OPACUserJS on the screen, but if you've got 500 lines in OPACUserJS and the text your searching for is on line 300, "Find in this page..." will scroll you down to line 300. If you're in 19.05 and follow these same steps, when you "Click to edit" you're no longer opening the textarea for #pref_OPACUserJS. The Code Mirror input area is a div styled as .CodeMirror.cm-s-default.CodeMirror-wrap and when you hit "Click to edit" you will get about 18 lines of OPACUserJS and only those 18 lines are searchable using "Find in this page...". Code Mirror has two searh addons (search.js and searchcursor.js) that could be added that would allow users to put the cursor in the Code Mirror div, type CTRL-F and search through all lines in the Code Mirror div. I think those addons would be a good addition to Koha. George
(In reply to George Williams (NEKLS) from comment #3) > when you hit "Click to edit" you will get about 18 lines of OPACUserJS and > only those 18 lines are searchable using "Find in this page...". Thanks for the clarification!
Created attachment 97747 [details] [review] Bug 24025: Make CodeMirror content searchable TEST PLAN: 1. Have a system pref like OPACUserJS will plenty of content. 2. Search for some with CTRL + F that is below the scroll 3. It is not findable. 4. Apply patch, restart_all, and clear your browser cache. 5. Reload the sys pref and try again, you should be able to search through everything. 6. Rejoice!
Created attachment 97748 [details] [review] Bug 24025: Make CodeMirror content searchable Signed-off-by: Barbara Johnson <barbara.johnson@bedfordtx.gov>
I tested this patch with OPACUserJS, OPACUserCSS, IntranetUserJS, IntranetUserCSS and RestrictedPageContent. It worked for all of them.
Created attachment 97755 [details] [review] Bug 24025: Make CodeMirror content searchable Signed-off-by: Barbara Johnson <barbara.johnson@bedfordtx.gov> Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Nice work everyone! Pushed to master for 20.05
Pushed to 19.11.x branch for 19.11.03
backported to 19.05.x for 19.05.08
Enhancement will not be backported to 18.11.x series.