Commit Graph

114 Commits

Author SHA1 Message Date
Mateusz Uzdowski
92810898ba BUG Return the promise instead of the whole deferred object. 2014-08-01 16:25:28 +12:00
Mateusz Uzdowski
31c9fb52d1 BUG Fix the anchor selector to work for internal pages.
Currently it will only default to pulling in anchors from the current
page, from the editor.
2014-08-01 10:36:34 +12:00
Damian Mooyman
0e78e3f3dc API Let update interval of tinymce be changed or disabled 2014-07-28 13:54:02 +12:00
Damian Mooyman
62ed2d0f22 BUG Fix periodic tinymce layout refresh 2014-07-28 13:33:41 +12:00
Mateusz Uzdowski
b34aaca2e8 BUG Fix several issues around onmatch/onunmatch entwines.
1. Add missing _super calls.

2. Make UI widget destroys more consistent to avoid exceptions.
Selectable would throw an exception in the GridField.js if destroy
called from onunmatch - at that stage jQuery UI would have had called
the destroy already. Add a guard, and change to onremove, which triggers
before the element is removed from DOM.

3. DOM traversal fails after the element is removed from DOM.
Onunmatch triggers after the removal of the element from the DOM, which
makes DOM traversal fail. Use onremove instead, which triggers while the
element is still in DOM.
2014-07-17 14:14:52 +12:00
Ingo Schommer
03b2e9dc74 "alt" and "title" attrs for images from URLs (fixes #2723) 2013-12-19 19:43:46 +01:00
Loz Calver
06d7bb77c0 FIX: Defer loading of UploadField EditForm iframes (fixes #2711)
Also addresses issue #1439.

I don’t like the binding iframe.on('load') events in the onclick handler, but apparently Entwine doesn't support binding on iframes.

AssetAdmin and HtmlEditorField support added
2013-12-19 09:11:31 +00:00
Ingo Schommer
3b8fb42654 Remove TinyMCE change detection on insert (breaks IE8)
The detection is triggered on first load, and in IE8 the
inserted value doesn't equal the value already in the textarea field.
That's possibly due to whitespace or encoding differences,
but they have the same character length.

Tried fixing this by whitespace removal, didn't work:
if((original || '').replace(/[\s\t\n\r]/g, '') != (value || '').replace(/[\s\t\n\r]/g, '')) {

In the end, we're already detecting changes through a 5s interval
triggering the save() method on the editor if the field is focused.
The impact of this removal is that after inserting an image,
it'll take a few seconds for the change detection to kick in
(and thus highlight the "save" button and ask for confirmation
when navigating away without saving).

See d12ae82f70 for context.
2013-10-31 14:40:28 +01:00
Hamish Friedlander
e282f0b661 FIX Two memory leaks with HtmlEditorField
We werent calling tinyMCE.Editor.destroy, which is needed to
clean up event bindings. The advanced theme also wasnt cleaning
up after itself on destroy properly
2013-08-20 15:49:04 +12:00
Jon
4ae15aa360 Minor bug fix to show link description field
When adding a link, the description field was present, but hidden. Adjusted javascript to show the description field
2013-07-29 09:37:41 +12:00
jonom
ffc764dc3c NEW: Allow configuration of initial insertion width for images and media
Moved default insertion dimensions logic from JS to PHP to allow setting through config API
2013-06-24 14:25:16 -06:00
Ingo Schommer
18299322bc "Insert Media" dialog: Fixed event names
Fixes https://github.com/silverstripe/silverstripe-cms/issues/781
Regression from 9f600ada which uses jQuery UI widget "subclass"
that also affects event names.
2013-06-24 18:58:46 +02:00
Damian Mooyman
f47383f52e BUG Fixed issue where file upload via the HTML Editor media dialogue would not prompt users to overwrite existing files 2013-06-20 15:21:18 +12:00
Sam Minnée
34287895ef Merge pull request #2099 from chillu/pulls/insert-media-tweaks
Various "Insert Media" dialog tweaks
2013-06-18 21:32:00 -07:00
Sam Minnée
8bf4d417c6 Merge pull request #2094 from chillu/pulls/dialog-sizing
Min/max constraints for CMS dialog
2013-06-18 14:56:41 -07:00
Ingo Schommer
8865bae8e3 Hide titlebar in "Insert Media" when updating images
It doesn't make sense to show it there, since the "delete"
action has no effect, the "edit" button only collapses (useless),
and the thumbnail duplicates.
2013-06-15 10:13:44 +02:00
Ingo Schommer
ec684a2e5c Show edit form in "Update Media" by default
Was showing collapsed UploadField row before which doesn't make a whole lot of sense.
2013-06-15 10:13:44 +02:00
Ingo Schommer
23c0084193 Add new files in "Insert Media" at start of the list
Makes the change more obvious without requiring to scroll
to action origin (upload button) out of view
2013-06-15 10:13:44 +02:00
Ingo Schommer
a9bf7dfcce Fixed HtmlEditorField.js editor instanciation
Wasn't parsing data-editor attrs correctly.
Using proper instances of the underlying editor now,
instead of relying on "active editor" states which get
wonky once they lose focus (e.g. when opening a dialog).
2013-06-14 11:46:07 +02:00
Ingo Schommer
9f600ada2c Min/max constraints for CMS dialog 2013-06-13 20:03:16 +02:00
Ingo Schommer
385f364018 TinyMCE "Insert Media" screen, update button triggers navigation (fixes #742) 2013-06-13 09:29:55 +02:00
Ingo Schommer
d2eef63b7d BUG Trigger TinyMCE onChange more frequently
Periodically check for inline changes when focused,
since TinyMCE's onChange only fires on certain actions
like inserting a new paragraph, as opposed to any user input.
This also works around an issue where the "save" button
wouldn't trigger if the click is the cause of a "blur" event
after an (undetected) inline change. This "blur" causes onChange
to trigger, which will change the button markup to show "alternative" styles,
effectively cancelling the original click event.
2013-06-03 13:32:43 +02:00
mikg0
fb5fc62604 Fix file link recognition in HtmlEditorField.js
The new file_link format ([file_link,id=\d+]) uses a comma which was not reflected in the regex.
2013-05-13 15:04:52 +03:00
Mateusz Uzdowski
fdb4a1d871 BUG Enable dropdown so alignment on images can be updated. 2013-05-13 10:08:03 +12:00
Ingo Schommer
9856fcef21 Merge remote-tracking branch 'origin/3.0' into 3.1
Conflicts:
	javascript/DateField.js
	model/DataQuery.php
	model/Versioned.php
	tests/forms/RequirementsTest.php
	tests/model/DataObjectLazyLoadingTest.php
	view/Requirements.php
2013-04-09 14:45:35 +02:00
Sam Minnée
39a4aabcdc Merge pull request #778 from patbolo/bugfix/7853
FIX 7853
2013-04-08 16:08:23 -07:00
Ingo Schommer
8bedf485d6 Don't fail TinyMCE cleanup if no current instance is set
Bug has been observed in IE8
2013-03-20 14:46:28 +01:00
Ingo Schommer
e0e481fc46 Removed stray code from HTMLEditorField.js 2013-03-15 12:01:45 +01:00
Wernervanrun
fade5cce51 Update javascript/HtmlEditorField.js
we only want this .ss-uploadfield-files - else we get all ss-uploadfield-files wich include the ones not related to #tinymce insertmedia
2013-03-07 20:33:02 +01:00
Sean Harvey
6a1fe05191 Merge pull request #1151 from silverstripe-rebelalliance/bug/image_reedit_attr
FIX Assiging width to caption instead of container
2013-01-31 13:23:36 -08:00
Hamish Friedlander
aa3eb98de2 FIX Assiging width to caption instead of container 2013-02-01 10:17:56 +13:00
Ingo Schommer
dc75d9a5b4 Merge pull request #1149 from silverstripe-rebelalliance/bug/image_reedit_attr
FIX A couple of bugs integrating the SilverStripe media panel with TinyMCE
2013-01-31 15:24:51 +01:00
Hamish Friedlander
6f937745b0 FIX Not being able to remove, add or edit the caption on an image properly 2013-01-31 16:35:48 +13:00
Ingo Schommer
0b44d8fbfb Merge pull request #1145 from silverstripe-rebelalliance/bug/image_reedit_attr
FIX Not calling updateFromNode on re-opening an image
2013-01-30 14:52:50 +01:00
Hamish Friedlander
9f822d1e3c FIX Not calling updateFromNode on re-opening an image
Inside mediaform updateFromEditor we called $(this).updateFromNode, but this wasnt
pointing to anything useful after a refactor, which resulted in the fields not
being filled in with current data when editing an already-inserted image
2013-01-30 17:15:01 +13:00
Mateusz Uzdowski
6c78bf9be9 BUG Flush editors on form submission (os#8222)
Otherwise some non-textual changes such as moving images and resizing
them could be missed when saving.

This is because TinyMCE does not treat the image move/resize as an
undolevel and does not register this via regular "onChange" event.
2013-01-30 11:54:29 +13:00
Kirk Mayo
d12ae82f70 Bug fix for open/8181 which stops the HTML source editor window saving/publishing 2013-01-21 08:26:19 +01:00
Ingo Schommer
f30277c3cf Split out getLinkAttributes() in .htmleditor JavaScript for more flexibility
Saves us from overwriting the whole insertLink() method just
to add another option.
2013-01-14 16:54:58 +01:00
Ingo Schommer
d13c53fda6 Merge remote-tracking branch 'origin/3.0' into 3.1
Conflicts:
	tests/model/DataQueryTest.php
2012-12-14 10:57:28 +01:00
Loz Calver
639cc0222c BUG Fix insert media form inserting images from other UploadFields (fixes #8051)
The insert media form would pick up unwanted images from other
UploadFields. Limiting where it is looking to only the closest form
fixes this.
2012-12-12 15:55:33 +00:00
Simon Welsh
b0121b541c Add codesniffer that ensures indentation is with tabs. 2012-12-12 17:33:31 +13:00
Simon Welsh
fc5dd2994c Add codesniffer that ensures indentation is with tabs. 2012-12-12 00:12:11 +13:00
Ingo Schommer
fa84c2d705 Merge remote-tracking branch 'origin/3.0' 2012-12-10 17:50:43 +01:00
Ingo Schommer
b15b5cd115 Ability to replace entire content in HTMLEditorField JS API 2012-12-10 15:39:15 +01:00
Sean Harvey
6ce6f9a2c1 Merge branch '3.0' 2012-11-26 17:17:41 +13:00
UndefinedOffset
4310718b94 BUG Insert Media, inserts all previous media (fixes #7545) 2012-11-23 17:37:39 +01:00
Mateusz Uzdowski
b02b1e6dbc API Forward the editor events to underlying textarea.
Makes the editor API more flexible by triggering generic JS events that
can be used from entwine. This makes it easier to add event handlers to
the editor and cleans up the initialisation call from unrelated code.

The patching code also forwards editor changes to the textarea field,
which in perspective will allow the changetracker to react to changes in
this field as they happen.
2012-11-23 00:50:18 +01:00
Normann Lou
5152164d17 BUGFIX: Multiple HTMLEditorFields not redrawing, fix by storing its container object before setting timeout 2012-11-05 11:56:29 +13:00
Ingo Schommer
680baab925 BUG Delay HTMLEditorField showing (TinyMCE workaround)
Delayed show because TinyMCE calls hide() via
setTimeout on removing an element,
which is called in quick succession with adding a new editor
after ajax loading new markup

See e0378ceb77
and https://github.com/silverstripe/sapphire/pull/847
2012-10-08 21:44:03 +02:00
jean
17bd8733d0 FIX 7853 Flush the content of drop down fields when closing html editor linker (links and images) 2012-09-10 11:12:05 +12:00