Commit Graph

139 Commits

Author SHA1 Message Date
Saophalkun Ponlu
a0462b90cf BUG Fixes an issue where batch actions dropdown doesn't show up after ajax request back to the cms Pages section 2012-09-03 18:47:25 +12:00
Andrew Short
2503e481ff Only initialise chosen elements when visible. 2012-08-16 23:26:33 +02:00
Mateusz Uzdowski
70eaa270e4 API Allow to force URL reload, while replacing the history state
Comes with a wrapper for easy reloading of the current panel.
2012-08-16 22:02:19 +02:00
Ingo Schommer
f79d2df104 BUG More robust url comparison in CMS
Avoid ajax reloads when URLs differ in irrelevant ways,
e.g. admin/?locale=de vs. admin?locale=de.
This caused problems with the translatable module
reloading page content where it didn't need to,
because some previous robustness patches to the same problem
didn't apply (they only removed trailing slashes, ignoring
query parameter strings). The visible problem for this was
a broken tree panel, because it was ajax-loaded in parallel
with its container. Depending on ajax response order,
this would break the inner panel (in this case the tree),
since its original container was replaced with a new DOM.
2012-08-15 21:22:15 +02:00
Ingo Schommer
35ca67535d Merge pull request #667 from jakr/trac7617-followup
Fix edge case in sessionStorage detection for FireFox.
2012-08-10 01:42:58 -07:00
Hamish Friedlander
5591017577 BUG 3156e755 broke GridField Add forms because guessed frag was wrong 2012-07-27 11:13:23 +12:00
jakr
3bc2798e72 Fix edge case in sessionStorage detection for FireFox. If it is disabled using about:config, typeof will be object, but the value will be null. 2012-07-24 12:54:23 +02:00
Ingo Schommer
09067cc8dd NEW Open first tab with validation errors 2012-07-18 16:50:09 +02:00
Ingo Schommer
3156e75548 BUG Redisplay CMS forms with validation errors
Guess the fragment based on the returned HTML.
The validation error HTTP response is generated by Form rather than
the controller (LeftAndMain), so we can't set custom PJAX headers easily.
2012-07-18 16:50:04 +02:00
unclecheese
d571cdcc85 ENHANCEMENT: Hide the search bar in Chosen dropdown fields when list is reasonably short. 2012-07-16 10:10:01 +02:00
Ingo Schommer
bf91594e4f Disable tab state logic on uninit'ed tabs, allow opt-out
Fixes a problem when switching between ajax tabs,
e.g. "Content" and "Settings" in admin/pages/edit/show/<id>.
2012-07-13 17:34:55 +02:00
Ingo Schommer
c493dc730a Avoid lonely question mark for GridField URLs in CMS 2012-07-13 17:33:48 +02:00
Ingo Schommer
155758f546 NEW Save and restore tab state upon CMS navigation (fixes #7647)
Implemented independently of URL state to ensure that
state is retained on every user interaction, rather than
having to add it to each URL specifically.
Same reasons for not saving it as HTML5 history metadata,
as that's only inspected on history events, not
normal CMS navigation.
2012-07-13 16:46:23 +02:00
Ingo Schommer
a5a08530fc BUG Force "full" ajax content reload with invalid fragments
When one or more fragments are requested that are not in
the current DOM, we need to force loading the outermost
fragment instead (currently hardcoded to "Content").
This mainly prevents history back navigation from breaking,
e.g. admin/pages -> admin/pages/list ->
admin/pages/list/?ParentID=99 -> admin/pages/edit/show/5 -> (back)
2012-07-13 10:19:24 +02:00
Ingo Schommer
7a52a7fe41 BUG Default form submits to text/html, fixing validation (#7653)
Was using text/json, which Form->httpSubmission() interprets
(correctly) to returning JSON validation data.
This trips up the interface, which expects HTML with
the validation errors directly in the markup.
2012-07-12 17:10:50 +02:00
Ingo Schommer
fa62c1b0ba Smarter concat of query params in LeftAndMain.js
Broke when CMS URL already had query params,
such as ?locale=en_US with the Translatable module enabled.
With this patch it doesn't double-concat ?locale....
Still doubles query params, but that's acceptable
until we find a more solid URL manipulation lib for JS.
2012-06-29 14:23:01 +02:00
Sean Harvey
c801671a90 BUGFIX #7394: Allow unselect dropdowns in chosen if there's an empty option 2012-06-15 14:32:21 +12:00
Hamish Friedlander
acee026875 BUGFIX: Buttons in the cms that didnt have .ss-ui-button werent becoming buttons because we changed buttons to trigger on onadd, but the ss-ui-button class was being added dynamically 2012-06-15 01:19:31 +02:00
Ingo Schommer
ecb48bb57c BUGFIX Force full window reload on IE7/IE8 every 20 pushState requests (see #7258) 2012-06-15 01:19:20 +02:00
Ingo Schommer
5260738148 MINOR Avoid reinitialising tabs (see #7258) 2012-06-15 01:19:19 +02:00
Ingo Schommer
980686ab75 MINOR Limiting console.log() output to explicit enabling through window.debug to avoid failing IE 2012-06-15 01:19:19 +02:00
Hamish Friedlander
b86a787521 BUGFIX: Use new jQuery.Entwine event capturing, onadd and onremove features to plug some memory leaks 2012-06-15 01:19:15 +02:00
Ingo Schommer
2637969bcd API CHANGE Renamed JS event from 'reloadeditform' on 'aftersubmitform', 'beforesave' to 'beforesubmitform'. Listening to bubbled event on container to avoid binding to forms which are removed before the event is triggered. 2012-06-12 17:13:36 +02:00
Andrew Short
34eb1b39dd BUGFIX: Fixed incorrect variables breaking form submission. 2012-06-11 23:31:02 +10:00
Ingo Schommer
d4baf2d19d BUGFIX Stability improvements on CMS layout logic
- Changed application order
- Fixed layout trigger after preview toggle
- Replaced button row dimension approximation with double application of jQuery.layout() - once before sizing the action panel height to set correct width on container, then again for the height
2012-06-06 21:05:36 +02:00
Ingo Schommer
12f2e1e176 Merge branch 'pjax-multiple' 2012-06-05 14:01:18 +02:00
Ingo Schommer
460148c12a MINOR Debug messages for tracking down JS layout sequence issues (disabled by default) 2012-06-02 12:31:55 +02:00
Ingo Schommer
5a93ee77f8 MINOR Fixed tab selection state 2012-05-30 16:36:26 +02:00
Ingo Schommer
0eac6ea5c3 MINOR Apply loading indicators to all forms, not just .cms-edit-form (which means it includes the "pages list view"). Move to correct place in LeftAndMain.js (not specific to '.cms-content') 2012-05-30 16:36:25 +02:00
Ingo Schommer
19bfd01a60 ENHANCEMENT Declare a single DOM element with multiple Pjax fragments. Unified ajax response handling in CMS, followup from submitForm() refactoring. Removed replacement of arbitrary CSS selectors through Pjax, relies on a fragment now (to keep logic consistent). 2012-05-30 16:36:23 +02:00
Ingo Schommer
75e51de9ed API CHANGE Moved submitForm() from $('.cms-content') to $('.cms-container'), unifying ajax response handling between panel loading and form submission 2012-05-30 15:07:14 +02:00
Ingo Schommer
5178954311 UNFINISHED Processing multiple PJAX responses on CMS JavaScript, introducing data-pjax-fragment attribute to identify reloadable template parts 2012-05-30 15:07:13 +02:00
Ingo Schommer
5b03f49245 BUGFIX Respecting server-overrides on X-Pjax responses during ajax redirects. Fixes GridFieldDetailForm redirect after delete, e.g. in ModelAdmin. Partially reverts 8b4b896. Closes pull request #488 2012-05-29 11:34:47 +02:00
Mateusz Uzdowski
8d469b66c8 BUGFIX: add missing onunmatches 2012-05-23 16:24:15 +12:00
Sean Harvey
ce7a96b116 BUGFIX Fixed missing comma in LeftAndMain.AddForm 2012-05-22 14:57:30 +12:00
Mateusz Uzdowski
97e00a35dd BUGFIX: add missing onunmatches causing exceptions in entwine 2012-05-18 14:27:09 +12:00
Mateusz Uzdowski
37399f88db BUGFIX: add missing _super calls to all matchers and unmatchers
Otherwise some matchers might not be triggered as expected.
2012-05-18 12:27:30 +12:00
Mateusz Uzdowski
3d0876c8f5 BUGFIX: put all CMS JS code into 'ss' namespace.
Conflicts:

	admin/javascript/LeftAndMain.js
	javascript/GridField.js
2012-05-18 12:27:30 +12:00
Ingo Schommer
d57ede8f44 MINOR Fixed query param concatenation in LeftAndMain.js 2012-05-15 21:28:55 +02:00
Ingo Schommer
d42ea5a9d6 BUGFIX Encoding multibyte characters in custom X-Status HTTP headers used in CMS (headers don't allow multibyte data) 2012-05-14 15:13:49 +02:00
Mateusz Uzdowski
b28a625f0b BUGFIX: clean up Chosen classess, so the cached panel can be rebuilt (os7304)
There is no way to clean up attached Chosen instance in a nice way -
there is no destroy, nor remove on the library.

Also, we can't use the onunmatch on this entwine - it only triggers after the cache snapshot
has been taken. This is because the cache function is on different
namespace.
2012-05-11 16:17:44 +12:00
Ingo Schommer
2753744f9e ENHANCEMENT Moving X-Status message handling in CMS from global ajaxError to ajaxComplete handler, to allow success messages being passed this way as well. 2012-05-10 10:44:21 +02:00
Ingo Schommer
3ee4459476 MERGE tabs url abs 2012-04-18 16:54:57 +02:00
Ingo Schommer
473d3a66b8 MINOR Fixed controller contexts in LeftAndMain->SiteTreeAsUL() - needs different context for edit links and determining "current page" (not applicable for CMSPagesController) 2012-04-17 22:33:30 +02:00
Ingo Schommer
35d4cd3da8 MINOR PJAX support for .cms-panel-link 2012-04-17 22:28:36 +02:00
Ingo Schommer
d6eb1b6fff ENHANCEMENT Added .cms-panel-deferred for lazy loading of CMS panels (for performance reasons) 2012-04-17 17:19:03 +02:00
Ingo Schommer
37777615cf MINOR Ignore aborted ajax requests in CMS notifications 2012-04-17 17:12:15 +02:00
Ingo Schommer
e2df1f4c5f MINOR Removed $('.cms-content').loadForm(), its very similar to loadPanel() - accepts callbacks, but that's not specific to forms. Listen to 'afterstatechange' rather than 'loadform' events 2012-04-12 23:53:14 +02:00
Mateusz Uzdowski
452a507cc9 BUGFIX: remove form auto-detection from the generic JS state handler.
Forms take care of PJAX state on their own in the submit and load functions (os-7126)
2012-04-12 11:31:28 +12:00
Julian Seidenberg
1e0b843353 ENHANCEMENT: refactoring code for making a link an ajax/history link. Removing the selector that targets .crumb and only applying the selector that turns links with cms-panel-link into ajax enabled links. Adding the cms-panel-link to those links that already have the crumb class. 2012-04-10 18:16:27 +12:00