Commit Graph

125 Commits

Author SHA1 Message Date
Luke Towers f819aa607d Hide the loading indicator after AJAX request
Fixes #2780
2017-05-25 11:58:52 -06:00
José Longo e13fba6068 add missed js language file in /modules/system/assets/js/lang 2017-04-11 14:37:22 +01:00
Samuel Georges b6fedfb688 Specify explicit form element
This allows request elements external to the form to serialize a target form for use. An example might be a search form at the top of a page, list of results in the middle, then the pagination at the bottom. The pagination would need to target the search form with data-request-form to persist the search query value.

This should work with the JS API too, passed as an object, because $($()) is acceptable in jQuery
2017-03-19 13:54:21 +11:00
Samuel Georges 5f91c45f79 Implement disabled support for some form widgets
Recompile assets
Fixes #2749 (Media Finder)
Fixes #2750 (File upload)
Fixes #2751 (Rich Editor)
Refs #2724
2017-03-14 13:52:47 +11:00
Luke Towers cdc8b23fd4 Fixing same-origin AJAX requests
jQuery sends multiple values for the `X-REQUESTED-WITH` header if it has already been set, even when the value is the same. This means that same-origin requests would send `X-REQUESTED-WITH: XMLHttpRequest, XMLHttpRequest` which isn't detected as AJAX by Laravel/Symphony.

To fix this issue while retaining the crossDomain usage of framework.js, I've used `crossDomain: false` to trick jQuery into sending the header anyways on cross-origin requests. This is still changeable by the user in the `ajaxSetup` event.
2017-02-15 09:56:43 -06:00
Luke Towers c4031de6d6 X-Requested-With to uppercase
Style change because headers are case insensitive
2017-02-14 17:53:43 -06:00
Luke Towers 88d53ec0d5 Support CORS requests via framework.js
Adds support for Cross-Origin requests made via framework.js by manually adding the `X-Requested-With: XMLHttpRequest` header required for server-side detection of AJAX requests that is sent on normal Same-Origin AJAX requests but stripped by default by jQuery when making Cross-Origin requests. Note: Request target server still needs to have `Access-Control` headers configured correctly to return a request.
2017-02-14 17:46:56 -06:00
Luke Towers 37a735c8ed Process JS API requests through the document
Process JS API requests ($.request(handler, options)) through the document object instead of a non-existent form element. The form element was originally added because the framework only supported requests made from within a form
```
[22:08:12] spunky:	The $triggerEl was implemented because previously it was just $form
[22:08:24] spunky: For data-requests without a form, these events were being ignored
[22:08:31] spunky:	So as a workaround I implemented $triggerEl
```
As this is no longer the case, any JS API requests will now be made through the document element instead to support listening to events (such as ajaxSetup) even when there is no real attached element to trigger them on.
2017-02-06 10:36:57 -06:00
Samuel Georges d2082e0ea0 Throw an error when framework loads twice
Fixes #2379
2017-02-05 06:49:11 +11:00
Samuel Georges 562f60730f Fix bug in handleConfirmMessage override 2017-02-04 20:15:13 +11:00
Samuel Georges 6cd76e9c6d Add handleValidationMessage override function 2017-02-04 20:03:45 +11:00
Samuel Georges 88ed5c2c64 Dedicated ajaxSetup event for modifying option
Allow overriding confirm message with handleConfirmMessage function
2017-02-04 19:44:53 +11:00
Samuel Georges 7bcc31eef8 Add handleRedirectResponse override function 2017-02-04 19:14:26 +11:00
Samuel Georges e323a1b98a Added handleFlashMessage function to framework.js
- Used for handling flash messages via JS API

Request options are now passed to ajaxBeforeSend & ajaxPromise events

Improved framework extras
- Fixes data-request-flash when used within a plain form, this code would fail because $triggerEl is set to a plain form:
`<form><button data-request="..." data-request-flash>...</button></form>`
2017-02-04 15:42:43 +11:00
Samuel Georges 08c5a27e50 Peer review 2be18764d4 2017-02-04 09:21:45 +11:00
Luke Towers 2be18764d4 Support passing objects as the loading indicator
Adds support for passing objects to be used as the loading indicator. Note: Objects must support `.show()` and `.hide()` methods.
Example:
```js
$.request('onHandler', {
    loading: $.oc.stripeLoadIndicator
});
```
2017-02-03 15:54:59 -06:00
Samuel Georges ebed3cde5e Add afterUpdate event to match keyup
Recompile assets
Refs #2336
2017-02-03 06:50:38 +11:00
Samuel Georges 56ad25ec6f Remove code deprecations for 2017
Recompile assets
2017-01-26 11:26:53 +11:00
Samuel Georges 6679aa6557 Increase default flash message interval
The data-validate-error container does not necessarily need to reside inside a form, but give it priority if it does.
2016-11-28 20:48:05 +11:00
kaserv 4025b4885b fix for array fields validation in client-side framework 2016-11-22 17:04:41 +04:00
Samuel Georges 0a8f169cc3 Improvements to framework extras
- Form validation
- Button loader
- Flash messages
2016-11-18 07:41:02 +11:00
Samuel Georges 10326c2d63 Framework supports passing a "flash" option
This will request the Flash contents, if they are available. It also clears the flash bag contents, which is why this is an optional feature.
Introduced "ajaxValidation" event for capturing all invalid fields at once
2016-11-18 07:39:54 +11:00
Samuel Georges 88196fb660 Allow passing an explicit format to datepicker
Refs #1919
Recompile assets
2016-10-20 08:44:14 +11:00
Samuel Georges d788b7e03f Use select2 on touch devices
This is a relic from when select2 v3 had no mobile support, we use select2 v4 now that has been tested with mobile/touch devices.
Refs #108
Clean up some white spaces
2016-10-17 08:38:01 +11:00
Samuel Georges 571ceff1ef Merge pull request #2416 from GitJaap/develop
Add current url to ajax requests in requestOptions used in XHR full pageloads
2016-10-17 08:06:38 +11:00
Samuel Georges 991f7fc3b8 Fixes styling formatted content as raw
Refs #2390
2016-10-13 06:35:34 +11:00
Samuel Georges d62bbd5c5b Merge pull request #2390 from dshoreman/patch-3
Format the formatted tab for mail logs
2016-10-13 06:31:55 +11:00
Samuel Georges 8c91bfe66c Update froala to latest, recompile assets 2016-10-12 06:33:28 +11:00
Jaap Wesdorp 972cad3f6f Add current url to ajax requests in requestOptions 2016-10-11 17:33:04 +02:00
Alwin Drenth 48d38a8e11 Update Dutch language 2016-10-03 17:21:55 +02:00
Dave Shoreman 67e682f4ff Format the formatted tab for mail logs
The default markup is built by the jQuery plugin, meaning the formatted tab just shows raw data.

This checks for a Message-ID: string in the source to identify email logs, and uses the unescaped content of the raw tab to show a formatted email.
2016-09-25 04:10:53 +01:00
Samuel Georges 3499db5e53 Unescaped raw content is an oxymoron 2016-09-25 11:59:03 +10:00
Samuel Georges 6b60673092 Don't show hover effects for rows with no links
Minor fix to head checkbox alignment
Recompile assets
2016-08-27 14:35:32 +10:00
Samuel Georges c4007dd570 Recompile assets 2016-08-08 08:28:14 +10:00
Samuel Georges b08e2c4912 Introduce deep hashing on asset combiner
Added cms.enableAssetDeepHashing config item, disabled by default
Recompile assets
Refs #2248
Refs https://github.com/octobercms/library/pull/225
2016-07-30 15:06:50 +10:00
Samuel Georges 5af9fcbfdc Sidebar needs to sit above dropdown overlay
This prevents the mouseout event firing and ending the entire show
Recompile assets
Fixes #2190
2016-07-23 09:42:18 +10:00
Jens Herlevsen 40a755a6cc Expose danish language in backend locale dropdown 2016-07-03 19:36:24 +02:00
Samuel Georges 927250e9c9 Allow customization of default rich editor buttons
Fixes #2078
Recompile assets
2016-06-11 13:51:34 +10:00
Alwin Drenth 47c038c96e Update Dutch (nl) language (#2086) 2016-06-04 12:16:17 +10:00
Nicola Marini df625ea7d5 Update italian (it) language (#2083)
* 🇮🇹 Update ita lang

Update italian language

* 🇮🇹 Ita lang
2016-06-02 05:58:53 +10:00
vasilslavchev@gmail.com 8c93404576 Bulgarian translation (#2077)
Bulgarian translation for october modul - system. VasilSlavchev@gmail.com

Bulgarian translation for october modul - cms. VasilSlavchev@gmail.com

Bulgarian translation for october modul - backend. VasilSlavchev@gmail.com
2016-06-02 05:57:00 +10:00
Samuel Georges 45fe9b3e88 Styling improvements to the exception beautifier
Recompile assets
2016-05-28 15:10:29 +10:00
Samuel Georges f4b1c586bb Clicking a non-submit type link should allow event propagation
This is useful when an AJAX request link appears inside something like a dropdown. When the link is clicked, the dropdown should close like normal, however this is not the case since the value `false` is returned; so the expected behavior doesn't occur. As a solution, `false` is no longer returned, the default behavior on the event is prevented instead, allowing the propagation to proceed as normal.
2016-05-28 13:02:54 +10:00
Jérémy Gaulin 69d8449a7d Reverted to HTML source cached fot the popup to prevent select bug 2016-05-27 01:15:28 +02:00
Jérémy Gaulin a888fe6e47 Fix the double-popup animation effect due to bad nesting (#2058) 2016-05-27 08:53:17 +10:00
Samuel Georges 17dca5c06e Fixes broken language key 2016-05-27 07:54:46 +10:00
Samuel Georges abc9879ba7 Recompile assets 2016-05-26 05:32:49 +10:00
Jérémy Gaulin c2e621e504 Improved exception beautifier plugin
- Keep the raw message in another tab
- Added a button to show/hide the stacktrace
- Fixes Windows paths
2016-05-25 13:54:09 +02:00
Samuel Georges 30f7c03718 Fixes colorpicker when used inside a popup
Fixes #1145
Refs #1021
2016-05-25 06:37:03 +10:00
Jérémy Gaulin 873ed8b90e Improved exception beautifier plugin. Fix naming conventions. 2016-05-24 04:57:55 +02:00