Commit Graph
416 Commits
Author SHA1 Message Date
Friedrich W. H. Kossebau 3758ebf9e5 Add flag "showRemoveButton" to AnnotationViewManager, to not show the button if wanted 2013-12-12 18:07:42 +01:00
Friedrich W. H. Kossebau 62db9e22fe Add API dox for Editor.addEventListener, with possible event ids and error codes 2013-12-03 18:32:40 +01:00
Friedrich W. H. Kossebau 50f18a109e For OperationRouter turn explicit subscription methods into generic ones + explicit state getters 2013-12-03 18:32:40 +01:00
Friedrich W. H. Kossebau 42c5a7c617 Export errors and other oprouter states in the Editor API, experimental use in collabeditor.js 2013-12-03 18:32:39 +01:00
Friedrich W. H. Kossebau 14bf18d40d Catch any errors in the OperationRouter & calling the server and report in separate callback 2013-12-03 17:03:55 +01:00
Friedrich W. H. Kossebau 27461c32fe Add OperationRouter.getHasSessionHostConnectionAndUpdates/OperationRouter.unsubscribeHasSessionHostConnectionUpdates 2013-12-03 17:03:55 +01:00
Friedrich W. H. Kossebau a454cce637 Catch failing playback of operations or unknown ops coming from server 2013-12-03 17:03:55 +01:00
Friedrich W. H. Kossebau 53c579b744 make failCb a needed argument to Server.joinSession and Server.leaveSession 2013-12-03 17:03:55 +01:00
Friedrich W. H. Kossebau 8aa87de93f Fix collabeditor.js to use the right memberid and sessionid on server.leaveSession(...) call 2013-12-03 17:03:55 +01:00
Friedrich W. H. Kossebau 422db0de00 Fix condition when to log on replies to Pullbox servers 2013-12-03 17:03:55 +01:00
Friedrich W. H. Kossebau 33c0a580c8 Add OperationRouter.getHasLocalUnsyncedOpsAndUpdates/OperationRouter.unsubscribeHasLocalUnsyncedOpsUpdates 2013-12-03 17:03:55 +01:00
Philip Peitsch ebb7462022 Extend step translation interface to allow custom rounding
Step translation from a DOM point to a step usually results in some
rounding. The existing interface provided a simple bool flag to control
this, but this does not provide help for a caller that doesn't know
ahead of time which step is "closer" to the desired node (e.g., asking
for steps at paragraph boundaries should round within the paragraph).

This extension now allows a custom delegate that will be called with the
prev and next position to choose between rounding options.
2013-11-28 00:35:36 +11:00
Aditya Bhatt f5883fe47e Apply paragraph style to all paragraphs in the cursor
selection.

* Modify OdtDocument.convertDomPointToCursorStep(),
which takes a node, an offset, and a boolean, and returns the steps to
that position from the root, rounded to the next allowed
position if the boolean is true, otherwise to the previous.

* Use this method in EditorSession.setCurrentParagraphStyle().
2013-11-26 14:02:36 +01:00
Aditya Bhatt ca3cb713e7 Do not fire onChange in paragraph styles
dropdown when setting the value programmatically.
2013-11-26 12:23:48 +01:00
Aditya Bhatt bfdc14b907 Add isEdit properties to all operation classes
to make life easier by avoiding the need to listen
to various signals or look at optypes when you just
want to know whether any edits have taken place.
2013-11-22 20:35:29 +01:00
Jos van den Oever 092edb44ad JSON is just text, no need to make a binary. 2013-11-22 18:32:21 +01:00
Philip Peitsch 09d16af16b Provide a sourceURL for runtime.js in all programs 2013-11-21 23:41:40 +11:00
Aditya Bhatt ec5567bd09 Remove all occurrences of MemberModel and TrivialMemberModel 2013-11-20 22:26:02 +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 6d9fa2108b Remove no longer needed spans for menubar (slipped the last cleanup it seems) 2013-11-20 18:46:38 +01:00
Friedrich W. H. Kossebau 248e35ad8b Rename AnnotationManager to AnnotationController
also call do not call AnnotationViewManager objects not annotationManager
2013-11-19 19:56:15 +01:00
Friedrich W. H. Kossebau db0ecac6ee Make directTextStyler no longer optional, now that it works also in collab mode 2013-11-15 15:30:32 +01:00
Aditya Bhatt 2dcd55205b Have dedicated Editor.closeDocument and Editor.closeSession
methods to correspond to openDocument and openSession.
Remove unused EditorSession.close method, not sure what it was
used for.
2013-11-14 21:47:26 +01:00
Friedrich W. H. Kossebau 72cd3888a1 Add backend for pullbox-type server to programs/editor 2013-11-07 10:51:01 +01:00
Aditya Bhatt 6a4f0e69ab Add translations support to runtime.js,
and programs/editor/Translator.js which is a reference
implementations of a translator.
The programs/editor/Translator code is used entirely in
localeditor.js/collabeditor.js and the editor itself, or webodf,
and need not know anything about the translation mechanism.

Translate all strings within the editor and all
user-facing strings in webodf core itself using
runtime.tr();
2013-11-05 18:38:41 +01:00
Tobias Hintze 84cd8e1a03 build utility: remove double shift for mergeIntoDojo.js
(that bug did not surface before because the utility
was always used with exactly one mergee)
2013-11-04 21:50:36 +01:00
Aditya Bhatt e74d7d2dca Properly destroy all dojo widgets when Tools is destoy()'d 2013-10-23 20:48:23 +02: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 f9249c08b8 Fix regression: fonts listed in resources/fonts/fonts.css became ignored
fixup for b426aab73f
2013-10-18 15:38:26 +02:00
Friedrich W. H. Kossebau 80e75c6b73 Separate annotation handling logic into a tool class AnnotationManager and UI into a editor/widgets/annotation.js
Also enable "Add annotation" button only if not inside annotations
2013-10-16 17:20:14 +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
lli 94ceb41a03 Disable font and paragraph formating toolbar items on the editor when image is selected.
LO/AOO actually hides those options.
2013-10-15 21:42:21 +11:00
Aditya Bhatt aae55aca50 * Add a new ShadowCursor class. This class is meant, for now, to only
hold the 'selected range' fed to it, like with any other OdtCursor. It
provides a minimal OdtCursor-like interface, with only the methods
absolutely required to make it work. It does not modify the DOM in any
way.
* Make the shadowCursor object an instance of ShadowCursor, not
OdtCursor. This is ideal because ShadowCursor does not modify anything
in the DOM, and therefore is safer and faster to use for tracking
browser selections. This makes backwards-selections work finally,
because now there are no anchor nodes to interfere with the selection
whilst dragging.
* With the introduction of the ShadowCursor, we no longer have the
selection range's endpoints coinciding the with beginning and end of the
respective startContainer and endContainer. Therefore, modify
getExtremeRanges to reflect this. If an endpoint of the selection range
does not lie within a TextNode, we latch on to the nearest text node
within.
* In the SessionController, call maintainShadowSelection() if the
selection might leak outside the allowed local root, so that the
window selection object remains root-confined.
* Clone ranges if they may be later modified.
Properly detach ranges once they are used in SelectionView, less
memory leaks.
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 094151847f Improve ImageInserter: use img.onload, drop hidden image helper after usage, call onToolDone only when really done 2013-10-07 11:50:36 +02:00
Friedrich W. H. Kossebau 55e6322bf7 Little fixes in editor code that closure compiler did not like 2013-10-07 10:45:41 +02:00
Philip Peitsch 84e221082f Allow event focus to be returned to SessionController without scrolling to the top of the ODF canvas
Element.focus() has additional logic that attempts to bring the top of
the element into view. This causes the a document that has been vertically
scrolled to reset back to the top of the document each time an Editor
button is clicked.

This redesign abstracts the event management away, and uses an invisible
div as the primary event trap. Because the div is always visible and
centred, the browser does not perform any scrolling. Non-bubbling events
are automatically forwarded from the event trap to subscribers.

Fixes Issue #44
2013-10-04 19:24:13 +02:00
Friedrich W. H. Kossebau 7e95109b06 Update CDN versions to use dojo 1.8.3 2013-10-04 19:24:13 +02:00
Friedrich W. H. Kossebau f46bb9e502 Change ops.OperationRouter.push to take a sequence of ops
Taking a sequence of ops also enables to give the guarantee that all
contained operations will be executed directly after each other,
in the given order. So creator of the ops can calculate the spec of each op
by relying on the known effect of the other ops.
2013-10-02 19:29:52 +02:00
Philip Peitsch 3f6790ef5f Add insert image button to the editor 2013-10-02 16:37:49 +10:00
Friedrich W. H. Kossebau 72b0e29996 <script/></script> -> <script></script> 2013-09-27 17:26:18 +02:00
Friedrich W. H. Kossebau f1933da020 Fix localeditor/collabeditor.html to check for navigator.language before using it, IE does not have it 2013-09-27 17:11:55 +02:00
Aditya Bhatt 30d8bff132 Stop handling keyboard input on the font size picker because dojo does
not yet afford enough control and we want to not let it steal focus.
2013-09-24 16:57:10 +02:00
Friedrich W. H. Kossebau 67c7941757 Remove out-dated editing code from odf.OdfCanvas 2013-09-24 15:13:28 +02:00
Friedrich W. H. Kossebau 297562afb3 Consistency: "named" style -> "common" style 2013-09-20 18:50:29 +02:00
Lu Li bbb5ecef8a Refactoring: changed Op(Add|Remove)ParagraphStyle to Op(Add|Remove)Style, so they can handle all style families NOT just paragraph 2013-09-20 17:36:41 +02:00
Aditya Bhatt 5b3d1b2fcd Make onToolDone an overrideable member function that is called whenever
a tool is done. Now we don't pass onToolDone as a callback argument.
Make styles dialog, zoom slider, and other widgets restore focus to the
document once they are done.
2013-09-19 18:54:37 +02:00
Friedrich W. H. Kossebau 5cbca527dc In localeditor demo app fix unpossible loading of the same file directly again 2013-09-19 18:25:08 +02:00
Friedrich W. H. Kossebau 43caf1f333 In collabeditor demo app set the current sessionid as fragment to the location 2013-09-19 14:31:06 +02:00