Commit Graph
67 Commits
Author SHA1 Message Date
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
Philip Peitsch 1ecc0ec1f9 JSDoc cleanups and dead code removal
* Removed some unused variables and methods
* Removed redundant variable initialisation
* cursorNode in OdtCursor and Cursor is always set to a valid DOM element. Updated jsdoc accordingly
* Ignore WebStorm project-related files
2013-04-09 12:07:56 +10:00
Philip Peitsch 259b203d21 Avatars and modification markers are hidden by default for a non-networked editing session
* The avatar image will not be loaded if the avatar is not visible. The image will be loaded when the avatar is next shown
2013-04-09 12:07:14 +10:00
Tobias Hintze 66eb0054d0 rename SessionImplementation to Session (and thus remove the Session-interface) 2013-03-26 14:15:02 +01:00
Tobias Hintze 2af73a06bd implement the updated concept of getUserDetailsAndUpdates;
adds quite some comments and asserts
2013-03-26 09:37:14 +01:00
Tobias Hintze 39ba2df2dc SessionView: don't fail on missing userdata 2013-03-25 11:07:10 +01:00
Friedrich W. H. Kossebau 8b439d7e33 Fix wrong API dox for setAvatarInfoStyle() in SessionView.js 2013-03-18 20:23:37 +01:00
Aditya Bhatt 054b6b496c A little workround - comment out the unsubscription of user details from
onCursorRemoved in SessionView, so we actually get user data over the
wire
2013-03-14 18:21:04 +05:30
Aditya Bhatt 19d04bfb9d Don't ask for user info on every edit, only ask during cursor addition.
Also, get user details using both subscription- and
non-subscription-based techniques, because otherwise a user that has
joined the document and had the UserList populated will not release data
in the 'subscription way'
2013-03-14 18:21:04 +05:30
Aditya Bhatt aa7b0521d4 Don't set cursor and avatar info style twice, only do it in
omMemberDataChanged
2013-03-14 18:21:04 +05:30
Aditya Bhatt 4615700af6 Make the highlightEdit method request user details for every edit if the
info is already not available
2013-03-14 18:21:04 +05:30
Aditya Bhatt 1a0bd8f927 Fire paragraphEdited signal with timestamp, and use that timestamp for
the EditInfo
2013-03-14 18:21:03 +05:30
Aditya Bhatt 1c404863df Match the avatar info css to editinfo:memberid 'starting with' userId
instead of memberId, so the same user gets the same editinfo styling
even when that user gets a new avatar
2013-03-14 18:21:03 +05:30
Aditya Bhatt d11a0d837a Rewrite sections of SessionView to maintain an avatar-specific css style for nodes that
specify an editinfo:memberid. Use this style for rendering the fullname
and color. Rewrite EditInfoMarker accordingly.
2013-03-14 18:21:03 +05:30
Friedrich W. H. Kossebau 6a568a8f58 Split ops.OdtCursor from core.Cursor & rename ops.Document to ops.OdtDocument
Also:
* rename gui.CaretTests to ops.OdtCursorTests (as it is testing ops.OdtCursor)
* remove test-less CaretTests.js, had broken setup now
2013-03-06 15:44:28 +01:00
Friedrich W. H. Kossebau 6e80cacefc Use the canvas element to grab all input, ensure caret visibility ourselves 2013-02-11 17:59:59 +01:00
Aditya Bhatt 53a14357ab Add a check for editinfo namespace in the NodeFilter's acceptNode method 2013-01-28 13:51:30 +05:30
Aditya Bhatt 349580d5e2 Add a function highlightEdit to SessionView 2013-01-24 01:27:34 +05:30
Aditya Bhatt 137d76271e Fix broken build, lint 2012-12-28 12:05:07 +01:00
Friedrich W. H. Kossebau c26c29a15e Allow to disable the highlighting of edited lines (e.g. useful on ops replay at begin) 2012-12-28 12:05:07 +01:00
Friedrich W. H. Kossebau 17e1e67abe Update paragraph-edited highlighting styles on new userdata 2012-12-28 12:05:06 +01:00