Bug 34711: Remove use of onclick for opac-privacy.pl
This change removes the "onclick" attribute for the buttons
on opac-privacy.pl.
Note: The Javascript is placed in a separate file, which is
the preferred way for Javascript to be handled by
Content-Security-Policy
Test plan:
0. Apply the patch
1. Go to http://localhost:8081/cgi-bin/koha/admin/preferences.pl?op=search&searchfield=OPACPrivacy
2. Set syspref to "Allow"
3. Go to http://localhost:8080/cgi-bin/koha/opac-privacy.pl
4. The confirmation modal appears and "OK" and "Cancel" buttons work as
expected
Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit c997fe863f)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
This commit is contained in:
parent
167f5aa3bb
commit
cdb5734ade
|
|
@ -175,7 +175,7 @@
|
|||
<td colspan=7>Immediately delete my checkout history. This action cannot be undone.</td>
|
||||
<td colspan=1>
|
||||
<fieldset class="action">
|
||||
<input type="submit" value="Delete checkout history" form="opac-privacy-delete-checkouts" class="btn btn-danger btn-block" onclick="return confirmDelete(MSG_CONFIRM_AGAIN);" />
|
||||
<input type="submit" value="Delete checkout history" form="opac-privacy-delete-checkouts" class="btn btn-danger btn-block privacy-confirm-delete" />
|
||||
</fieldset>
|
||||
</td>
|
||||
</tr>
|
||||
|
|
@ -183,7 +183,7 @@
|
|||
<td colspan=7>Immediately delete my hold history. This action cannot be undone.</td>
|
||||
<td colspan=1>
|
||||
<fieldset class="action">
|
||||
<input type="submit" value="Delete hold history" form="opac-privacy-delete-holds" class="btn btn-danger btn-block" onclick="return confirmDelete(MSG_CONFIRM_AGAIN);" />
|
||||
<input type="submit" value="Delete hold history" form="opac-privacy-delete-holds" class="btn btn-danger btn-block privacy-confirm-delete" />
|
||||
</fieldset>
|
||||
</td>
|
||||
</tr>
|
||||
|
|
@ -191,7 +191,7 @@
|
|||
<td colspan=7>Immediately delete my checkout history & my hold history. This action cannot be undone.</td>
|
||||
<td colspan=1>
|
||||
<fieldset class="action">
|
||||
<input type="submit" value="Delete checkout and hold history" form="opac-privacy-delete-all" class="btn btn-danger btn-block" onclick="return confirmDelete(MSG_CONFIRM_AGAIN);" />
|
||||
<input type="submit" value="Delete checkout and hold history" form="opac-privacy-delete-all" class="btn btn-danger btn-block privacy-confirm-delete" />
|
||||
</fieldset>
|
||||
</td>
|
||||
</tr>
|
||||
|
|
@ -208,4 +208,6 @@
|
|||
</div> <!-- / .main -->
|
||||
|
||||
[% INCLUDE 'opac-bottom.inc' %]
|
||||
[% BLOCK jsinclude %][% END %]
|
||||
[% BLOCK jsinclude %]
|
||||
[% Asset.js('js/privacy.js') | $raw %]
|
||||
[% END %]
|
||||
|
|
|
|||
|
|
@ -0,0 +1,5 @@
|
|||
$(document).ready(function(){
|
||||
$('.privacy-confirm-delete').on('click',function(){
|
||||
return confirmDelete(MSG_CONFIRM_AGAIN);
|
||||
});
|
||||
});
|
||||
Loading…
Reference in New Issue