The "ID" form field is not always defined,
for example in the "Replace" tab of the "versionedfiles" module
(which uses GridFieldDetailForm). Since the path to that
detail form relies on the "ID" in AssetAdmin->currentPageID(),
and does an is_numeric() check to support the "root" folder,
we need to leave the "ID" param out completely.
Checked this without versionedfiles module in admin/assets
as well as a custom UploadField in CMSMain.
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.
Added trim() to decodePath function. Headers X-Include-* comes with a
space so some files are loaded twice. Looks like that depends on a
webserver. nginx has the space.
The files are uploaded to transifex.com now, which means we needed
to consolidate the file names (= locales). Since Transifex doesn't allow
arbitrary JavaScript structures, we're using an intermediary JSON
format which gets transformed into the JS used by the framework.
See b59f3858af for generator logic.
Fixes https://github.com/silverstripe/silverstripe-framework/issues/2499
Also fixed UploadField operation with canUpload=false,
which broke the JS because no config could be found,
since the <input> field wasn't present. We can't put the data-config
attribute on the field holder, since fields can be rendered
without their field holder through FormField->SmalLFieldHolder().
Fixes https://github.com/silverstripe/silverstripe-cms/issues/874
DO NOT MERGE: to be reviewed.
This feature request was born out of wanting the ability to disable (for example) a top level page from being selected, while still being able to select a child page. Using setFilterFunction() simply removes the node and its children.
Extra styling for disabled nodes
Disable ability to select a disabled node for TreeDropdownField
Disable hover CSS changes
Fixing merge conflict during rebase
Return a boolean for nodeIsDisabled()
It breaks the semantics of getValue(), leading to a broken field.
Regression from 8b5f89f. In the end, placeholder support is
considered "progressive enhancement", the search box should
be pretty obvious to IE8/IE9 users either way, given the main
field label is called "choose or search".
Set search option true on treedropdown fields by default, to provide a
fallback solution when trees fail to render (too many children errors)
Provide better indication/more meaningful styling to search (match
chosen styles for consistency)
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
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.
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).
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.
Sometimes GridState URL will have a query string already appended,
e.g. "?local=en_GB", but the GridField javascript assumes there won't
be.
The result would be an action URL like:
"/my/url?locale=en_US?RelatedPage=123" which is obviously invalid.
The fix is to check that "?" exists in the GridState URL and use
"&" instead to connect the URLs if that's the case.
Prevents situations where a previous action might finish out of line
and override later choices, such as first expanding the (full) tree panel,
then limiting the tree through searching.
The length of input fields can very quickly exceed the max URI length resulting in 414 errors when printing or exporting results.
To access the input values for a specific GridField action, encapsulate this in your own Entwine instance.
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
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.
It was impossible to unselect TreeDropdownField.
'!' operator should not be used at all and identical comparison (===) was too "strict" (self.getValue() returns string but $(node).data('id') returns number).
The accordion widget was previously being passed true and false, where as it either expects true or the integer of the panel to show.
This fix sets it as either false or 0.
Introduces the concept of action tabsets - usage of TabSet and Tabs
in between the action buttons to allow richer set of capabilities that
can be offered to the user.
Goes along with c8d0cdec99c95dbed3b58ebcc098cc9d22c58206 that implements
a change to the CMS actions.
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.
The escape and unescape functions do not work properly for non-ASCII characters and have been deprecated. In JavaScript 1.5 and later, use encodeURI, decodeURI, encodeURIComponent, and decodeURIComponent.
I have problem with cyrillic http://www.silverstripe.org/general-questions/show/21433
Put "File upload complete" and "back to folder" together. Turned 'File
upload' into a message, and updated the message styles.
Moved allowed file types into the area where users are uploading files.
This is a temporary fix until js tooltips are implemented, at which
point, these details will be shown when clicking a question mark beside
"Choose files".
Added small animation effect to files when opening iframe to edit. Now
slides down, rather than just appearing open
Linked to silverstripe/silverstripe-cms#223
Only occurs when the UploadField resources are loaded uncached.
Possible cause: Randomized application between UploadField.js
setting "display: block" and UploadField.css setting "display: none". Simply hiding the element before showing it fixes the issue.
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
The entire framework repo (with the exception of system-generated files) has been amended to respect the 120c line-length limit. This is in preparation for the enforcement of this rule with PHP_CodeSniffer.