267 Commits

Author SHA1 Message Date
Johannes Meyer
f2e53d420b js: Don't mark requests caused by __BACK__ as autorefresh
It's not an autorefresh and causes issues with form.js otherwise.
2021-02-05 16:38:17 +01:00
Johannes Meyer
4019522da1 loader.js: Disable inputs in forms not having role search
Previously only the `#search` input wasn't disabled, now also
the new filter input isn't. This is required to re-focus the
input after submission as disabled elements loose focus.
2021-01-14 11:57:06 +01:00
Johannes Meyer
5924d610a1 js: Provide additional parameters for events beforerender and rendered
beforerender: content, action, autorefresh, scripted
rendered: autorefresh, scripted
2021-01-14 11:57:05 +01:00
Johannes Meyer
46769b9be2 js: Add .impact to .content if a control is automatically submitted 2021-01-13 17:19:39 +01:00
Johannes Meyer
fbf3a1f757 loader.js: Don't add form submits other than GETs to the history
This has previously not been an issue, as form submits seem to have
never targeted another url than their container's current one.
Though any form that did this, was pushed to history upon submit.
This happens now only for `GET` forms.
2021-01-13 17:17:48 +01:00
Johannes Meyer
3e29fba052 js: Transmit X-Icinga-Autorefresh=1 with autorefresh requests 2021-01-13 17:16:53 +01:00
Johannes Meyer
2c7b2330a7 loader.js: Support behaviors as well as multipart update targets 2021-01-13 17:16:30 +01:00
Johannes Meyer
0b94489c7e loader.js: Introduce new header X-Icinga-Location-Query
This header is only used in case the response includes
multipart content. It's meant to provide a new query
string that replaces the one of the targeted container
and the resulting change also replaces the current
history entry.
2020-11-06 11:26:05 +01:00
Johannes Meyer
70c3023f3c loader.js: Also match newlines when interpreting multipart content 2020-11-06 11:21:33 +01:00
Johannes Meyer
e68e8c8e9c loader.js: Only discard content if a renderHook returns null
Previously any false value had this effect, though empty strings
were also discarded due to this. However, in case an empty string
is the content in the first place, the content must be updated.
2020-11-06 11:21:33 +01:00
Johannes Meyer
4ce9165f77 js: Don't force focus in multipart updates if focus isn't affected 2020-11-06 11:20:28 +01:00
Johannes Meyer
2a64a97302 js: Don't add class impact to already finished targets 2020-06-08 10:49:02 +02:00
Alexander A. Klimov
4232a344b7 Icinga.Loader#onFailure(): treat 5xx response as connection failure
... not to break the container with the reverse proxy's response not fitting into our layout.

refs #4133
2020-04-24 08:39:23 +02:00
Johannes Meyer
344598e845 loader.js: Wait for cols being painted prior adding class impact
Allows for the new loading effect's transition to play correctly
also for columns which get opened the first time.
2020-04-14 10:40:23 +02:00
Johannes Meyer
969c1615c7 history.js: Don't load location bar as if it's an autorefresh 2020-02-28 14:37:46 +01:00
nmartini
1cf2f767a2 Make sure that class container has its container 2020-02-28 08:30:23 +01:00
Johannes Meyer
3464455021 js: Preserve scroll position if focus is forced to a particular element 2020-01-16 15:54:17 +01:00
Johannes Meyer
8bc84a5f9e js: Teach the url parsing a final lesson about query strings
`utils.parseParams()` now returns an array instead of an object.
This may require some changes in modules using this directly or
by `utils.parseUrl().params`

