555 Commits
Author SHA1 Message Date
Jos van den Oever dd2bc67012 Use new options of closure compiler.
Each option now has its own line to make a change in settings more visible.
2015-06-01 08:53:42 +02:00
Jos van den Oever b8ad5b3889 Upgrade to Closure Compiler 20150505.
We are now using our own copy of the externs to deal with differences
of opinion on best typing of types.
2015-06-01 08:53:35 +02:00
Friedrich W. H. Kossebau be0969b526 Make odf.Formatting's buildStyleChain() not ignore root containers 2015-04-02 11:49:03 +02:00
Friedrich W. H. Kossebau 72ffb2e070 Inline modifyAnnotations in OdfCanvas for simpler code 2015-03-31 15:57:20 +02:00
Friedrich W. H. Kossebau f632956f80 In OpRemoveAnnotation just drop markup for the one annotation removed 2015-03-31 15:57:20 +02:00
Friedrich W. H. Kossebau 3947a38385 Support adding annotations to AnnotationViewManager in batches 2015-03-31 15:57:20 +02:00
Friedrich W. H. Kossebau b340d2b9af Extend core.DomUtils.removeUnwantedNodes with optional parameter shouldSkip 2015-03-23 13:28:07 +01:00
Friedrich W. H. Kossebau 434a18a90d Add core.DomUtils.removeAllChildNodes() 2015-02-20 23:18:34 +01:00
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
Lukas Reschke 9d170f8fe1 Sanitize file-names
Otherwise a DOM-based XSS is possible.
2014-12-19 11:14:37 +01:00
Philip Peitsch 018448d792 Extract ODF field highlighting into standalone view
As per design discussed in issue #816. Extracting this into a separate
view makes it optional for consumers to use (or potentially further
customize).

Fixes #816.
2014-09-18 00:38:28 +10: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
Philip Peitsch d6ced212b0 Migrate per-node checks out of TextPositionFilter
Moving these checks into a node filter ensures it is only required
once per node, rather than once per node-position.

This results in a 60% improvement in position iteration speed.
2014-09-12 09:21:22 +10:00
Philip Peitsch a389f71108 Add additional ODF-used namespaces 2014-09-11 15:32:31 +10:00
Philip Peitsch b88bb9b0a4 Visually distinguish fields from non-field text regions 2014-09-11 15:32:29 +10:00
Philip Peitsch 29f228a9f3 Support selection & deletion of more ODF fields
* Includes a tool to help parse the RNG to figure out text containers
* Add demonstration section to visual-tests document

Fixes #772
2014-09-11 15:32:27 +10:00
Philip Peitsch 6aa01c682e Optimize all existing uses of getElementsByTagNameNS
Transformed all read-only uses to use node.getElements*. Any loop that
immediately modifies the nodes in the list has been updated to use the
DomUtils.getElements* version.
2014-09-11 15:10:41 +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
Friedrich W. H. Kossebau 742a0fc3ac Make template-type-state of document setable and queryable 2014-08-15 11:48:19 +02:00
Friedrich W. H. Kossebau 1b9b4c8d8d Extend OdfContainer.DocumentType with template versions 2014-08-15 11:48:19 +02:00
Satvik Kumar b02b461e60 Remove style element functions from OdtDocument
Removed getStyleElement, getParagraphStyleElement and
getParagraphStyleAttributes from OdtDocument as these functions simply
redirect to their implementations in odf.Formatting.
2014-08-13 23:20:15 +10: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
Philip Peitsch 6f5abf29b4 Revert incorrect annotation scroll attempt from 9034648
Implementation would scroll to *any* annotation rather than
just annotations created by the local member.
2014-08-07 20:52:08 +10:00
Friedrich W. H. Kossebau d56cef9ac8 more odf.Formatting.StyleData/AppliedStyle typing instead of Object 2014-08-06 15:17:09 +02:00
Philip Peitsch 9034648042 Scroll the annotation node into view after creation
Makes annotation insertion feel cleaner as the user can now see the
complete annotation on insertion.

Fixes #486
2014-08-05 21:26:28 +10:00
Philip Peitsch c845342406 Extract viewport management logic into standalone system
Simplifies the caret class, and allows more exotic view configurations
to be inserted without breaking core code.

As a bonus, the new Viewport class is able to scroll arbitrary
rectangles into view.
2014-08-05 21:26:27 +10:00
Friedrich W. H. Kossebau 5edad21b4b Create CSS rules for the attributes presentation:display-* 2014-07-25 16:55:33 +02:00
Joachim Bauch 5714fffe3a Add styles for nested "draw:*" elements when cloning master pages. 2014-07-24 18:21:19 +02:00
Friedrich W. H. Kossebau 7ec7578137 Fix outline elements sneak from master pages into the shadow copies 2014-07-22 19:48:18 +02:00
Friedrich W. H. Kossebau 40c43e4d97 parentElement is not defined on non-Element nodes in IE10
To have a "blanket rule", just use parentNode everywhere to prevent future problems,
as it is equivalent to parentElement for all practical usages.
2014-07-16 15:15:13 +02:00
Satvik Kumar 7b1cc1acad Remove dead code from OdfCanvas and OdfUtils
The removed code was intended to implement continue list functionality.
However this code no longer worked due to a regression introduced in commit 3ae9e0c.

