MMOframework
Pourquoi l'IA Playground Bibliothèques Documentation Rechercher Agence
FR EN
Index

mmo-diff

1 symbole · générée le 27 Oct 2026

element

mmo-diff

mmo-diff.jhs:1

A 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.

<mmo-diff repository commit from to path layout="split" context="3" whitespace url></mmo-diff>
Étend
CustomShadowElement
From mmo.git's DiffController (`MMO.git.config.url`): `repository` with `commit`, or `from` and `to` (no `to`: the working tree). Or from two texts, without git: `compare`. Each file is read when it scrolls into view; one of more than 1500 changed lines waits for a click.
<mmo-diff repository="mmo.git" from="v3.0.1" to="develop"></mmo-diff> <mmo-diff repository="mmo.git" commit="b93d05f" path="src"></mmo-diff>

Index

repositorythe name DiffController knows the repository by (its sources)
commitone commit's changes
fromthe old revision of a range
tothe new revision of a range; none: the working tree
pathonly this path (a file or a folder)
layoutsplit (the default) or unified
contexthow many unchanged lines around each change (3)
whitespaceignore: leave out the changes in whitespace alone
urlDiffController's base url; none: MMO.git.config.url
effectiveLayout readonly accessorThe 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) asyncShow the diff of two texts, without git: a page's two revisions, two versions of a file.
load() asyncRead 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.jhs

the name DiffController knows the repository by (its sources)

repository

to

mmo-diff.jhs

the new revision of a range; none: the working tree

to

layout

mmo-diff.jhs

split (the default) or unified

layout="split"

context

mmo-diff.jhs

how many unchanged lines around each change (3)

context="3"

whitespace

mmo-diff.jhs

ignore: leave out the changes in whitespace alone

whitespace

url

mmo-diff.jhs

DiffController's base url; none: MMO.git.config.url

url

Propriétés1

effectiveLayout

readonlyaccessormmo-diff.jhs:74

The layout drawn: layout, unless the element is too narrow for two sides.

get effectiveLayout()
Type
string

Méthodes18

scheduleReload()

mmo-diff.jhs:79

[internal] reload once, after every attribute set in the same turn

scheduleReload()

compare(oldText, newText, options)

asyncmmo-diff.jhs:100

Show the diff of two texts, without git: a page's two revisions, two versions of a file.

async compare(oldText, newText, options = {})
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)
retournePromise<void>

load()

asyncmmo-diff.jhs:121

Read the diff the attributes name, from DiffController, and draw it.

async load()
retournePromise<void>

query()

mmo-diff.jhs:148

[internal] @return {Object} the query of the attributes

query()

loadFile(block, force)

asyncmmo-diff.jhs:156

[internal] read a file's lines and texts, then draw them

async loadFile(block, force = false)
block
force = false

drawFile(block, data, language)

asyncmmo-diff.jhs:175

[internal] draw a file's lines in its block

async drawFile(block, data, language)
block
data
language

redraw()

mmo-diff.jhs:185

Draw every file again: after a change of layout.

redraw()

focus(hash)

mmo-diff.jhs:206

Fade the lines of the commits but $hash.

focus(hash)
hash?string

toolbar(title)

mmo-diff.jhs:215

[internal] the bar above the diff: what it is, the layout, whitespace

toolbar(title)
title

fileList(files, blocks)

mmo-diff.jhs:259

[internal] the list of the files, to jump to one

fileList(files, blocks)
files
blocks

fileBlock(file, i)

mmo-diff.jhs:268

[internal] a file's block: its header, then its lines once read

fileBlock(file, i)
file
i

statusLetter(file)

mmo-diff.jhs:285

[internal] A, M, D, R or C

statusLetter(file)
file

status(text, error)

mmo-diff.jhs:298

[internal] a line saying what is going on

status(text, error = false)
text
error = false