moodle/admin/tool/policy/readme_moodle.txt
Sara Arjona 3f9b276b97 MDL-61866 tool_policy: Add readme_moodle.txt file and reorganise styles.css
- Review changes made in jquery-eu-cookie-law-popup.js, for minimising them
(add eslint-disable to disable checking)
- Reorganise styles.css to separate CSS code from jquery-eu-cookie-law-popup
to policy one.
- Create readme_moodle.txt file, with instructions for updating the
jquery-eu-cookie-law-popup lib.

Part of MDL-61864
2018-04-16 11:30:14 +08:00

56 lines
1.7 KiB
Text

jQuery EU Cookie Law popups 1.0.1
-------------
https://github.com/wimagguc/jquery-eu-cookie-law-popup
Instructions to import 'jQuery EU Cookie Law popups' into Moodle:
1. Download the latest release from https://github.com/wimagguc/jquery-eu-cookie-law-popup
2. Copy 'js/jquery-eu-cookie-law-popup.js' into 'amd/src/jquery-eu-cookie-law-popup.js':
2.a. Replace jquery reference
------------------
(function($) {
------------------
to
------------------
define(
['jquery'],
function($) {
------------------
2.b. Remove initialisation code. It will be added and configured only in the pages where is needed
------------------
$(document).ready( function() {
if ($(".eupopup").length > 0) {
$(document).euCookieLawPopup().init({
'info' : 'YOU_CAN_ADD_MORE_SETTINGS_HERE',
'popupTitle' : 'This website is using cookies. ',
'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.'
});
}
------------------
2.c. Remove code
------------------
$(document).bind("user_cookie_consent_changed", function(event, object) {
console.log("User cookie consent changed: " + $(object).attr('consent') );
});
}(jQuery));
------------------
3. Copy the following styles from 'css/jquery-eu-cookie-law-popup.css' into the
"jquery-eu-cookie-law-popup styles" section in 'styles.css':
.eupopup-container
.eupopup-container-bottom
.eupopup-closebutton
.eupopup-buttons
.eupopup-button
.eupopup-button:hover
.eupopup-button:focus
Add "tool_policy styles" to the end of the styles file.
4. Execute grunt to compile js
grunt js