Skip to content
GitLab
Menu
Projects
Groups
Snippets
/
Help
What's new
7
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Switch to GitLab Next
Sign in / Register
Toggle navigation
Menu
Open sidebar
SondagesPro
coreAndTools
reloadAnyResponse
Commits
2229fe99
Commit
2229fe99
authored
Aug 02, 2022
by
Chenu Denis
Browse files
[fix] Allow usage of event for unload
parent
cffe4b54
Changes
2
Hide whitespace changes
Inline
Side-by-side
config.xml
View file @
2229fe99
...
...
@@ -8,7 +8,7 @@
<author>
Denis Chenu
</author>
<authorUrl>
https://extensions.sondages.pro/reloadanyresponse
</authorUrl>
<supportUrl>
https://support.sondages.pro/
</supportUrl>
<version>
5.5.
0
</version>
<version>
5.5.
1
</version>
<license>
GNU Affero General Public License v3.0
</license>
<description>
<![CDATA[Allow to reload any response for admin user and respondant.]]>
</description>
</metadata>
...
...
reloadAnyResponse.php
View file @
2229fe99
...
...
@@ -6,7 +6,7 @@
* @author Denis Chenu <denis@sondages.pro>
* @copyright 2018-2022 Denis Chenu <http://www.sondages.pro>
* @license AGPL v3
* @version 5.5.
0
* @version 5.5.
1
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
...
...
@@ -998,9 +998,9 @@ class reloadAnyResponse extends PluginBase
'plugins/direct'
,
array
(
'plugin'
=>
get_class
(
$this
),
'function'
=>
'close'
,
'sid'
=>
$this
->
surveyId
,
'srid'
=>
$srid
)
);
$onBeforeUnload
=
"window.on
before
unload
=
function(
e
) {\n"
;
$onBeforeUnload
=
"
$(
window
)
.on
('
unload
',
function() {
\n
"
;
$onBeforeUnload
.
=
" jQuery.ajax({ async: false, url:'
{
$ajaxUrl
}
' });
\n
"
;
$onBeforeUnload
.
=
"}
\n
"
;
$onBeforeUnload
.
=
"}
)
\n
"
;
Yii
::
app
()
->
getClientScript
()
->
registerScript
(
"reloadAnyResponseBeforeUnload"
,
$onBeforeUnload
,
CClientScript
::
POS_HEAD
);
}
}
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment