87 Commits
Author SHA1 Message Date
Friedrich W. H. Kossebau 434a18a90d Add core.DomUtils.removeAllChildNodes() 2015-02-20 23:18:34 +01:00
Friedrich W. H. Kossebau 159e8323b2 Replace some usage of innerHTML 2015-02-20 18:14:43 +01:00
Philip Peitsch 26ede808f3 Only scroll to *locally* inserted annotation
Reimplement logic to fix #486
2014-08-07 20:59:03 +10:00
Friedrich W. H. Kossebau 50e98bb255 No need to create edit info rules for the shadow cursor 2014-07-25 13:14:40 +02:00
Aditya Bhatt 5dca8a15fa Re-highlight annotations whenever an edit occurs.
* To make it less expensive, a method has been added
to AnnotationViewManager to refresh not all annotations
but only the highlights.

* This is used as a scheduled redraw task inside SessionView
to not make it a CPU hog.

* The destroy mechanism for SessionView has been restructured
to accomodate multiple asynchronous destructors.
2014-06-19 15:05:51 +02:00
Aditya Bhatt c165702542 Add a const gui.CommonConstraints, which lists
the common constraints that come with and are
respected by WebODF.

Use these constraints in all previous occurrences.
2014-06-06 15:11:32 +02:00
Aditya Bhatt 033bda34a8 Hide annotation removal buttons of other authors
when the edit.annotations.onlyDeleteOwn constraint
is enabled.
2014-06-06 15:11:32 +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
Friedrich W. H. Kossebau fd020eee3f Use Error objects in callback passed to "destroy" methods
The currently plain undefined objects are not useful at all, because
the properties are undefined.
2014-04-11 13:53:10 +02:00
Friedrich W. H. Kossebau 6232bd0917 prefix "draggable" element classname with "webodf-" 2014-03-10 15:43:48 +01:00
Friedrich W. H. Kossebau 83e50d37ed prefix "selectionOverlay" element classname with "webodf-" 2014-03-10 15:43:48 +01:00
Aditya Bhatt 0c139bd592 Only show the selection handles of the
shadow cursor and the local cursor.
2014-03-07 18:45:52 +01:00
Jos van den Oever 16220f4507 Move signalMemberUpdated, signalMemberRemoved and signalMemberAdded from ops.OdtDocument to ops.Document. 2014-02-24 15:19:05 +01:00
Jos van den Oever b3c77bf307 Move signals CursorAdded, CursorRemoved and CursorMoved to ops.Document.
This makes SvgSelectionView independent from ops.OdtDocument.
2014-02-24 15:13:13 +01:00
Jos van den Oever ff3c396aa6 Add core.Destroyable interface.
Every class that has a destroy() method now implements this interface.
2014-02-11 12:42:41 +01:00
Jos van den Oever ddcb6009eb Add a number of more precise types and remove unneeded casts. 2014-02-10 15:59:37 +01:00
Jos van den Oever 59d2e09611 Make CaretManager and SessionView 100% typed. 2014-02-08 15:57:20 +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
Friedrich W. H. Kossebau d2671e2a00 @returns -> @return 2014-01-31 15:33:43 +01:00
Philip Peitsch b501f033f0 Only re-render the selection overlay once per batch of requests
Also, decrease the maximum latency between a render request and when the
update is performed to be 0ms. The previous value of 200ms was quite
noticeable when indenting or unindenting paragraphs.
2014-01-31 10:28:14 +11:00
Aditya Bhatt 30794a6253 Switch to SVG polygons for drawing a SelectionView.
Adds an SVG overlay that takes no pointer-events,
and uses a polygon element inside to it draw
selections with stroke and fill of the user's
color.
Removes the 3 divs used previously.
2013-12-13 00:37:13 +01:00
Friedrich W. H. Kossebau 809848e752 check if localSelectionView exists in gui.SessionView.onCursorMoved, as done for localCaret 2013-12-03 17:03:55 +01:00
Aditya Bhatt cb8ff428cd Remove terrible hack for setting the dc:creator
field's text in an annotation; now that we
have first-class access to member data,
we can set this value directly within
OpAddAnnotation.
2013-11-20 18:56:47 +01:00
Aditya Bhatt e16cc38edb == Op-ify member data handling ==
* New operations: OpAddMember, OpRemoveMember,
OpUpdateMember.
* Member data is now handled in a memberDataManager
instance inside OdtDocument.
* Any operations must be executed only if a member
is present within this model.
* All polling code for member data has been removed;
colors, names, and images now instantly update
whenever a member data operation is executed.
* Added relevant entries to the OT Matrix.
2013-11-20 18:56:47 +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 941399b890 Restore insertion of annotation creator name (by fixing accidental dc|creator CSS rule overwriting) 2013-10-18 12:31:01 +02:00
Philip Peitsch 1ff4d6f9ec Upgrade from magical empty-string to const for shadow cursor memberId
In various parts of the code, the magical empty-string cursor id is used
to determine whether the object is a shadow cursor or not. Converting
this into a constant instead and removing the constructor arg prevents
some mistakes being made with this.
2013-10-16 21:43:00 +11:00
Aditya Bhatt 67f6442236 Hide the local caret when a shadowCursor selection
is being drawn
2013-10-15 11:44:24 +02:00
Aditya Bhatt 50cfc40bae Smarter rerendering of selections in SessionView:
* Unsubscribe from requests to rerender when destroying
* Use an interval-based loop of 200ms to check if a redraw
has been requested, and rerender in that case.
2013-10-15 11:44:24 +02:00
Aditya Bhatt dceba17489 Rerender visible SelectionViews when certain edits take place.
Adds a visible() method to SelectionView and rerenderSelectionViews to
SelectionViewManager.
2013-10-15 11:44:24 +02:00
Aditya Bhatt b426aab73f Add a SelectionView class that can be initialized with a cursor, a
SelectionViewManager that maintains SelectionView instances, and a
shadow cursor object that is an invisible caret-less cursor, fed to both
SessionController and SessionView, which follows the selection as it
changes.
Selections by each cursor are colored according to their memberid
2013-10-15 11:44:23 +02:00
Friedrich W. H. Kossebau 4f2d136627 In gui.SessionView.destroy() _un_subscribe from odtDocument signals 2013-09-26 11:12:06 +02:00
Friedrich W. H. Kossebau 56bcd6c6f4 fix typo in setEditInfoMarkerVisbility() 2013-09-25 22:31:51 +02:00
Friedrich W. H. Kossebau 0187905b3d Have MemberModel define the temporary data for members, not the UI 2013-09-07 17:00:58 +02:00
Friedrich W. H. Kossebau 3662d04807 Adding a destroy() method to most classes, for proper shutdown 2013-09-03 01:02:48 +02:00
Friedrich W. H. Kossebau 6bc2d30889 No longer try to get the userid in createAvatarInfoNodeMatch
Fixup to 4322b22858
2013-08-12 15:03:38 +02:00
Friedrich W. H. Kossebau 2ada2e2eaf Add more types to API documentation of gui.CaretManager & gui.SessionView 2013-08-08 14:41:23 +02:00
Friedrich W. H. Kossebau 4322b22858 Rename everything with "[Uu]ser|[Ppeople]" to "[Mm]ember"
consolidates the terms used a little
2013-08-07 18:03:19 +02:00
Aditya Bhatt 825a44affc * OpAddAnnotation that lets you create annotations. This only creates an
annotation-end node if the length of the selection > 0.
* Adds a button to the editor to add an annotation at the given cursor position
or selection
* A bad hack in AnnotationViewManager: The dc:creator of
a created annotation is initially empty because the operation has no
way to access the user model even if it knows the memberid. The
SessionView has a new rule for editinfo:memberid attributes that sets
the CSS content: attribute to the user name. AnnotationViewManager,
for now, will read this CSS property and set the text of dc:creator to
that; at least till we have a better way to access the usermodel in
the future
* Rerenders annotations when an annotation is added for tracking (like upon creation)
* SessionView gets a way to concretely specify the CSS pseudo-class for a rule (:before, :after, etc)
* enableAnnotations only allows handles annotations if the allow value
changes
* Add translation strings for annotate
2013-08-05 19:16:32 +02:00
Philip Peitsch f25d936355 Removing a cursor will now cause the associated caret to be removed
Removing the local cursor (e.g., calling SessionController.endEditing)
previously left behind an orphaned caret that would continue to receive
focus/blur commands and attempt to remain visible. This would cause an
error to be thrown after most operations.

