mmo-diff
1 symbole · générée le 27 Oct 2026
mmo-diff
mmo-diff.jhs:1A diff to read: the old version on the left and the new one on the right (or one after the other, unified, which a narrow screen gets anyway), line numbers in each gutter, insertions on green and removals on red, the words that changed darker, the code in its colours (Prism). Over several commits, a legend gives each commit a colour, and each changed line has the colour of the commit that made the change in its gutter: hovering a commit fades the others' lines, clicking it keeps that.
- Étend
CustomShadowElement
Index
| repository | the name DiffController knows the repository by (its sources) | |
| commit | one commit's changes | |
| from | the old revision of a range | |
| to | the new revision of a range; none: the working tree | |
| path | only this path (a file or a folder) | |
| layout | split (the default) or unified | |
| context | how many unchanged lines around each change (3) | |
| whitespace | ignore: leave out the changes in whitespace alone | |
| url | DiffController's base url; none: MMO.git.config.url | |
| effectiveLayout readonly accessor | The layout drawn: layout, unless the element is too narrow for two sides. | |
| init() | ||
| scheduleReload() | [internal] reload once, after every attribute set in the same turn | |
| compare(oldText, newText, options) async | Show the diff of two texts, without git: a page's two revisions, two versions of a file. | |
| load() async | Read the diff the attributes name, from DiffController, and draw it. | |
| query() | [internal] @return {Object} the query of the attributes | |
| loadFile(block, force) async | [internal] read a file's lines and texts, then draw them | |
| drawFile(block, data, language) async | [internal] draw a file's lines in its block | |
| redraw() | Draw every file again: after a change of layout. | |
| setLayout(layout) | ||
| focus(hash) | Fade the lines of the commits but $hash. | |
| toolbar(title) | [internal] the bar above the diff: what it is, the layout, whitespace | |
| summary(data) | [internal] what the diff covers | |
| legend() | [internal] the commits and their colours | |
| fileList(files, blocks) | [internal] the list of the files, to jump to one | |
| fileBlock(file, i) | [internal] a file's block: its header, then its lines once read | |
| statusLetter(file) | [internal] A, M, D, R or C | |
| counts(file) | [internal] +n −m | |
| status(text, error) | [internal] a line saying what is going on |
Attributs9
repository
mmo-diff.jhsthe name DiffController knows the repository by (its sources)
repository
commit
mmo-diff.jhsone commit's changes
commit
from
mmo-diff.jhsthe old revision of a range
from
to
mmo-diff.jhsthe new revision of a range; none: the working tree
to
path
mmo-diff.jhsonly this path (a file or a folder)
path
layout
mmo-diff.jhssplit (the default) or unified
layout="split"
context
mmo-diff.jhshow many unchanged lines around each change (3)
context="3"
whitespace
mmo-diff.jhsignore: leave out the changes in whitespace alone
whitespace
url
mmo-diff.jhsDiffController's base url; none: MMO.git.config.url
url
Propriétés1
effectiveLayout
readonlyaccessormmo-diff.jhs:74The layout drawn: layout, unless the element is too narrow for two sides.
- Type
string
Méthodes18
init()
mmo-diff.jhs:32scheduleReload()
mmo-diff.jhs:79[internal] reload once, after every attribute set in the same turn
compare(oldText, newText, options)
asyncmmo-diff.jhs:100Show the diff of two texts, without git: a page's two revisions, two versions of a file.
| oldText | ?string | |
| newText | ?string | |
| options = {} | Object | - language {?string} Prism's; none: from path - path {?string} the file's name, shown in its header - oldLabel {?string} what the old text is (revision 3) - newLabel {?string} what the new text is (draft) |
| retourne | Promise<void> |
load()
asyncmmo-diff.jhs:121Read the diff the attributes name, from DiffController, and draw it.
| retourne | Promise<void> |
query()
mmo-diff.jhs:148[internal] @return {Object} the query of the attributes
loadFile(block, force)
asyncmmo-diff.jhs:156[internal] read a file's lines and texts, then draw them
| block | ||
| force = false |
drawFile(block, data, language)
asyncmmo-diff.jhs:175[internal] draw a file's lines in its block
| block | ||
| data | ||
| language |
redraw()
mmo-diff.jhs:185Draw every file again: after a change of layout.
setLayout(layout)
mmo-diff.jhs:196| layout | string | split or unified |
focus(hash)
mmo-diff.jhs:206Fade the lines of the commits but $hash.
| hash | ?string |
toolbar(title)
mmo-diff.jhs:215[internal] the bar above the diff: what it is, the layout, whitespace
| title |
summary(data)
mmo-diff.jhs:227[internal] what the diff covers
| data |
legend()
mmo-diff.jhs:238[internal] the commits and their colours
fileList(files, blocks)
mmo-diff.jhs:259[internal] the list of the files, to jump to one
| files | ||
| blocks |
fileBlock(file, i)
mmo-diff.jhs:268[internal] a file's block: its header, then its lines once read
| file | ||
| i |
statusLetter(file)
mmo-diff.jhs:285[internal] A, M, D, R or C
| file |
counts(file)
mmo-diff.jhs:291[internal] +n −m
| file |
status(text, error)
mmo-diff.jhs:298[internal] a line saying what is going on
| text | ||
| error = false |