Journal

A Wiki Page has a journal that records the history of how the page was made and where it has traveled.

The journal lists each Action that contributed to the page being what and where it is now.

When the journal is accurate it can be replayed to recreate every version of the page through its history.

When the journal identifies sites from which it has been copied (forked) those sites will be added to the Neighborhood upon display.

See our glossary for more Names of Things.

~

The `addToJournal` function is called when the origin server response that the network operation is complete. search , code

The page journal is now accessed via a frame in the page that surrounds the frame:

We send a message to the Frame asking it to send us info about the page surrounding it. mdn

window.addEventListener("message", handler) let message = { action:"sendFrameContext" } window.parent.postMessage(message, "*")

We stop listening then process the data we got.

function handler ({data}) { if (data.action == "frameContext") { window.removeEventListener("message", handler) const {slug, item, page} = data show(page) } }

The page we show is the page on the screen which might be a ghost, maybe retrieved from history.

function show (page) { let actions = page.journal.map(item => [ item.type, item.id ]) let html = `<pre>${actions.join("\n")}</pre>` output.innerHTML = html }

Note: page.journal.[…] – the information stored must support path playback and path visualization.

We change the show function to see actions as objects. An action, i.e. a page.journal.item, has an ID, a text and a type.

Note: item.text seems to be something special.

Actions: [⇒ Updating Events and Causal Dependence]

//wiki.ralfbarkow.ch/assets/pages/snippet-template/basicjs.html?snippet-template HEIGHT 200

~

See Array.prototype.map() mdn

Element list?

item.text: Object.prototype.toString() mdn

Deserialization mdn , JSON.parse() mdn

Event-Driven System Domain

In an event-driven system, domain events are published to a *journal*. page

~