From 044442b0d73619d592d2a6472d16597c23b2cf0f Mon Sep 17 00:00:00 2001 From: Dolan Date: Mon, 25 Jun 2018 19:50:19 +0100 Subject: [PATCH] Add footnote classes --- .../run/continuation-seperator-run.ts | 10 ++++++ .../footnote/run/continuation-seperator.ts | 7 ++++ .../footnotes/footnote/run/reference-run.ts | 35 +++++++++++++++++++ .../footnotes/footnote/run/seperator-run.ts | 10 ++++++ src/file/footnotes/footnote/run/seperator.ts | 7 ++++ 5 files changed, 69 insertions(+) create mode 100644 src/file/footnotes/footnote/run/continuation-seperator-run.ts create mode 100644 src/file/footnotes/footnote/run/continuation-seperator.ts create mode 100644 src/file/footnotes/footnote/run/reference-run.ts create mode 100644 src/file/footnotes/footnote/run/seperator-run.ts create mode 100644 src/file/footnotes/footnote/run/seperator.ts diff --git a/src/file/footnotes/footnote/run/continuation-seperator-run.ts b/src/file/footnotes/footnote/run/continuation-seperator-run.ts new file mode 100644 index 0000000000..4cf3ad2d21 --- /dev/null +++ b/src/file/footnotes/footnote/run/continuation-seperator-run.ts @@ -0,0 +1,10 @@ +import { Run } from "file/paragraph"; +import { ContinuationSeperator } from "./continuation-seperator"; + +export class ContinuationSeperatorRun extends Run { + constructor() { + super(); + + this.root.push(new ContinuationSeperator()); + } +} diff --git a/src/file/footnotes/footnote/run/continuation-seperator.ts b/src/file/footnotes/footnote/run/continuation-seperator.ts new file mode 100644 index 0000000000..6e9cc87c77 --- /dev/null +++ b/src/file/footnotes/footnote/run/continuation-seperator.ts @@ -0,0 +1,7 @@ +import { XmlComponent } from "file/xml-components"; + +export class ContinuationSeperator extends XmlComponent { + constructor() { + super("w:continuationSeparator"); + } +} diff --git a/src/file/footnotes/footnote/run/reference-run.ts b/src/file/footnotes/footnote/run/reference-run.ts new file mode 100644 index 0000000000..ef40d37608 --- /dev/null +++ b/src/file/footnotes/footnote/run/reference-run.ts @@ -0,0 +1,35 @@ +import { Run } from "file/paragraph/run"; +import { Style } from "file/paragraph/run/style"; +import { XmlAttributeComponent, XmlComponent } from "file/xml-components"; + +export interface IFootNoteReferenceRunAttributesProperties { + id: number; +} + +export class FootNoteReferenceRunAttributes extends XmlAttributeComponent { + protected xmlKeys = { + id: "w:id", + }; +} + +export class FootnoteReference extends XmlComponent { + constructor(id: number) { + super("w:footnoteReference"); + + this.root.push( + new FootNoteReferenceRunAttributes({ + id: id, + }), + ); + } +} + +export class FootnoteReferenceRun extends Run { + constructor(id: number) { + super(); + + this.properties.push(new Style("FootnoteReference")); + + this.root.push(new FootnoteReference(id)); + } +} diff --git a/src/file/footnotes/footnote/run/seperator-run.ts b/src/file/footnotes/footnote/run/seperator-run.ts new file mode 100644 index 0000000000..17cc69d8ec --- /dev/null +++ b/src/file/footnotes/footnote/run/seperator-run.ts @@ -0,0 +1,10 @@ +import { Run } from "file/paragraph"; +import { Seperator } from "./seperator"; + +export class SeperatorRun extends Run { + constructor() { + super(); + + this.root.push(new Seperator()); + } +} diff --git a/src/file/footnotes/footnote/run/seperator.ts b/src/file/footnotes/footnote/run/seperator.ts new file mode 100644 index 0000000000..e6038e33ad --- /dev/null +++ b/src/file/footnotes/footnote/run/seperator.ts @@ -0,0 +1,7 @@ +import { XmlComponent } from "file/xml-components"; + +export class Seperator extends XmlComponent { + constructor() { + super("w:separator"); + } +}