Bug 13829 - Syntax highlighter on source code textareas
Summary: Syntax highlighter on source code textareas
Status: RESOLVED DUPLICATE of bug 21582
Alias: None
Product: Koha
Classification: Unclassified
Component: System Administration (show other bugs)
Version: master
Hardware: All All
: P5 - low enhancement (vote)
Assignee: Bugs List
QA Contact: Testopia
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2015-03-12 17:09 UTC by Pablo AB
Modified: 2019-03-29 14:48 UTC (History)
4 users (show)

See Also:
Change sponsored?: ---
Patch complexity: ---
Documentation contact:
Documentation submission:
Text to go in the release notes:
Version(s) released in:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Pablo AB 2015-03-12 17:09:48 UTC
Some textareas contain source code. For example SQL reports (not even monospace font) and some sysprefs (4 with JS, 18 with HTML). Would be a nice (and pretty easy) enhancement to offer syntax highlight on all of them, with very little page overload. There are a lot of alternatives:
- SyntaxHighlighter
- Highlight.js
- Google Code Prettify (like StackOverflow)
- Snippet
- PrismJs
Comment 1 paxed 2015-03-13 06:55:34 UTC
(In reply to Pablo AB from comment #0)
> Some textareas contain source code. For example SQL reports (not even
> monospace font)

For monospace font in SQL report textarea, add this to IntranetUserCSS:

#rep_guided_reports_start textarea#sql { font-family: monospace; }
Comment 2 Pablo AB 2015-03-13 11:53:39 UTC
Thanks! I had already done it jQuery, but is better your choice:
$('#rep_guided_reports_start textarea#sql').css("font-family", "monospace" );

BTW, I thought jquery/plugins/jquery.highlight-3.js could help me, but is a very basic highlight. Maybe we can use a better text highlighter jquery plugin that do the full job (for both search and source code syntax highlight).

Also (and this could be another enhancement) I wonder if there is a good reason why we don't have (AFAIK) a syspref to add anything to head HTML tag to both opac and intranet. That's would let anyone to add their own jquery plugins.
Comment 3 Katrin Fischer 2019-02-28 06:52:50 UTC
We might be able to use Codemirror now for those as it's being used for the SQL reports.
Comment 4 Owen Leonard 2019-03-29 14:48:07 UTC

*** This bug has been marked as a duplicate of bug 21582 ***