From 7cf6006c1c943a82ed95bcec8af4cfdb64402c48 Mon Sep 17 00:00:00 2001 From: Dolan Miu Date: Sat, 7 May 2016 20:17:18 +0100 Subject: [PATCH] added more styles --- ts/docx/run/index.ts | 2 +- .../run/emphasis.ts => styles/formatting/run.ts} | 12 +++++++++++- ts/styles/style/index.ts | 4 ++++ 3 files changed, 16 insertions(+), 2 deletions(-) rename ts/{docx/run/emphasis.ts => styles/formatting/run.ts} (68%) diff --git a/ts/docx/run/index.ts b/ts/docx/run/index.ts index 21d94920df..5c36dce064 100644 --- a/ts/docx/run/index.ts +++ b/ts/docx/run/index.ts @@ -1,6 +1,6 @@ import {XmlComponent, Attributes} from "../xml-components"; import {RunProperties} from "./properties"; -import {Bold, Italics, Underline} from "./emphasis"; +import {Bold, Italics, Underline} from "../../styles/formatting/run"; export class Run extends XmlComponent { private properties: RunProperties; diff --git a/ts/docx/run/emphasis.ts b/ts/styles/formatting/run.ts similarity index 68% rename from ts/docx/run/emphasis.ts rename to ts/styles/formatting/run.ts index 88338fa6ce..cc0c39de33 100644 --- a/ts/docx/run/emphasis.ts +++ b/ts/styles/formatting/run.ts @@ -1,4 +1,4 @@ -import {XmlComponent, Attributes} from "../xml-components"; +import {XmlComponent, Attributes} from "../../docx/xml-components"; export class Bold extends XmlComponent { @@ -22,6 +22,16 @@ export class Italics extends XmlComponent { export class Underline extends XmlComponent { + constructor() { + super("w:u"); + this.root.push(new Attributes({ + val: true + })); + } +} + +export class Caps extends XmlComponent { + constructor() { super("w:u"); this.root.push(new Attributes({ diff --git a/ts/styles/style/index.ts b/ts/styles/style/index.ts index 6a2f6687d8..b80e234f1c 100644 --- a/ts/styles/style/index.ts +++ b/ts/styles/style/index.ts @@ -11,4 +11,8 @@ export class Style extends XmlComponent { push(styleSegment: XmlComponent): void { this.root.push(styleSegment); } +} + +export class ParagraphStyle extends XmlComponent { + } \ No newline at end of file