Commit Graph

106 Commits

Author SHA1 Message Date
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
Ingo Schommer
3b592122fd i18n for "select an anchor" string (see #7798) 2012-08-26 23:58:31 +02:00
Ingo Schommer
a033ddf773 More init checks in HtmlEditorField.js 2012-07-16 23:33:22 +02:00
Mateusz Uzdowski
7c41ff22ab BUG Change all shortcodes into the new, comma separated, format.
Space delimiter is often confused by browsers, and encoded as %20 which
breaks the shortcode system. Change to comma delimitation has already
been implemented, this is a followup cleanup.

Ref http://open.silverstripe.org/ticket/7337
2012-07-12 16:44:21 +12:00
Mateusz Uzdowski
29a039929b Refactor the linking functionality for the TinyMCE popup.
Functionality that affects the values in the form better fits in
updateFromEditor function, where we expect the form to be modified.
Redraw should only affect visibility parameters.

Also added a more robust reset code, so we can always expect to get at
least a clean form, and re-added missing "target" checkbox.
2012-07-12 16:44:15 +12:00
Mateusz Uzdowski
eef67b6f87 API Clean up the return values for getCurrentLink
Returning a link type "internal" in the situation when no link has been
detected is confusing and makes it hard to know downstream if the link
was detected or not. Switched that to null.

Also added target option to file downloads, as we don't currently have a
mechanism to default this field to "yes" for files.
2012-07-12 09:13:32 +12:00
Ingo Schommer
682a6a0d1b BUGFIX "Insert media" loading indicator (fixes #7542)
No "working" indicator in insert media from web button.
Returning the $.ajax object to allow for deferred callbacks
on events other than 'success'
2012-06-22 10:25:15 +02:00
Hamish Friedlander
65030906ad BUGFIX: Add validation to fix open.silverstripe.org ticket #7494
When adding media via the HtmlEditorField dialog, the value of the URL field wasnt being validated. Youd get different errors depending on if the field was empty
or if it had text, but it didnt look like an absolute URL to HtmlEditorField#viewfile.

This adds some javascript validation to make the text field look like a URL field
2012-06-21 14:19:41 +12:00
Hamish Friedlander
ef11a0dc78 BUGFIX: Fix trac ticket 7081
IE contentEditable carets and selection boxes show on top of any elements, interfering with HtmlEditorFields dialogs.
This fixes that by storing the selection prior to opening the dialog, then unselecting everything. On dialog close the
selection is restored
2012-06-20 15:27:56 +12:00