As I have refactored this area and implemented the continue list
functionality in the new list styles class this old code is no longer
required.

The removed code in OdfCanvas also made use of the
getFirstNonWhitespaceChild function in OdfUtils and the removed code was
the last remaining usage of it. As it is preferable to make use of DOM API
calls which give us the desired behaviour such as
element.firstElementChild I have removed this function.
2014-07-12 03:14:18 +10:00
Satvik Kumar de20bfca2a Implement continued numbering
This adds support for the text:continue-numbering and text:continue-list
attributes. The text:continue-numbering attribute specifies whether to
continue the immediately preceding list if it has the same style.

http://docs.oasis-open.org/office/v1.2/os/OpenDocument-v1.2-os-part1.html#attribute-text_continue-numbering

The text:continue-list attribute specifes the unique identifier of a list
to continue numbering from in the document. These must also have the same
style.

http://docs.oasis-open.org/office/v1.2/os/OpenDocument-v1.2-os-part1.html#attribute-text_continue-list

https://tools.oasis-open.org/issues/browse/OFFICE-3558
2014-07-12 03:14:18 +10:00
Satvik Kumar 88c88c9e43 Provide each text:list with a unique CSS counter
Giving each list a unique counter allows us to implement continued
numbering functionality while avoiding unexpected numbering due to how CSS
counter values are scoped to an elements sibilings or children.
2014-07-12 03:14:17 +10:00
Satvik Kumar e9d57841a2 Support multi level list numbering
Implemented a changed list counter setup where each list level has its own
counter. This is to support behaviour defined where you can display only a
subset of the list numbers.

This is defined here:
http://docs.oasis-open.org/office/v1.2/os/OpenDocument-v1.2-os-part1.html#__RefHeading__1418890_253892949
2014-07-12 02:58:19 +10:00
Satvik Kumar b97acbabf2 Refactor calculation of CSS content for lists
Moved the processing of the list style to get the content rule into a
separate method so it can be re used for continue list styles. Also
ensured that the new getContentRule function returns a complete rule with
the semicolon on the end.
2014-07-12 02:58:18 +10:00
Aditya Bhatt c95ff2d0c3 Fix crash when certain list style elements are not present.
Specifically:

1. No style:list-level-properties is present.
2. No style:list-level-label-alignment child of that is present.
   In this case, it simply falls back to default zero margins and
   bullet widths.

Previously this would simply not load documents which did not come
with this optional element in a list style.

Layout tests and CSS generation tests are added for both cases.
2014-07-11 12:13:55 +02:00
Satvik Kumar 5775026be8 Added type information to applied styles calculation
The returned object from the applied styles calculation did not have
specific type information for Closure Compiler so I have added some
typedefs that describe the returned object.
2014-07-02 17:09:25 +10:00
Aditya Bhatt 82ae28fd60 Fix closure annotations for DomUtils.getNodesInRange and
OdfUtils.getTextNodes.
2014-06-19 16:00:53 +02:00
Philip Peitsch 93f8526849 Don't discard highlighted annotations when merging paragraphs
All text nodes that are children of grouping elements should be counted
as ODF content.

Fixes #666.
2014-06-19 22:36:26 +10:00
Philip Peitsch efe7a2b499 Log the stack trace when a LoadingQueue task throws an error
Fixes #658.
2014-06-18 19:12:58 +10:00
Philip Peitsch 06ecc7d8c8 Implement OpMergeParagraph
In order to improve the OT-ability of text and paragraph removal
with other operations, the merge behaviour has been extracted.

The logic for building up the necessary remove operations has
been encapsulated in TextController for now as all uses pass
through this point still.
2014-06-17 03:13:00 +10:00
Philip Peitsch e0b97e1dd4 Split CollapsingRules out of OpRemoveText
This functionality will be shared with the soon-to-exist merge paragraph
operation.
2014-06-17 02:18:02 +10:00
Jos van den Oever 27815c5707 Wait with sending statereadychange until all items from the load queue have been handled. 2014-06-11 14:50:23 +02:00
Aditya Bhatt 1467ea6d2a Introduce "Review Mode".
Let DirectFormattingController obey this "edit.reviewMode"
constraint by not creating any operations or processing any
action to format text when the cursor is not within the local
user's annotation.

Signals are exposed to toolbar widgets so they may
enable/disable themselves on the fly depending on the cursor
context.
2014-06-06 15:11:29 +02:00
Jos van den Oever d6b1d212e5 Remove event handler attributes: attributes that have no namespace and a name starting with on. 2014-06-04 13:35:06 +02:00
Jos van den Oever 7ecc520729 Remove dangerous <script/> and <style/> tags before inserting XML into the dom.
<script/> tags are executed when inserted into the DOM. This is unwanted, so they are are removed before the XML is inserted into the DOM.
In addition, <style/> elements can be used to execute code, so they are removed too.
2014-06-04 13:35:06 +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