StealThis .dev

Wiki — Revision History / Diff View

A MediaWiki-style revision history and diff viewer built with plain HTML, CSS, and vanilla JavaScript. Each revision row shows a timestamp, editor avatar, edit summary, byte delta, and tags like minor, revert, or bot. Radio selectors pick an older and newer revision, and the comparison panel renders a live line-by-line diff with word-level highlighting. Toggle between inline and side-by-side layouts, restore any version with a toast confirmation, and filter out minor or bot edits.

فتح في المختبر
html css vanilla-js
الأهداف: JS HTML

الكود

Revision History / Diff View

A clean, MediaWiki-flavoured revision history for a fictional encyclopedia article — Aurora DB, a multi-region storage engine. The page keeps the familiar wiki chrome: a persistent left sidebar with article and tool links, a search bar with a / hotkey, and a breadcrumb trail. The history itself is an ordered, newest-first list where every row carries a monospace timestamp, the editor’s avatar and name, the edit summary, a colored byte-delta pill (green for additions, red for removals), the resulting page size, and status tags such as minor, revert, bot, or new.

Each row exposes two radio buttons — old and new — exactly like MediaWiki’s history page. Pick an older and a newer revision and the engine normalizes their order automatically, then Compare selected revisions renders the diff below. The diff is computed live with a longest-common-subsequence line algorithm, so added and removed lines are detected from the underlying article text rather than hard-coded. Changed lines get word-level highlighting, with struck-through red marks for removed words and green marks for added ones.

The comparison panel toggles between an inline unified view and a side-by-side split view, each with line gutters and a per-revision header. A Restore this version button fires a toast confirming the rollback, and checkbox filters let you hide minor edits or bot edits to declutter long histories. Everything is keyboard-accessible with visible focus rings, semantic landmarks, and a sidebar that collapses into a drawer on narrow screens.

Illustrative UI only — fictional articles, products, and data.