User tests: Successful: Unsuccessful:
When editing an article, menu, category (anything singular), and press the back button, the refresh or the close button on the browser, user most probably will loose any data without warning. This PR throws a standard browser window with custom message to inform him/her. Of course we are not forcing anything, so he/she can go ahead and close the window, but at least we did informed them!
There is a check for debug and language debug, so this functionality is enabled only when none of these is enabled!
Firefox (NOTE: FF doesn’t support custom messages in the alert called onbeforeunload!)
And IE 8 (YES it even works on IE
Labels |
Added:
?
|
I really appreciate the detailed work that has gone into this and for testing on multiple browsers. However personally I dont like this. IF it was only happening when some data was changed I might think differently but for it to happen all the time is just a pain
@Fedir @brianteeman Let’s say you try to edit an article. You click on the title in the list view and once you have the form you realize that this is NOT the one you want and you click the back button. Without throwing an alert (actually joomla is politely asking you to use save or cancel button) you will end up with a lock icon in the article, which means that you have to checkin that article (if you are allowed to do so!).
I hope this explains that this is not only for end users but also a way to keep Joomla admins out of the check in button!
You still get the lock icon with this popup if you click leave this page
@brianteeman Sadly thats true
@Fedik @brianteeman Implemented the check for changes! So the alert will NOT trigger if no changes made!
Just retested on a clean site and it didnt matter what I did I never got the popup
test
works good for me, now
but question about whether we need it,
maybe need some vote?
I still cant get it to work (but even if I did I would not be in favour of
this)
On 19 January 2015 at 13:38, Fedir Zinchuk notifications@github.com wrote:
test
works good for me, nowbut question about whether we need it,
maybe need some vote? [image: ]—
Reply to this email directly or view it on GitHub
#5815 (comment).
Brian Teeman
Co-founder Joomla! and OpenSourceMatters Inc.
http://brian.teeman.net/
Category | ⇒ | JavaScript UI/UX |
Easy | No | ⇒ | Yes |
@brianteeman Due to the way .change is defined in jQuery, this might not work in cases where the edited element hasn’t lost its focus (you have to click somewhere else in the page)
The change event is sent to an element when its value changes. This event is limited to elements, boxes and elements. For select boxes, checkboxes, and radio buttons, the event is fired immediately when the user makes a selection with the mouse, but for the other element types the event is deferred until the element loses focus.
From jQuery API
@dgt41 another suggestion use jQuery('form :input').on('changed input', function() {
instead of .changed()
this will mark changes on input modification, not only when input lost focus
other thing I would use local variable instead of bother with form element, but like now also can be....
and for which reason you disable this feature if debug enabled ?
@brianteeman maybe you have debug enabled
Status | Pending | ⇒ | Needs Review |
I am setting this to needs review so that the CMS maintainers and PLT can decide if this concept is worth pursuing
Personally I like the concept (this isn't a formal PLT opinion ). However I'd make it much simpler. Just check if someone has altered the text in the textarea. I don't think changing other elements of the form is as annoying/time consuming to replace as the article itself.
I think that's a wonderful idea....however it does not work if you change text in the editor, category select (Chosen), or Publishing Dates (Calendars).
@anibalsanchez reading others people approach in the net, most of them serialize the form data on the page load and then compare the changes (if any). Also this will prevent another erratic behavior e.g. add a word and the delete it, right now this will count as changed form, although it isn’t. Maybe the best approach is to utilize some jquery plugin for this
#dgt41 From my humble experience, I have created this https://github.com/anibalsanchez/jquery.saveform.js/blob/master/jquery.xtsaveform.js, based on jquery.saveform.js. It can be tweaked to include hidden fields (.xtd-save-this class).
I am going to close this one, as there is little interest on improving UX.
Status | Needs Review | ⇒ | Closed |
Closed_Date | 0000-00-00 00:00:00 | ⇒ | 2015-02-06 12:00:25 |
As stated above, if it is activated with altered text I'm in favor of this.
you approach a bit confuse,
the function will display alert even nothing edited, can be annoying.
what about something like:
or around