Jump to content


Photo

FormSaveReminder 1.0.1

Module

  • Please log in to reply
7 replies to this topic

#1 Soma

Soma

    Hero Member

  • Moderators
  • 3,218 posts
  • 1769

  • LocationSH, Switzerland

Posted 19 September 2011 - 03:09 PM

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)

You can grab it at github: https://github.com/s...ormSaveReminder

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

@somartist | modules created | support me, flattr my work flattr.com


#2 ryan

ryan

    Hero Member

  • Administrators
  • 5,812 posts
  • 3144

  • LocationAtlanta, GA

Posted 19 September 2011 - 03:28 PM

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.

#3 Soma

Soma

    Hero Member

  • Moderators
  • 3,218 posts
  • 1769

  • LocationSH, Switzerland

Posted 20 September 2011 - 02:21 AM

Just checked in on github, edited first post. Thanks.
https://github.com/s...ormSaveReminder

@somartist | modules created | support me, flattr my work flattr.com


#4 martinluff

martinluff

    Full Member

  • Members
  • PipPipPip
  • 79 posts
  • 2

  • LocationChristchurch NZ

Posted 20 September 2011 - 11:49 PM

Nice work Philip, fills a useful gap IMO.

Ryan, wonder if this one should make its way into the core at some point?

#5 Soma

Soma

    Hero Member

  • Moderators
  • 3,218 posts
  • 1769

  • LocationSH, Switzerland

Posted 04 November 2011 - 03:34 AM

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...


@somartist | modules created | support me, flattr my work flattr.com


#6 ryan

ryan

    Hero Member

  • Administrators
  • 5,812 posts
  • 3144

  • LocationAtlanta, GA

Posted 04 November 2011 - 02:07 PM

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. 

#7 Soma

Soma

    Hero Member

  • Moderators
  • 3,218 posts
  • 1769

  • LocationSH, Switzerland

Posted 07 November 2011 - 10:39 AM

Thanks Ryan for the Tip. It's an After Hook. :)

I will later test this again with your suggestions.

@somartist | modules created | support me, flattr my work flattr.com


#8 Soma

Soma

    Hero Member

  • Moderators
  • 3,218 posts
  • 1769

  • LocationSH, Switzerland

Posted 04 June 2012 - 01:07 PM

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.

@somartist | modules created | support me, flattr my work flattr.com






Also tagged with one or more of these keywords: Module

0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users