1 |
efrain |
1 |
jQuery EU Cookie Law popups 1.1.3
|
|
|
2 |
-------------
|
|
|
3 |
https://github.com/wimagguc/jquery-eu-cookie-law-popup
|
|
|
4 |
|
|
|
5 |
Instructions to import 'jQuery EU Cookie Law popups' into Moodle:
|
|
|
6 |
|
|
|
7 |
1. Download the latest release from https://github.com/wimagguc/jquery-eu-cookie-law-popup/releases
|
|
|
8 |
2. Copy 'js/jquery-eu-cookie-law-popup.js' into 'amd/src/jquery-eu-cookie-law-popup.js':
|
|
|
9 |
|
|
|
10 |
2.a. Replace jquery reference
|
|
|
11 |
------------------
|
|
|
12 |
(function($) {
|
|
|
13 |
------------------
|
|
|
14 |
with
|
|
|
15 |
------------------
|
|
|
16 |
define(['jquery'],function($) {
|
|
|
17 |
------------------
|
|
|
18 |
|
|
|
19 |
2.b. Remove initialisation code. It will be added and configured only in the pages where is needed
|
|
|
20 |
------------------
|
|
|
21 |
$(document).ready( function() {
|
|
|
22 |
if ($(".eupopup").length > 0) {
|
|
|
23 |
$(document).euCookieLawPopup().init({
|
|
|
24 |
'info' : 'YOU_CAN_ADD_MORE_SETTINGS_HERE',
|
|
|
25 |
'popupTitle' : 'This website is using cookies. ',
|
|
|
26 |
'popupText' : 'We use them to give you the best experience. If you continue using our website, we\'ll assume that you are happy to receive all cookies on this website.'
|
|
|
27 |
});
|
|
|
28 |
}
|
|
|
29 |
});
|
|
|
30 |
------------------
|
|
|
31 |
|
|
|
32 |
2.c. Remove code
|
|
|
33 |
------------------
|
|
|
34 |
$(document).bind("user_cookie_consent_changed", function(event, object) {
|
|
|
35 |
console.log("User cookie consent changed: " + $(object).attr('consent') );
|
|
|
36 |
});
|
|
|
37 |
------------------
|
|
|
38 |
|
|
|
39 |
2.d. Replace
|
|
|
40 |
------------------
|
|
|
41 |
}(jQuery));
|
|
|
42 |
------------------
|
|
|
43 |
with
|
|
|
44 |
------------------
|
|
|
45 |
});
|
|
|
46 |
------------------
|
|
|
47 |
|
|
|
48 |
3. Copy the following styles from 'css/jquery-eu-cookie-law-popup.css' into the
|
|
|
49 |
"jquery-eu-cookie-law-popup styles" section in 'styles.css':
|
|
|
50 |
.eupopup-container
|
|
|
51 |
.eupopup-container-bottom
|
|
|
52 |
.eupopup-closebutton
|
|
|
53 |
.eupopup-buttons
|
|
|
54 |
.eupopup-button
|
|
|
55 |
.eupopup-button:hover
|
|
|
56 |
.eupopup-button:focus
|
|
|
57 |
|
|
|
58 |
Add "tool_policy styles" to the end of the styles file.
|
|
|
59 |
|
|
|
60 |
4. Execute grunt to compile js
|
|
|
61 |
grunt amd
|
|
|
62 |
|
|
|
63 |
5. Update version number in admin/tool/policy/thirdpartylibs.xml
|