refs #4056
2020-01-16 13:45:10 +01:00
Johannes Meyer
844cb911a4 loader.js: Use utils.addUrlFlag instead of the now deprecated one 2020-01-15 08:00:04 +01:00
Eric Lippmann
7f8ee4f94d JS: Deprecate Icinga.Loader.addUrlFlag() in favor of Icinga.Utils.addUrlFlag() 2020-01-14 14:58:34 +01:00
ValeDaRold
5edd267f2a Refresh container if X-Icinga-Extra-Updates with length 1 is defined (#3970)
* Refresh container if X-Icinga-Extra-Updates with length 1 is defined
2019-12-12 13:50:03 +01:00
Johannes Meyer
d6677bfb66 loader.js: Also preserve scroll position of display:flex containers 2019-12-11 15:27:03 +01:00
Johannes Meyer
55b9b44be9 js: Fix error when focusing navigation anchors 2019-12-11 09:27:18 +01:00
Johannes Meyer
4af48c797d js: Remove ui.fixControls() and ui.initializeControls()
Hooray!
2019-12-06 15:39:14 +01:00
Johannes Meyer
48098a2830 js: Don't initialize modules using a beforerender event
`beforerender` is already too late. Module initialization
done using an event handler is wrong anyway. It's some
kind of bootstrapping after all and should be performed
by parts of the code which is directly responsible for
DOM content handling of modules. (i.e. loader.js)

This change though introduces a side-effect which was
not the case previously: Nested `.container` elements
trigger `rendered` events now. I've introduced this to
ensure we're also lazy loading modules and let them
handle their `rendered` events right after a redirect
which rerendered the layout. (Only `#layout` got a
`rendered` event then prior to this change)
2019-11-21 09:55:20 +01:00
Johannes Meyer
5f739deea3 loader.js: Enhance __BACK__ handling 2019-11-05 15:04:23 +01:00
Johannes Meyer
da565f4d16 loader.js: Refresh left twice in case right has been closed..
..if the redirect target is `__BACK__`
2019-11-04 17:25:05 +01:00
Johannes Meyer
42e596f457 loader.js: Navigate back if redirect target is __BACK__ 2019-11-04 16:03:54 +01:00
Johannes Meyer
c0cac6fe3c loader.js: Allow to use a separate target for redirections 2019-11-04 12:46:30 +01:00
Johannes Meyer
0e5e046ae5 js: Split event handling and processing of form submits 2019-11-04 12:46:30 +01:00
Johannes Meyer
50bf126d36 js: Move function events.getLinkTargetFor to loader.js 2019-11-04 12:46:30 +01:00
Johannes Meyer
2896cbd781 loader.js: Avoid named capture groups to parse multipart content
fixes #3975
2019-10-07 14:35:49 +02:00
Johannes Meyer
a8dc609b62 loader.js: Add support for multipart content
refs #3953
2019-09-25 10:34:24 +02:00
Johannes Meyer
dda49b5ff1 loader.js: Drop redundant method cacheLoadedIcons 2019-09-25 10:34:24 +02:00
Johannes Meyer
da513a746d loader.js: Add support for extra updates
refs #3953
2019-09-25 10:34:24 +02:00
Johannes Meyer
b15c012671 loader.js: Only pre-wrap a search response's html with a div
It's not required for all responses anymore.

refs #3953
2019-09-25 10:34:24 +02:00
Johannes Meyer
f98f988aff Remove tristate form element 2019-09-23 08:36:24 +02:00
Johannes Meyer
5333bbf04d loader.js: Also set title directly if layout is base target 2019-08-02 15:42:58 +02:00
Johannes Meyer
b168c3d7db js: Don't use jquery.focus shorthand anymore, but icinga.ui.focusElement 2019-07-18 07:57:14 +02:00
Johannes Meyer
6323a065ea loader.js: Keep using the promise interface for complete callbacks 2019-07-18 07:57:14 +02:00
Johannes Meyer
5cf71c9bbd js: Drop iframe-upload fallback for IE 2019-07-18 07:57:14 +02:00
Jennifer Mourek
f6a5f952bb loader.js: Remove comment 2019-07-18 07:56:09 +02:00
Florian Strohmaier
5fe264be6a JS: Fix errors
refs #3813
2019-07-18 07:56:09 +02:00
Johannes Meyer
f6d40a9d1c loader.js: Directly set the window's title for full layout requests
refs #3851
2019-07-15 08:24:44 +02:00
Johannes Meyer
43c87d2388 loader.js: Return in onComplete upon handled redirects
Got changed with f12a5741b8a4c53b7e5d94e43094e18d5a946934. Triggering
rendered events for stuff that's never displayed doesn't seem right.
2019-04-30 09:23:59 +02:00
Johannes Meyer
f72aa291bc
Merge pull request #3610 from Icinga/fix/window-id-cannot-be-used-to-differentiate-containers-3609
Fix window id cannot be used to differentiate containers
2019-04-17 11:38:48 +02:00
Johannes Meyer
4900040d47 js: Restore previous title when closing right column
fixes #3654
2019-04-16 09:29:42 +02:00
Johannes Meyer
d8c4fcc517
Merge pull request #3661 from Icinga/feature/preserve-scroll-position-upon-form-submits
Preserve scroll position upon form submits
2019-04-16 08:04:15 +02:00
Johannes Meyer
cb3528a7be js: Don't scroll to re-focused elements after auto-refreshes
refs #2048
refs #3295
refs #3492
refs #3518
2019-04-15 15:42:14 +02:00
Johannes Meyer
f54f2f8627 js: Prevent flickering when refreshing scrolled content 2019-04-15 14:27:14 +02:00