Jump to content

FormSaveReminder


Soma
 Share

Recommended Posts

This module checks for changes on forms in the PW admin and throws a confirm dialog before leaving page without saving.
Thanks to Ryan for the new module name suggestion. Much better choice I think.

The module can be configured to switched on or off the check for each of these areas:

- Page Edit
- Field Edit
- Template Edit
- Access Pages
- Modules Settings

(may this not was neccessary, but just for the fun of trying to do a configurable module, well I just did it)

 

### update 1.0.3
- fixed issue with delete button throwing the alert
 
### update 1.0.2
- fixed issue with script adding (again)
- updated some texts and documentation
 

#update 1.0.1
- fixed issue with script adding
- fixed subdir installation path
- added script versioning

Download: http://modules.processwire.com/modules/form-save-reminder/

Github: https://github.com/somatonic/FormSaveReminder

  • Like 1
Link to comment
Share on other sites

Thanks for the update Soma! I look forward to installing this, and will be sure to update the module directory later today or tomorrow. Were you able to find a solution for the TinyMCE issue? NM, saw that you already answered this in the other thread.

Link to comment
Share on other sites

  • 1 month later...

I fixed some issue with the module not working on TinyMCE fields when editiing a page on deeper than 3th level. For some reason the FormSaveReminder.js which does the checks, was then getting applied after all the tinyMCE scripts and thus not working. (on higher levels it was appended before them) It took me many hours to realize this was the problem :)

What's up with this Ryan?

I did now change it to get inserted through str_replace just after JqueryCore script. I'm not sure how future proof this will be, but I guess the JqueryCore will never change.

Latest version is now on github. Thanks

EDIT: Just found that in Firefox it doesn't work with TinyMCE Fields at all... Firefox is almost like IE now, crap...

  • Like 1
Link to comment
Share on other sites

What's up with this Ryan?

Not sure how you had it before, but I think that the script would have to be added before ProcessPageEdit::execute rather than after. I'm not sure I understand about the level of the page–and can't think of any reason it would matter. But if you find it's doing this in a before(execute) hook, let me know and I'm sure we can track it down. 

Link to comment
Share on other sites

  • 6 months later...

Made a little update to this module. I strongly encourage to update with the latest version.

- unfortunately it stoped working in the latest PW since script/css version (..script.js?v=100) in the admin were introduced (1,5 months?). Since I have to manually str_replace the script tag into the header right after jquery core js, it failed because the string is now different :/. Changed it to use replace on another location/part of the code which will hopefully stay there. :)

- added the admin root path to the script url, so it now also works on PW installed in a subdir.

- added script versioning appended to file name ..?v=101.

  • Like 2
Link to comment
Share on other sites

  • 1 year later...
  • 3 months later...
  • 9 months later...

Just committed an update to the FormSaveReminder as it's an essential tool in your bag ;)

Changelog 1.0.4
 
- refactored code a bunch to simplify things
- added support for CKeditor, regular and inline mode
- made alert message translatable
 
If you find any issues, please post in this thread or better open an issue on github .
 
Next:
 
- Look into PageTable, and why it's not triggering on changes.
- if you find anything or want to help improve the module just shout
 
 
For module developers
To make sure your custom Inputfield works with FormSaveReminder, you'd have to make sure the input is triggering a change event. Sometimes this isn't the case if you simply change a value through js. You can after chaning a value use the $(element).trigger("change") to make sure FormSaveReminder will be able to detect a change.
 
Thanks
  • Like 2
Link to comment
Share on other sites

  • 2 weeks later...
  • 5 months later...
  • 9 months later...

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
×
  • Create New...