Protected
constructorCreate a new ParsoidDocument instance.
Protected
$documentThe JQuery (window.$) object of the iframe.
Protected
documentThe Document object of the iframe.
Protected
elementA set of element arrays indexed by their MediaWiki RDFa type. For example, this array may include the key "Transclusion" from the RDFa type "mw:Transclusion".
Protected
etagThe ETag of the loaded Parsoid document.
Protected
fromtrue
if the page exists on the wiki.
Protected
iframeThe frame element used by this ParsoidDocument instance.
Protected
observerA MutationObserver that watches the document for DOM changes.
Protected
pageThe page currently loaded.
Protected
restA relative URI to the root of the RESTBase instance that the page was loaded from.
Protected
revisionThe current revision. Only set if fromPage
/loadPage
was used.
Static
Readonly
NodeStatic
blankA blank Parsoid document, with a section 0.
Static
defaultThe default document to create if a page was not found.
true
if the page is a redirect. false
if otherwise.
Constructs the ParsoidDocument#elementIndex from the current document.
Deletes all elements that have the same about
attribute as the given element.
This effectively deletes an element, be it a transclusion set, file, section,
or otherwise.
Finds the element with the "data-mw" attribute containing the element passed into the function.
The element to find the parent of. This must be a member of the ParsoidDocument's document.
The element responsible for showing the given element.
Finds a template in the loaded document.
The name of the template to look for.
Use the href instead of the wikitext to search for templates.
A list of elements.
Get the element index of this ParsoidDocument.
Get the IFrame element of this ParsoidDocument.
Get HTML elements that are associated to a specific Parsoid node using its
about
attribute.
The node to get the elements of
All elements that match the about
of the given node.
Protected
getGets the <section>
HTMLElement given a section ID.
The ID of the section
The HTMLElement of the section. If the section cannot be found, null
.
Loads a wiki page with this ParsoidDocument.
The page to load.
The revision ID of the page to load
Options for frame loading.
Optional
allowSet to false
to avoid loading a blank document if the page does not exist.
Optional
followWhether to follow page redirects or not.
Optional
reload?: booleanWhether the current page should be discarded and reloaded.
Optional
requestOptions to pass to the fetch
request.
Optional
restA relative or absolute URI to the wiki's RESTBase root. This is
/api/rest_
by default, though the window.restBaseRoot
variable
can modify it.
Notify the user of a document loading error.
An error object.
Static
fromCreates a new ParsoidDocument from a blank page.
The name of the page.
Optional
restBaseUri: stringStatic
fromHTMLCreate a new ParsoidDocument instance from plain HTML.
The name of the page.
The HTML to use.
Optional
restBaseUri: stringThe relative URI to the RESTBase instance to be used for transforms.
Set to false
to avoid wrapping the HTML within the body.
Static
fromCreate a new ParsoidDocument instance from a page on-wiki.
The page to load.
The revision ID of the page to load
Options for frame loading.
Optional
allowSet to false
to avoid loading a blank document if the page does not exist.
Optional
followOptional
reload?: booleanWhether the current page should be discarded and reloaded.
Optional
requestOptional
restStatic
fromCreates a new ParsoidDocument from wikitext.
The page of the document.
The wikitext to load.
Optional
restBaseUri: stringGenerated using TypeDoc
A class containing an HTMLIFrameElement along with helper functions to make manipulation easier.