0
Fork 0
mirror of https://github.com/fastmail/Squire.git synced 2024-12-22 15:23:29 -05:00
Commit graph

70 commits

Author SHA1 Message Date
Neil Jenkins
a9a0ac6411 Fix bug where image may be duplicated on enter.
* Do not move range boundaries inside images; these should always be treated as
  leaf nodes.
* Workaround FF bug where it may return range as being inside of image node.
2012-08-01 11:53:37 +10:00
Neil Jenkins
0412ece8ec Fix blur method.
Have to blur the body, not the window.
2012-07-25 17:35:03 +10:00
Neil Jenkins
b87a9c26fe Add setTextDirection method.
Allows setting RTL or LTR text direction on a block level basis.
2012-07-24 15:59:36 +10:00
Neil Jenkins
630a7c4e4f Tidy IE8 range code. 2012-07-24 15:54:05 +10:00
Neil Jenkins
c964a6a564 Fix bug in removing empty inlines on delete. 2012-07-02 16:44:10 +10:00
Neil Jenkins
e4b5ea6ee8 If all text in inline tag deleted, remove tag. 2012-07-02 14:04:06 +10:00
Neil Jenkins
819ddb296e Always restore range to textnodes.
When restoring a range from a bookmark, always call range.moveBoundariesDownTree
to anchor it to the nearest text node. If you call setSelection with a range not
anchored inside a textnode, Opera may incorrectly set the selection.
2012-06-19 14:43:10 +10:00
Neil Jenkins
ffd6edbaef Remove redundant -ms-box-sizing CSS.
Prefix was only used in IE8 betas. No need to keep it.
2012-04-27 17:52:10 +10:00
Neil Jenkins
c5abcde210 API rename (inc|dec)reaseQuoteLevel
Use full words in API method name for consistency with the rest of the API.
2012-04-12 11:42:07 +10:00
Neil Jenkins
98ebe661b2 Allow custom cleaning on paste.
A willPaste event is now fired just before pasted content is inserted into the
document, allowing custom, arbitrary modification of the pasted content, or
prevention of the paste event altogether.
2012-04-12 11:38:22 +10:00
Neil Jenkins
b6c659e295 Remove unused variables. 2012-04-12 09:22:58 +10:00
Neil Jenkins
bf8598e060 Fix zero-width space character bug.
If the node containing the zero-width space character was merged by a call to
Range#mergeInlines, the character was not being removed, making for odd cursor
movement.
2012-04-10 15:42:47 +10:00
Neil Jenkins
63a97d9b99 Fix IE8 grabs focus on load of editor. 2012-04-04 17:01:28 +10:00
Neil Jenkins
c595fb0bb8 Fix cursor location after Range::_deleteContents
Should always collapse to start.
2012-04-04 15:11:27 +10:00
Neil Jenkins
5c9420c7fa Fix bug in updating path correctly. 2012-04-03 20:35:07 +10:00
Neil Jenkins
9b5512bf98 Tidy up a few bits of code. 2012-04-02 17:38:19 +10:00
Neil Jenkins
543abca022 Workaround WebKit/IE can't focus empty text nodes. 2012-04-02 17:38:01 +10:00
Neil Jenkins
6480739143 Update copyright year. 2012-04-02 15:55:33 +10:00
Neil Jenkins
89eb88ce15 Fix repeating keys don't fire handlers.
Holding down a key will trigger it repeatedly; we need to capture all of these
events to override backspace/enter etc.
2012-04-02 15:55:33 +10:00
Neil Jenkins
f0ba6216cc Add support for IE8. 2012-04-02 15:55:33 +10:00
Neil Jenkins
746e86a3a8 Tidy document.html 2012-03-29 17:55:15 +11:00
Neil Jenkins
cfb08691c2 Don't focus body in non-Gecko.
Opera loses selection. Only Gecko seems to need it.
2012-03-29 17:55:15 +11:00
Neil Jenkins
70078355b7 Whitespace fix. 2012-03-08 15:19:43 +11:00
Neil Jenkins
f8273e7d15 Make email addresses into links on paste. 2012-03-08 15:13:32 +11:00
Neil Jenkins
64b8f9affa Fix focus method not working in Firefox. 2012-02-08 23:23:55 +11:00
Neil Jenkins
e3ee4dad12 Whitespace cleanup. 2012-01-25 11:47:26 +11:00
Neil Jenkins
78e8955be1 Work around iOS bug when setting selection. 2012-01-25 11:37:38 +11:00
Neil Jenkins
d413b1bb85 Automatically wrap URLs in <a> when pasting text. 2012-01-25 11:36:51 +11:00
Neil Jenkins
aa8527fc2c Fix bug in removing format. 2011-12-09 14:27:37 +11:00
Neil Jenkins
ceed1cfa81 Don't continue link over block break. 2011-12-09 13:53:09 +11:00
Neil Jenkins
cfe9bea8b3 Opera collapses blocks with just spaces for data 2011-12-09 13:30:58 +11:00
Neil Jenkins
14ee0d0ad5 Scroll cursor into view on enter. 2011-12-09 13:15:15 +11:00
Neil Jenkins
43634a3ba4 Add styles via separate API method.
<style></style> must not be included text supplied to setHTML call.
2011-11-17 18:37:49 +11:00
Neil Jenkins
a8e6e5b391 Merge adjacent containers on delete/backspace.
If you delete the line separating two containers (e.g. a blockquote), the
containers are merged.
2011-11-17 18:36:58 +11:00
Neil Jenkins
f4c5a85379 Don't prevent tabbing out of area. 2011-11-17 18:36:29 +11:00
Neil Jenkins
17cb1e0043 Guard against IE firing beforepaste twice 2011-11-17 18:36:07 +11:00
Neil Jenkins
3ca646a1d1 Make enter break through all levels of blockquoting 2011-11-17 18:33:24 +11:00
Neil Jenkins
09308b729b Fix bug in hasFormat
Must see at least one text node with format to return true.
2011-11-17 18:32:11 +11:00
Neil Jenkins
f1a714a179 <br>s should be added to every block in Webkit/Gecko 2011-11-16 19:24:43 +11:00
Neil Jenkins
3068c496c9 Allow contents of unknown tags in.
Clean functions were removing contents of any unknown tag. This was, it turned
out, a bit too strict.
2011-11-15 21:46:47 +11:00
Neil Jenkins
143eea15cb Fix cursor when deleting range contents 2011-11-15 21:46:11 +11:00
Neil Jenkins
feca3e4d8f Make forEachBlock method public.
And tidy a few bits and pieces.
2011-11-14 17:55:40 +11:00
Neil Jenkins
3f5233c61a Fix bug in applying styles in Opera/IE.
Was removing the crucial empty text node that these browsers use to indicate and
editable line.
2011-11-14 15:18:05 +11:00
Neil Jenkins
d24aba73ad Stop using DOM mutation events to detect changes.
Unreliable in some browsers, and may be deprecated in the future.
2011-11-10 18:44:00 +11:00
Neil Jenkins
a2ef14e218 Add make/remove link sugar.
Also:
Add getSelectedText method.
Fix bug in setting HTML after undo/redo in Opera.
2011-11-10 18:31:07 +11:00
Neil Jenkins
d01cc9875f Add commands for setting text/background colour. 2011-11-09 15:41:46 +11:00
Neil Jenkins
b3d9de6e86 Fix infinite loop bug in key down.
Also fix font changes removing all spans.
And fix firing of path change events to occur at the right times.
2011-11-08 16:43:46 +11:00
Neil Jenkins
aa8b4b7ac6 Fix setTextAlignment command
And make propagating native events more elegant (only adds observer to document
when first function added).
2011-11-08 13:59:47 +11:00
Neil Jenkins
75109c404e IE requires handlers on before(cut|paste) events. 2011-11-04 17:53:24 +11:00
Neil Jenkins
3b09cbf703 Improve cleaning of inserted content. 2011-11-04 16:53:12 +11:00