parent
08b804998a
commit
c105e0c627
@ -57,7 +57,7 @@ dummyLogin = AuthPlugin{..}
|
||||
{ formMethod = POST
|
||||
, formAction = Just . SomeRoute . toMaster $ PluginR "dummy" []
|
||||
, formEncoding = loginEnctype
|
||||
, formAttrs = []
|
||||
, formAttrs = [("uw-no-navigate-away-prompt","")]
|
||||
, formSubmit = FormSubmit
|
||||
, formAnchor = Just "login--dummy" :: Maybe Text
|
||||
}
|
||||
|
||||
@ -117,7 +117,7 @@ campusLogin conf@LdapConf{..} pool = AuthPlugin{..}
|
||||
{ formMethod = POST
|
||||
, formAction = Just . SomeRoute . toMaster $ PluginR "LDAP" []
|
||||
, formEncoding = loginEnctype
|
||||
, formAttrs = []
|
||||
, formAttrs = [("uw-no-navigate-away-prompt","")]
|
||||
, formSubmit = FormSubmit
|
||||
, formAnchor = Just "login--campus" :: Maybe Text
|
||||
}
|
||||
|
||||
@ -93,7 +93,7 @@ hashLogin pwHashAlgo = AuthPlugin{..}
|
||||
{ formMethod = POST
|
||||
, formAction = Just . SomeRoute . toMaster $ PluginR "PWHash" []
|
||||
, formEncoding = loginEnctype
|
||||
, formAttrs = []
|
||||
, formAttrs = [("uw-no-navigate-away-prompt","")]
|
||||
, formSubmit = FormSubmit
|
||||
, formAnchor = Just "login--hash" :: Maybe Text
|
||||
}
|
||||
|
||||
@ -257,6 +257,7 @@
|
||||
*
|
||||
* Attribute: [none]
|
||||
* (automatically setup on all form tags that dont automatically submit, see AutoSubmitButtonUtil)
|
||||
* Does not setup on forms that have uw-no-navigate-away-prompt
|
||||
*
|
||||
* Example usage:
|
||||
* (any page with a form)
|
||||
@ -264,6 +265,7 @@
|
||||
|
||||
var NAVIGATE_AWAY_PROMPT_UTIL_NAME = 'navigateAwayPrompt';
|
||||
var NAVIGATE_AWAY_PROMPT_UTIL_SELECTOR = 'form';
|
||||
var NAVIGATE_AWAY_PROMPT_UTIL_OPTOUT = '[uw-no-navigate-away-prompt]';
|
||||
|
||||
var NAVIGATE_AWAY_PROMPT_INITIALIZED_CLASS = 'navigate-away-prompt--initialized';
|
||||
|
||||
@ -285,6 +287,10 @@
|
||||
return false;
|
||||
}
|
||||
|
||||
if (element.matches(NAVIGATE_AWAY_PROMPT_UTIL_OPTOUT)) {
|
||||
return false;
|
||||
}
|
||||
|
||||
window.addEventListener('beforeunload', beforeUnloadHandler);
|
||||
|
||||
element.addEventListener('submit', function() {
|
||||
|
||||
Loading…
Reference in New Issue
Block a user