Force page to reload even when the location contains anchors, while using "web2py-redirect-location".
Otherwise, when the location is the same and the url has an anchor it won't redirect.
Like the “w2p:componentComplete” event I added a while back, this is
another event that I use in my website, and I thought it would be
helpful to share it with others. This way, you can easily catch when a
web2py component starts loading, and write a handler for whatever
reason (in my case, determining when the user is navigating to a new
page through a smooth loading function piggybacking off of the web2py
component system)
iOS devices don’t like listening to clicks on most objects. They
typically prefer a and button objects. This fix replaces the
#closeflash span with a link to “#” instead (while also inheriting
text-decoration and color styling), so that mobile (iOS) devices will
allow you to close the flash.
Sometimes we may want to know when the component is finished with it’s
loading process entirely to trigger animations or something similar. I
added this for my own website, and I think that others may want to use
this. It’s a small addition, but I hope that it will be helpful to
others!
now elements with data-w2p_disable are not disabled.
in addition, for non-ajax forms, disabled submit buttons are reenabled
after 5 seconds
plus reindented, refactored AND jslinted
this is because jquery can't know what button was pressed when the
submit event is triggered. We circumvent it adding an hidden field before
triggering the submission
BTW: don't know why the commit seems huge. I just changed a bit the trap_form
function to handle the corner case and streamlined what disableElement,
enableElement, disableFormElements, enableFormElements do,
along with formInputClickSelector
This comes from an unfortunate choice of naming conventions and the fact that
manage errors gets called even on the full document on page load.
I had a table full of .error-"classed" elements and it took nearly 30 seconds for that
snippet to hide and fade them in. We should definitevely prefix every css class with
something that won't clash with everything else.