97 Commits
Author SHA1 Message Date
Friedrich W. H. Kossebau 78b3d3d486 Use consistently double-quotes to quote ODF style names etc. in CSS rules 2015-01-19 19:58:10 +01:00
Friedrich W. H. Kossebau 180c9ac839 Fix missing quotes around draw:master-page-name values used in CSS rules 2015-01-19 19:58:10 +01:00
Philip Peitsch bb56bc684c Convert odf.OdfUtils into a static singleton 2014-09-12 10:33:27 +10:00
Philip Peitsch 3172ad8dec Convert core.DomUtils into a static singleton 2014-09-12 10:17:09 +10:00
Joachim Bauch 803eea5826 Handle percentage margins.
A percentage margin (e.g. "50%") is used to specify a percentage of the parent style's margin.
2014-09-05 13:35:28 +02:00
Philip Peitsch 4c7ff86852 Implement support for style:text-position
style:text-position defines sub and super-script text properties.
2014-08-08 22:32:41 +10:00
Philip Peitsch d9abfdd901 Add support in FF for double line-through
Follows CSS3 standards. Unfortunately, only FF implements this so far.
2014-08-08 22:24:26 +10:00
Friedrich W. H. Kossebau 5edad21b4b Create CSS rules for the attributes presentation:display-* 2014-07-25 16:55:33 +02:00
Friedrich W. H. Kossebau 1e2a4a8323 Normalize license headers of the webodf.js source files
* remove @license tag (to prevent Closure compiler keeping the comment)
* use copyright@kogmbh.com email address everywhere
* remove "additional permission", to be added only to released webodf.js
* separate license header by empty line from following content
2014-06-02 12:19:05 +02:00
Philip Peitsch c35b8c4884 Remove try-catch blocks that immediately rethrow the caught exception
These effectively act as slightly expensive no-ops. There is no need
for them to be present.
2014-04-30 21:15:56 +10:00
Satvik Kumar 2cb17b7674 Refactored application of list styles
Moved the code that parses ODF lists styles and creates rules for them
into a separate object. This is done as the second step in removing
duplicate/redundant code from OdfCanvas.js around some list style
handling.
2014-03-26 13:54:15 +11:00
Satvik Kumar 15efb986e1 Refactored creation of style tree
Moved the creation of the style tree out of Styles2CSS. This is the first
step in refactoring out and fixing some duplicate list handling code in
OdfCanvas.js.
2014-03-26 13:49:07 +11:00
Jos van den Oever ad5793c70b Move the various getDirectChild functions to DomUtils.getDirectChild. 2014-03-06 13:47:11 +01:00
Jos van den Oever ed7270442f Remove loadClass calls from class files. The load system reads the dependencies from the manifest.json files now. 2014-02-07 15:38:09 +01:00
Philip Peitsch c6f27de5b7 Removed all references to node.parentElement (IE compatibility)
Internet Explorer 11 does not support this property on HTML nodes.
2013-12-12 00:59:07 +11:00
Jos van den Oever 13ecee3f46 Make Style2CSS 100% typed.
The code is much more readable now and some inefficiencies are resolved now.
E.g. in one place an array was iterated like it was an object.
The use of getElementByTagnameNS has been replaced by more efficient
getDirectChild.
2013-12-02 13:01:56 +01:00
Jos van den Oever 3665ca7607 Add more straightforward type annotations. 2013-12-02 13:01:56 +01:00
Jos van den Oever eeef808426 Add lookupPrefix function and rename confusingly named function resolvePrefix()
to lookupNamespaceURI(), which is in line with the DOM functions of the same names.
2013-11-26 16:56:02 +01:00
Jos van den Oever d85926d3f6 Add some type information fo odf.Style2CSS. 2013-11-26 16:56:00 +01:00
Jos van den Oever 2ec8acd0ae Add typing information to xmldom.XPath. 2013-11-26 16:56:00 +01:00
Friedrich W. H. Kossebau c2a795e668 Update link to repo: now https://github.com/kogmbh/WebODF/ 2013-10-23 18:20:30 +02:00
Friedrich W. H. Kossebau 508570dab8 Add copy of the AGPL3 to sources (+ add to created zip files) 2013-10-21 17:55:16 +02:00
Friedrich W. H. Kossebau 374feb9e26 In Style2CSS do not hardcode the fallback for font-family to sans-serif
Fixes the sometimes difference in what substitution font is used in the
font selector tool and what substitution font is used in the ODF document
display for fonts which are not installed on the system
2013-09-27 17:49:59 +02:00
Aditya Bhatt d22a401aaa Fix CSS generation for default styles - do not select for a style-name
attribute for matched elements.
2013-09-17 12:43:59 +02:00
Lu Li b0ca6f34d6 add graphic property mapping for border
According to OpenDocument v1.0
"The attribute draw:stroke specifies the style of the stroke on the current object."
"The attribute svg:stroke-width specifies the width of the stroke on the current object."
"The attribute svg:stroke-color specifies the color of the stroke on the current object. "
2013-08-28 09:40:18 +02:00
Lu Li da9e8a8f33 Ensure border width is no less than 1px otherwise border is not rendered. Also map 'border-model' to css property 'border-collapse' for table 2013-08-12 12:20:37 +02:00
Friedrich W. H. Kossebau 419b168b9c Unify usage of object "window" 2013-07-29 12:07:04 +02:00
Lu Li f6de4efdc7 line-height conversion fix 2013-07-29 11:44:00 +02:00
Jos van den Oever 64d57c96cf Fix issues exposed by latest JSLint. 2013-07-24 21:41:56 +02:00
Jos van den Oever 967e5c0ba0 Update closure compiler and fix ensuing problems. 2013-07-24 17:56:39 +02:00
Jos van den Oever 1dd372b23c Fix invalid css. 2013-07-10 22:49:52 +02:00
Philip Peitsch c124a6617b Removed debug log statement 2013-07-02 21:19:36 +02:00
Aditya Bhatt 9379f946e9 Add methods to parse PositiveLength, NonNegativeLength, Percentage,
fo:line-height, and fo:font-size to OdfUtils, and use them instead of
the old parseLength in Style2CSS
2013-06-20 11:46:45 +02:00
Aditya Bhatt b54a00a869 * Rename parseFontSize to parseLength
* Use that for the line height
2013-06-20 11:46:45 +02:00
Aditya Bhatt 14af210392 Handle null values of line-height 2013-06-20 11:46:45 +02:00
Aditya Bhatt 4e8e109d7c % line-height values in CSS are unreliable. Use a multiplier (1.x) type
% of value in stead of %ages.
2013-06-20 11:46:45 +02:00
Aditya Bhatt 6541e1343f Add an OdfUtils.parseFontSize function for better font size handling 2013-06-19 17:26:09 +02:00
Aditya Bhatt a66df8774b Implement support for % font sizes. 2013-06-19 17:25:13 +02:00
Jos van den Oever eecfa4d201 Remove trailing spaces and tabs. 2013-06-19 16:47:52 +02:00
Aditya Bhatt fcbc668a50 Add stroke-width and border/padding mapping 2013-06-19 14:24:22 +02:00
Aditya Bhatt 563a0e69fb * jsdoc
* handle case when bgcolor might be null
2013-06-19 13:08:49 +02:00
Aditya Bhatt b4b2f08f29 There are more than one master page styles, style pages accordingly
Documentation++
2013-06-19 13:08:49 +02:00
Aditya Bhatt 558a9bbe9b Undo bad width/height hack and now decide the page style to use by
checking the master style name
2013-06-19 13:08:49 +02:00
Aditya Bhatt 92dbaacc1d Respect the presentation:background-visible rule 2013-06-19 13:08:49 +02:00
Aditya Bhatt 9c963f2317 Use a 'none' background if no solid/hatch fill is specified 2013-06-19 13:08:49 +02:00
Aditya Bhatt 8f11dc87b5 Smarter handling of background fill-color, along with alpha channel. 2013-06-19 13:08:49 +02:00
Aditya Bhatt ba3f8a59e6 * Let drawing-page family things also be styled like a graphic.
* Frame opacity is here! (without affecting text)
2013-06-19 13:08:49 +02:00
Aditya Bhatt 29f45f5b54 Stop hardcoding dimensions for presentation pages in webodf.css, and get
these dimensions from the page style.
A new API call has been added to know the type of document
(text/presentation/spreadsheet), and this is used to decide what sort of
CSS rule to generate for page layouts.
As a little temporary hack, for slideshows, the last page style where the
height is lesser than the width is used for layouting, because for the
vast majority of presentations this holds true. This will change once we
adequately implement support for master styles.
2013-06-19 13:08:48 +02:00
Philip Peitsch f76257c81a Avoid issues with lists in fodt files
Extra whitespace nodes throw off any logic depending
on the node's firstChild being a non-whitespace element
2013-06-17 13:08:47 +10:00
Philip Peitsch d34e7f8059 Small code cleanup around style and formatting classes
* Removing dead code and cleaning up unused variables
* Corrected extern definitions for createTreeWalker and createNodeIterator
* Clarified variable names and function header for mergeRecursive
* Made getInheritedStyleAttributes able to cope with a document that lacks default style definitions for various classes
  (Theoretically all should have this, but it makes testing easier to write)
* Added missing module dependency to odf.Formatting
2013-06-14 17:40:18 +10:00