Manually adding margins to offsets was necessary due to
http://bugs.jquery.com/ticket/5445#comment:6 and the original code
using $.fn.position().
When edition buttons were moved to being children of the body (rather
than siblings of the image), $.fn.position() was replaced by
$.fn.offset() (to get the position of the image/link relative to the
body/page toplevel), the adjustment (addition of marginLeft/marginTop)
was left in, even though #5445 does not apply to $.fn.offset().
bzr revid: xmo@openerp.com-20140120144610-nu8q2naemzzhekv2
in "block-level" widgets (divs), when hitting [return] instead of
adding a newline in the widget a new bit of widget may be added. This
is caused by an incompability between widgets and the enterKey plugin.
Remove enterKey, behavior on [Return] is slightly worse (always
inserts br) but widgets don't get broken.
See https://dev.ckeditor.com/ticket/11326 for issue in upstream.
bzr revid: xmo@openerp.com-20131217153751-7fbwp34o8kac9x94
if a link or image is an editing host (has @contenteditable=true), its
body is editable *but* its attributes should not be considered
editable: if the attributes come from a t-att-*, @contenteditable will
be set on the node itself.
such elements should be ignored by the link & image dialog handling
thing, as editing their attributes has undesirable effects.
bzr revid: xmo@openerp.com-20131216134424-fdqs03i9pidbmaqt
According to user tests, users have a hard time finding out how to
edit links. Thus, add same system as image edition (a small button
appearing when hovering the element).
Extract and unify these two to avoid redundancies between handlings as
they are broadly similar (only details such as label, positioning and
size of button relative to the element being hovered really change,
the lifecycle itself is the same).
The main setup still isn't very clean, there might be a better way to
do it.
bzr revid: xmo@openerp.com-20131204105212-u0a49nbvwilgtfst
* rename Cancel to Discard for clarity (user test)
* add intermediate dialog in case of mis-click, use 'danger' button
style to clearly indicate this is a destructive operation
bzr revid: xmo@openerp.com-20131203111323-9mx7aazfpsybe718
the addition and removal of the [edit] button on hover would be caught
by the mutation observer and mark the image field as dirty, even when
it had not actually been altered, leaving to spurious save events for
said field.
bzr revid: xmo@openerp.com-20131202113304-xpgu43se5er1ho7y
# Through the menu
Rather than output a generic error (500 due to an IntegrityError),
return a templated 409 letting the user either visit the
page-which-already-exists-with-the-name-he'd-picked or open the page
creation dialog again for a second round.
An alternative would be to promote the website.prompt use to
full-blown dialog as a result of selecting "New Page" and handle the
"page already exists" case without even closing the dialog.
# Through the link dialog
Added an RPC call to check if a page already exists (essentially a
cheaper version of opening /page/whatever and checking whether it's a
200 over JSON-RPC), if the page matching the completion term already
exists, do *not* add the choice of creating the page, only provide
completions from existing pages.
bzr revid: xmo@openerp.com-20131126160148-wrk4zvz9istscwa0
Button implementation turned out to be crap:
* Didn't work at all in Firefox (!)
* Unreliable in webkit, some types of image selection wouldn't
correctly activate the button
->
* changed RTEImageDialog to take an (optional) image element, used as
the "source element" if provided. This allows greater reliability
for events which may leave selection in debatable or variable
(across browsers) state
* setup and teardown button on hover, using selection triggered issues
with oe_overlay thing where e.g. the first click on the button would
work but the second one would not (it'd be intercepted by the
overlay as far as I can tell).
This also saves a click for user, they will see the [Edit] button
immediately when putting the cursor over the image.
bzr revid: xmo@openerp.com-20131121110748-s5e2ne3etpzwi2a6
TODO: website.prompt() should be finished for Add a blog post link
Added @id=editable_scripts_hook in layout template so modules can easly add *.editor.js files
bzr revid: fme@openerp.com-20131113171438-3l0wo08ta5vsulq3
hide it and replace it with a button telling the user what we're
currently doing (uploading the image).
Leave the possibility of discarding the whole thing and going away
though.
bzr revid: xmo@openerp.com-20131106152412-eb283vghb18aafyr
[IMP] remove "Create a free website if logged", see usertesting
[IMP] Advanced view editor -> "HTML Editor"
[IMP] Footer: editable zone grouped in a <div> for efficient distribute branding
bzr revid: fp@tinyerp.com-20131106083833-cz4xc2ast5d9ao19
CKEditor's tab plugin can't deal with a non-editable editor root
(editor.editable().hasFocus returns false and disables it), so
reimplement the behavior.
For some reason, ckeditor's selection API also does not seem to work
correctly in table cells in Firefox, so use the browser's native API
instead.
Tab goes to the next cell, shift-tab goes to the previous cell,
shift-tab from the first table cell is ignored and tab from the last
table cell creates a new row and sets focus in the new row's first
cell. These behaviors seem to more or less match Word and OpenOffice
Writer's.
bzr revid: xmo@openerp.com-20131018103540-12p8j18ypte8dr9u
Mutation events are synchronous and one is triggered per observed
alteration (they're not batched). When doing lots of modifications to
the DOM tree, they will add a lot of overhead as (in this case) the
event handler will run for *each* added node and it will run during
(and slow down) node insertion rather than afterwards.
bzr revid: xmo@openerp.com-20131016123708-lx389x0g6xs6zu10