Commit Graph

20 Commits

Author SHA1 Message Date
David Mudrák
929727e3ef MDL-54633 tinymce: Sync editors' iframe to textarea on form submit
The previous commit "Automatically sync editor with its textarea" was
found a not good solution as the onchange event is triggered way less
often than needed for our needs. So this reverts commit 34321d49.

Instead, we add a hack to the formslib so that when there are some
TinyMCE editors used at the page, we explicitly save them before
triggering the form validation. This simply calls save() on all editors
on the page - see the API reference:
http://archive.tinymce.com/wiki.php/API3:method.tinymce.triggerSave

Having TinyMCE hardcoded like this on this core level does not make me
happy. But it seems to be most effective solution for now (and
definitely more efficient than the previous solution). Plus there is a
precedence - we already use window.tinyMCE in formchangechecker.js YUI
module, for example.
2016-05-19 13:44:41 +02:00
David Mudrák
34321d491b MDL-54633 tinymce: Automatically sync editor with its textarea
Probably as a result of recent changes in the way how forms client side
validators are trigerred (MDL-52826), the field validator has been
triggered before the underlying textarea's values property is updated by
TinyMCE. This led to marking such a field as "required" even if the
value is provided.

Inspired by http://stackoverflow.com/questions/2122085/
this patch adds a new onchange callback that automatically keeps the
underlying textarea synced with the editor iframe. Relevant API docs:
http://archive.tinymce.com/wiki.php/Configuration3x:onchange_callback

I was also trying to call the save() method via the editor's onSubmit
method but that one seems to be also triggered only after the validator.
2016-05-19 00:50:08 +02:00
Damyon Wiese
519449c528 MDL-42625 TinyMCE: Hook into API to track the progress of the init script 2013-12-06 13:10:24 +08:00
Andrew Nicols
ff73a6d1fb MDL-41328 Editor: Work around another iOS issue with TinyMCE
We apply this only on touchend and not touchstart or touchmove. The
location is not guaranteed until the end of the gesture, and there's no
need to keep applying focus on every move.
2013-09-02 09:41:27 +08:00
Andrew Nicols
be94c6d88d MDL-36803 TinyMCE: Fix TinyMCE following touch events on iOS browsers 2013-08-20 23:58:59 +01:00
Dan Poltawski
e5e5097081 NOBUG - reduce whitespace errors a little 2013-04-15 13:29:14 +01:00
Petr Škoda
5ba3a966f6 MDL-35284 patch empty toolbar crashing TinyMCE 2012-09-10 22:10:25 +02:00
Petr Škoda
29149f981c MDL-35289 use unmodified TinyMCE 2012-09-09 11:57:25 +02:00
Dan Poltawski
06c548c783 Merge branch 'w33_MDL-34741_m24_yui2in3' of git://github.com/skodak/moodle 2012-08-14 15:33:10 +08:00
Petr Škoda
e0a5793d8f MDL-34741 remove deprecated M.yui.loader 2012-08-12 11:41:25 +02:00
Petr Škoda
de6a651299 MDL-33041 cleanup the rest of tinymce plugin 2012-08-11 16:19:37 +02:00
sam marshall
fae911708e MDL-33041 (3) TinyMCE: Support custom plugins 2012-08-10 14:57:58 +02:00
Rajesh Taneja
a82e9ada37 MDL-28987 Forms Library: Removed onBlur validation. Now the validation will occur on form submit only 2011-09-05 14:25:13 +08:00
Rajesh Taneja
ab978b38c4 MDL-28987 Forms Library: Added tinyMCE onblur event callback for required tinymce fields 2011-09-05 12:19:40 +08:00
Dongsheng Cai
5a2543286f MDL-24416, fixed the problem of using file picker in tinymce fullscreen mode 2010-09-29 08:03:52 +00:00
Dongsheng Cai
a4d91438b5 TinyMCE, MDL-23407 allow all repostory types when using link button 2010-07-28 03:08:06 +00:00
Dongsheng Cai
766514a095 MDL-23407, the advlink plugin of tinymce should use external repositories only 2010-07-27 04:06:09 +00:00
Petr Skoda
34a30b5c8f MDL-14739 upgrade to latest tinymce, full integration with amos is not yet there, other improvements necessary before the release too 2010-07-04 20:27:25 +00:00
Dongsheng Cai
875f4e7b54 "MDL-21400, fixed image & media filepicker in editor" 2010-03-11 07:45:06 +00:00
Petr Skoda
4c508047eb MDL-21400 converting forms stuff to new M namespace and using standardised JS module coding style, fixed some regressions - for now works in FF only 2010-02-03 14:36:53 +00:00