Eric Cornelissen
3a480e4ab0
perf: check hljs is not null only once
...
Update the `highlightCode` method of `Diff2HtmlUI` to check if the hljs
reference is null only once (at the start). This address the "HACK"
comments by using a locally scoped variable for hljs. This way,
TypeScript is able to deduce that, after the initial null-check, hljs is
in fact not null.
2022-11-02 22:43:23 +01:00
Rodrigo Fernandes
6db4aae9e5
Merge pull request #456 from ericcornelissen/455-sticky-file-headers
...
Implement support for sticky file headers
2022-11-01 00:14:45 +00:00
Eric Cornelissen
4dae65d5c7
feat: enable sticky file headers by default
...
Update the stickyFileHeaders default value to `true` so that it is
enabled by default. Also correct the name of this option in the
documentation by adding the missing trailing "s".
2022-10-31 09:47:31 +01:00
Rodrigo Fernandes
5ca9d22276
fix side by side margins and highlight usage of object instead of map
2022-10-30 20:31:33 +00:00
Eric Cornelissen
7d4a5dce6f
feat: sticky file headers
...
Add support for sticky file headers by adding a `stickyFileHeaders`
option to the `Diff2HtmlUI`. By default this feature is disabled. Also
document this option in the README.
The feature is implemented through an optional CSS class on top of the
pre-existing `.d2h-file-header` class. The new class is added on all
file headers if the option is set to `true` (or the `stickyFileHeaders`
method is called).
This class, `.d2h-sticky-header`, has the minimum amount of styling to
get the desired effect. The `position` and `top` values make the headers
stick to the top as long as the wrapper is in the view. The `z-index`
value is needed to ensure the header is displayed over all other content
in the wrapper. In particular, from my testing in Firefox (106.0.2), the
line numbers would display over the header if the `z-index` value isn't
set.
2022-10-30 13:05:53 +01:00
Rodrigo Fernandes
5373ae180b
add support for language override
2022-10-23 18:26:19 +01:00
Rodrigo Fernandes
e44b4b1363
fix: Add language mappings for highlight.js
2021-09-03 23:26:31 +01:00
Rodrigo Fernandes
6572b68bf2
bump: Update dependencies
2021-07-23 21:50:00 +01:00
Pierric Cistac
7668889493
fix: only display "Viewed" checkbox if fileContentToggle is set
2021-03-01 17:17:08 -05:00
Rafael Cortês
242fc5ae7b
feature: Add selected state style
2021-01-23 22:32:50 +00:00
Rafael Cortês
8ee76bf44b
clean: Refactor function to toggle file contents
2021-01-23 22:16:25 +00:00
Rafael Cortês
316803df77
feature: Hide viewed files
2021-01-23 15:07:14 +00:00
Rodrigo Fernandes
426d9ed2a5
bump: Update dependencies
2020-08-15 15:09:15 +01:00
Rodrigo Fernandes
ae91dcedd0
bump: Update highlight.js
2020-05-09 12:36:23 +01:00
Rodrigo Fernandes
76fb5227af
fix: Add missing dot in class query selector
2020-03-10 18:16:04 +00:00
Rodrigo Fernandes
ee58e2d700
feature: Implement smart selection in CSS
2020-02-09 16:08:58 +00:00
Rodrigo Fernandes
076e14400b
clean: Remove as type casts and use runtime typechecks with fallback when possible
2020-01-25 23:49:53 +00:00
Rodrigo Fernandes
42c8e26ff4
clean: Add typings for highlight.js languages
2020-01-12 02:24:16 +00:00
Josh Goldberg
eca5b3cfd8
Point of comparison for export = hljs types
2020-01-11 00:14:41 -05:00
Rodrigo Fernandes
db48e96dca
Merge pull request #274 from rtfpessoa/improve-highlightjs-types
...
clean: Improve highlight.js types
2020-01-10 22:49:38 +00:00
Rodrigo Fernandes
8b5111f8de
clean: Improve diff2html-ui APIs for standalone usage
2020-01-08 22:40:46 +00:00
Rodrigo Fernandes
3c3f528815
clean: Improve highlight.js types
2020-01-05 23:46:32 +00:00
Rodrigo Fernandes
dc9c866041
clean: Improve build configurations
2020-01-01 19:51:36 +00:00
Rodrigo Fernandes
4200bd7a3b
refactor: Move types and use enums
2019-12-22 18:00:50 +00:00
Rodrigo Fernandes
f72ee2ea46
wip: tweaks to website
2019-12-22 18:00:48 +00:00
Rodrigo Fernandes
4f607633dd
wip: Code and Tests working
2019-12-22 18:00:45 +00:00
Rodrigo Fernandes
a8b9b2b49a
refactor: Initial migration to typescript
2019-12-22 17:58:43 +00:00
Rodrigo Fernandes
523f2109fc
Expose synchronised scroll in the UI helper api
2017-01-15 18:36:12 +00:00
Rodrigo Fernandes
22b9783d07
Update hljs to 9.8.0
2016-12-11 15:22:08 +00:00
Rodrigo Fernandes
2a18c91e70
Add another way to recognize binary file names
2016-10-08 15:55:30 +01:00
Rodrigo Fernandes
d3b053cae0
Force inputFormat on ui helper since it is always json
2016-09-18 22:06:29 +01:00
Rodrigo Fernandes
2f53bf777e
Use ESLint instead of JSCS
2016-07-12 13:47:29 +01:00
Rafael Cortês
90c9d08744
Add synchronised horizontal scroll
2016-05-21 23:24:52 +01:00
Rodrigo Fernandes
978e54ab64
Extract highlight.js internal api code to its own file
2016-05-14 11:30:34 +01:00
Rodrigo Fernandes
93721e7e98
Add hljs class manually
2016-05-09 18:21:50 +01:00
Rodrigo Fernandes
73999bb782
Keep one state for old and another for the new diff
2016-05-09 11:15:57 +01:00
Rodrigo Fernandes
719b1cde71
Fix class names on highlighted elements
2016-05-09 10:50:46 +01:00
Rodrigo Fernandes
affd71eca0
Fix highlight for multiline elements
...
* Now highlight should be perfect except for cases where the diff
context is not enough to understant what is the code
2016-05-09 00:08:05 +01:00
Ivan Vorontsov
8c50a590b0
Quality gate fixes, part 2
2016-05-01 22:33:55 +03:00
Ivan Vorontsov
12b2ee9356
Test fixes.
2016-05-01 22:26:10 +03:00
Ivan Vorontsov
619b43ffa4
Implemented separated column selection through javascript clipboard hook.
2016-05-01 22:02:11 +03:00
Rodrigo Fernandes
95322eb87c
Update jscs, jquery and highlight.js
2016-04-25 18:25:39 +01:00
Rodrigo Fernandes
465dde689a
Fix repeated variable name in same scope (thanks Codacy)
2016-02-24 00:13:43 +00:00
Rodrigo Fernandes
d6a03668c4
Fix line wrapping
2016-02-21 16:40:22 +00:00
Rodrigo Fernandes
adc4b629c1
Prepare for nunjucks release
2016-02-21 14:45:50 +00:00
Rodrigo Fernandes
7acee5186b
Add url hashtag for file summary state override
2016-02-12 23:11:59 +00:00
Rodrigo Fernandes
71de8ea7f1
Gather file languages from the html
2016-02-09 21:26:22 +00:00
Rodrigo Fernandes
43666f655a
Fix file summary switch
...
Introduce diff2html-ui to perform any ui anymations or dynamic changes
like hightlight or animations.
2016-02-07 14:19:23 +00:00