Commit Graph

657 Commits

Author SHA1 Message Date
Ben Thomson 4950edc196
Add sensitive field input (#5201)
A field widget that allows for entering of sensitive information that can be revealed at the user's request - ie. API keys, secrets.

When a sensitive field that has been previously populated is loaded again, a placeholder is used instead of the real value, until the user opts to reveal the value. The real value is loaded via AJAX.

Credit to @tomaszstrojny for the original implementation.

Replaces #5062. Fixes #5061, #1850, perhaps #1061.

Co-authored-by: Tomasz Strojny <tomasz@init.biz>
Co-authored-by: Luke Towers <github@luketowers.ca>
2020-07-08 16:26:38 +08:00
Luke Towers b384954a29 Improve Froala sanitization of pasted content. 2020-06-18 11:03:48 -06:00
Romain 'Maz' BILLOIR 81a11f70c4
Fix Froala strip empty tags issue (#5126)
Co-authored-by: Ben Thomson <git@alfreido.com>
2020-06-16 14:59:40 +08:00
Luke Towers 9ecfb4867b Add new backend.allow_unsafe_markdown permission 2020-05-25 18:02:20 -06:00
Luke Towers fc8e258c6d set attributes and save instead of creating via mass assignment to play nicer with various features and avoid requiring fillable properties to be set 2020-04-29 16:48:46 -06:00
Luke Towers 4f7e2995c7
Simplify Media Library upload logic (#5026)
Based heavily off the work done by @alxy in #4314

May require https://github.com/rainlab/pages-plugin/pull/421 if testing with RainLab.Pages.

Replaces #4314, related: #4311, Credit to @alxy for the initial work.
2020-04-04 02:11:28 -06:00
Luke Towers 459677a168 Code cleanup left over from #4311 2020-04-04 00:44:44 -06:00
Tobias Kündig 86197f59cb
Add Preset buttons for editor toolbar settings (#4700)
Fixes #4187.
2020-04-03 08:47:20 -06:00
Luke Towers d9a7942058 Fixed issue where Froala toolbar popups appearing outside of the editor would not display.
Code was left over from when redactor was still the main editor.
2020-04-02 11:38:45 -06:00
Romain 'Maz' BILLOIR 2b22c0e49a
Allows model scope with join (#4970)
More info in [this forum post](https://octobercms.com/forum/post/displays-a-related-model-with-scope-which-uses-join-doesnt-work-is-that-an-october-issue)
2020-03-31 16:45:19 -06:00
Luke Towers d3596310c6 z-index fixes for richeditor toolbar.
Fixes #4868. Related to d7b0e55ceb.
2020-03-31 01:35:21 -06:00
Luke Towers 52cdfda935 Trigger form change events when items are added / removed in a repeater.
Fixes #3595. Replaces #4736. Credit to @SebastiaanKloos for the initial solution.

Also fixes a longstanding issue where dynamically added fields were not considered when refreshing dependant fields.
2020-03-30 18:07:53 -06:00
Klaas Poortinga 3a7224c2ec
Improve richeditor support for preview mode and attributes property (#5011) 2020-03-30 11:33:03 -06:00
Klaas Poortinga 141893d6a7
MediaFinder modifications (#5010) 2020-03-30 11:30:59 -06:00
Klaas Poortinga 280ae00b88
Colorpicker improvements (#5002)
* add readonly and disabled support to colorpicker

* add support for attributes in colorpicker widget

* Hide default options is disabled and readonly state. Modify styling to be more inline with spectrum disabled state
2020-03-29 10:06:02 -06:00
Klaas Poortinga 2ad046f7ae
Markdown formwidget improvements (#5004)
* add readonly and disabled support to markdown editor

* add attributes support to markdown editor
2020-03-29 09:37:03 -06:00
Klaas Poortinga 1aa3250c3a
Add support for the attributes property to fileupload formwidget (#5012) 2020-03-29 09:03:31 -06:00
Klaas Poortinga c79bea7449
Modify codeditor widget to implement html attributes set through form field definition (#5001) 2020-03-25 14:47:39 -06:00
Ben Thomson cca8da2af3
Get correct model when not using ID for "keyFrom" in Record Finder (#4977)
getLoadValue() was previously using the find method for getting the selected model on load when not using the Record Finder in relation mode.

This means it was searching by the primary key, regardless of whether the keyFrom setting on the Record Finder widget was changed. This has the effect of the keyFrom setting being correctly used to determine the value of the record finder field when a model is selected, but the widget being unable to find the model when it refreshes or reloads.

This change instead searches for the field's value in the column specified for the keyFrom setting, allowing us to use a different identifying column for loading the selected record.
2020-03-13 07:47:01 +08:00
Luke Towers 307a662647
Improve German translation (#4961) 2020-03-04 14:49:54 -06:00
Samuel Georges dc5431f9c4 Apply z-index change to CSS
Refs #3837
2020-02-09 17:27:18 +11:00
Ben Thomson 3f982c25c7
Add "styles" for repeater widgets (#4877)
Can be one of three values:
- "default": Shows all repeater items expanded on load.
- "collapsed": Shows all repeater items collapsed on load.
- "accordion": Shows only the first repeater item expanded on load. When another item is clicked, all other open items are collapsed.

Implements  #4801. Refs: https://github.com/rainlab/builder-plugin/issues/165, #2631
2020-02-02 09:12:01 +08:00
Ben Thomson c046466913 Set Dropzone.js uploaders to have no time limit (#4878)
The upgrade to the latest Dropzone.js brought in a new `timeout` configuration variable, which defaults to 30s. This removes the time limit and restores original functionality.

Fixes #4869
2020-01-14 16:47:25 -06:00
Ben Thomson c17cb58aa1 More strict checking of addItem request for child repeaters (#4814)
Similarly named repeater fields being used in viewBag variables were being assigned aliases which succeeded the `strpos` check on line 407. This will more clearly look for a child repeater form and index.

Fixes #4808
2019-12-12 21:44:10 +11:00
Blaž Oražem 8abed1794f Slovenian language added (#4796)
* Add Slovenian language
2019-12-10 20:17:42 +11:00
Philipp Fehr 9dc54baddd Fix race condition when clearing recordfinder value (#4802)
Credit to @TheFehr. Fixes #4800.
2019-12-04 10:14:19 -06:00
Luke Towers 85fadbfef3 Check user permission for the mediafinder formwidget.
Fixes #4216. Replaces #4669. Credit to @gergo85.
2019-11-12 12:32:17 -06:00
Tomasz Strojny 8fb9c59ee1 Removed double checking if file is protected in FileUpload widget (#4753)
Credit to @tomaszstrojny. Cleanup from 4f7c5cc1e7.
2019-11-11 12:34:58 -06:00
Ben Thomson e97057246a
Fix empty Richeditor class lists from breaking widget (#4725) 2019-11-06 17:44:46 +08:00
Luke Towers fa93781645 Added ability to filter down the permissions presented by the PermissionEditor
You can now specify an array of "availablePermissions" to the PermissionEditor FormWidget that it will use to further down the list of permissions that are up for managment by the current user.
2019-10-15 17:37:59 -06:00
Luke Towers a69c76116f Added support for mode: switch to the PermissionEditor formwidget 2019-10-15 16:46:02 -06:00
Luke Towers 5862683a7a
Trigger change event on clearing recordfinder
Fixes #3591.
2019-10-13 06:15:19 -06:00
Luke Towers 9ac292d921
Merge pull request #4690 from pkarecki/master
Credit to @pkarecki
2019-10-11 12:46:01 -06:00
Piotr Karecki 06b7031131
Move prompt to lang
Move default prompt text to i18n file.
2019-10-11 20:12:08 +02:00
Luke Towers e246427463 Provide system.assets.beforeAddAsset event to modify asset attributes
Fixes octobercms/october#4611 (when combined with a PR to https://github.com/heathdutton/cloudflare)
Related: octobercms/october#4092, octobercms/october#3841, octobercms/october#3839
2019-10-09 11:51:06 -06:00
Luke Towers 96e335aebc
Fix #3415, #4672 (#4674)
Handle child FormWidgets making AJAX requests outside of the repeater's form container. Note that this won't pass on the state of the repeater item as it exists on the webpage because that information won't be sent to the server in an AJAX request sent from outside of the repeater's form container unless the FormWidget sending the orphaned request specifically includes that data in their request, in which case the regular handling will kick in and initialize the widget properly. A discussion should be had whether this fix makes sense to be done in the Repeater FormWidget or if we should force FormWidgets to have the responsibility of initializing their parent repeaters if they're going to be making orphaned AJAX requests.

Should fix #3415, #4672.
Related: octoberrain/test-plugin#78
2019-10-09 08:08:21 -06:00
Ben Thomson 970cc4550c
Improve internal docs for DataTable callback handler
- Changes parameters to match their intended data.
- Updates docblock
- Minor code cleanup

Refs: https://github.com/octobercms/october/issues/4664#issuecomment-539028664
2019-10-07 22:19:13 +08:00
Harmen Janssen 83d14c8503 Add support for order option on relation FormWidget (#4654)
Credit to @harmenjanssen. Documented in https://github.com/octobercms/docs/pull/406
2019-10-06 00:24:31 -06:00
Samuel Georges 52e2a838eb Fixes typo, recompile assets 2019-09-11 21:42:02 +10:00
Samuel Georges 3291e07191
Update Deprecated code in October into (event.key) (#4489)
Update Deprecated code in October into (event.key)
2019-09-11 21:35:18 +10:00
Samuel Georges 31145a3eb7 Peer review visibility changes
It makes more sense to use a consistent UI for all modes, the CSS is cleaner as a result. The code editor toolbar has been moved to the bottom across all instances. This is favourable to it bleeding outside of its perimeter.

Refs #3947
Refs #3948
2019-09-11 20:54:14 +10:00
Samuel Georges 96537033c8 Recompile assets 2019-09-11 20:02:43 +10:00
Ayumi Hamasaki 6942e38615 Remove the IE5 - IE7 Holly Hack support (#4594)
Credit to @ayumihamsaki
2019-09-04 09:32:29 -06:00
Ayumi Hamasaki 92e975ffa3 Make the Code editor fullscreen button easier to see (#4546)
Credit to @ayumihamsaki
2019-09-03 11:13:41 -06:00
Luke Towers de3f8142fb Support multiple instances of the PermissionEditor on a single page 2019-08-29 17:51:52 -06:00
Dan Harrin 3365820178 Use selected dropdown item as repeater title (#4544)
Credit to @DanHarrin. Initial implementation by @MattPurland. Finishes https://github.com/octobercms/october/pull/2956
2019-08-16 16:13:35 +08:00
Ayumi Hamasaki 7aae3f1ef8 Upload vendor file Spectrum V1.8.0 (#4536)
Credit to @ayumihamsaki
2019-08-15 10:04:59 -06:00
Luke Towers 36ab42aa24 Ensure the the TagList FormWidget is respecting relationship constraints (conditions & scope) 2019-08-14 19:58:42 -06:00
Luke Towers b75d0af966 Improve support for previewMode in Repeaters & NestedForms
Fixes #4521
2019-08-10 09:28:01 -06:00
Ben Thomson b5a3c64bf1
Fix "widget not bound to controller" error for nested repeaters (#4434)
Since repeaters have no value by themselves, a repeater that contains only another repeater was throwing a "widget not bound to controller" exception when adding a new item - the repeater item processing was not creating a form widget for the inner repeater on load, or in an AJAX call. This fix specifically checks if a child repeater has called for a new item, and if so and the current repeater has no value for this particular item, it will add a "stub" form widget to correctly bind the widget.

Fixes #4344.
2019-08-07 22:44:31 +08:00