This change turns CaretFactory into a manager that is responsible for
proper disposal of carets unpon the corresponding cursor's removal from
the document.
2013-07-26 22:26:11 +10:00
Jos van den Oever 64d57c96cf Fix issues exposed by latest JSLint. 2013-07-24 21:41:56 +02:00
Philip Peitsch cf3445e493 Added configurable option to suppress the caret when a range is selected
Various editors have inconsistent behaviour on this front.
* LibreOffice (Mac) - always blinks even with range select
* Firefox, Chrome, Word (Mac) - hides the caret on range
2013-07-24 01:26:58 +02:00
Friedrich W. H. Kossebau 78b24d2f4a remove broken disable/enableEditHighlighting
these days only results in AvatarStyleInfo missing after replay for those members
whose cursors are added during the replay and for which the userdata arrives
already before the replay is finished, so that setAvatarInfoStyle() is never
called for them (unless there is an update on the userdata, but that rarely
happens)
2013-07-04 23:04:15 +02:00
Friedrich W. H. Kossebau 55fc7ab9c6 Switch code to use Node.${XXX}_NODE instead of magic values 2013-06-17 13:49:07 +02:00
Friedrich W. H. Kossebau 1967291a69 unsubscribe SessionView for updates of the member's userdata on cursor removal, unless needed for editinfo updates 2013-04-30 12:39:27 +02:00
Friedrich W. H. Kossebau a8fab106c0 move core.EditInfo into ops namespace
e.g. relies on ops.OdtDocument, so cannot be just core
2013-04-10 11:12:42 +02:00
Friedrich W. H. Kossebau 7868d6bfa3 Move eventNotifier from ops.Session to ops.OdtDocument 2013-04-09 13:45:33 +02:00
Friedrich W. H. Kossebau 54b3a1381c move all DOM manipulation code to the ops
Also:
* merge paragraphEdited event of ops.OdtDocument into paragraphChanged event of ops.Session
* remove any event subscription/emitting from ops.OdtDocument
2013-04-09 13:44:49 +02:00
Tobias Hintze b5ebf1452b change SessionViewOptions declaration from @interface to @typedef 2013-04-09 12:41:55 +02:00