diff options
| author | Craig Leinoff <leinoff@un.org> | 2014-01-07 14:10:38 -0500 |
|---|---|---|
| committer | Craig Leinoff <leinoff@un.org> | 2014-01-07 14:10:38 -0500 |
| commit | 05e67a227cabe6e2b0ddefae13570465b5de7ce4 (patch) | |
| tree | 8ec8e138ee4f33fca390171050d3b8f7cb2d559b /lib/style-applicator.js | |
| parent | 3a875e79c03731cb761e040e0647348a8df0a67f (diff) | |
Factoring out style-applicator.js to enduser.
Diffstat (limited to 'lib/style-applicator.js')
| -rw-r--r-- | lib/style-applicator.js | 30 |
1 files changed, 0 insertions, 30 deletions
diff --git a/lib/style-applicator.js b/lib/style-applicator.js deleted file mode 100644 index d6d909d..0000000 --- a/lib/style-applicator.js +++ /dev/null @@ -1,30 +0,0 @@ -exports.StyleApplicator = StyleApplicator; - -function StyleApplicator(options) { - styleApplicatorOptions = options.styleApplicator || {}; - - function processDocumentStyles(document) { - for (var i = 0; i < document.value.children.length; i++) { - var element = document.value.children[i]; - switch (element.type) { - case 'paragraph': - document.value.children[i] = processParagraphStyles(document.value.children[i]); - break; - } - } - return document; - } - - function processParagraphStyles(element) { - if (!element.styleName) { - if (styleApplicatorOptions.alignment && element.alignment) { - element.styleName = element.alignment+"Aligned"; - } - } - return element; - } - - return { - processDocumentStyles: processDocumentStyles - } -}
\ No newline at end of file |
