Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
G
gdpr_compliance
Manage
Activity
Members
Labels
Plan
Wiki
Custom issue tracker
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Model registry
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
project
gdpr_compliance
Commits
620fa1e9
Commit
620fa1e9
authored
1 year ago
by
Stève ORIOL
Committed by
Anatoly Politsin
1 year ago
Browse files
Options
Downloads
Patches
Plain Diff
Issue
#3356097
by steveoriol: Drupal 10 version
parent
69b7eb1c
No related branches found
Branches containing commit
Tags
8.x-1.21
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
assets/js/popup.js
+41
-35
41 additions, 35 deletions
assets/js/popup.js
gdpr_compliance.libraries.yml
+1
-1
1 addition, 1 deletion
gdpr_compliance.libraries.yml
with
42 additions
and
36 deletions
assets/js/popup.js
+
41
−
35
View file @
620fa1e9
...
...
@@ -3,39 +3,45 @@
* Gdpr cookie agreement js.
*/
(
function
(
$
)
{
$
(
document
).
ready
(
function
()
{
var
$gdprAgree
=
$
.
cookie
(
'
gdpr_compliance
'
);
var
$gdprPopup
=
$
(
'
#gdpr-popup
'
);
(
function
(
$
,
Drupal
,
cookies
)
{
Drupal
.
behaviors
.
gdpr_compliance
=
{
attach
:
function
(
context
,
settings
)
{
$
(
document
).
ready
(
function
()
{
var
$gdprAgree
=
cookies
.
get
(
"
gdpr_compliance
"
);
var
$gdprPopup
=
$
(
"
#gdpr-popup
"
);
if
(
$gdprAgree
!==
'
agreed
'
)
{
$gdprPopup
.
show
();
}
$
(
'
#gdpr-agree
'
).
click
(
function
()
{
$gdprPopup
.
fadeOut
();
$
.
cookie
(
'
gdpr_compliance
'
,
'
agreed
'
,
{
path
:
'
/
'
,
expires
:
30
});
});
$
(
'
#gdpr-find-more
'
).
click
(
function
()
{
$
.
cookie
(
'
gdpr_compliance
'
,
'
morelink
'
,
{
path
:
'
/
'
,
expires
:
30
});
// Go to rules page.
var
$path
=
$
(
this
).
data
(
'
morelink
'
);
if
(
$path
.
substring
(
0
,
4
)
===
'
http
'
)
{
window
.
open
(
$path
);
}
if
(
$path
.
substring
(
0
,
1
)
===
'
/
'
)
{
window
.
open
(
window
.
location
.
origin
+
$path
);
}
});
$
(
'
#gdpr-clear-cookie
'
).
click
(
function
()
{
for
(
var
c
in
$
.
cookie
())
{
$
.
removeCookie
(
c
,
{
path
:
'
/
'
});
}
if
(
$
(
this
).
data
(
'
done
'
))
{
alert
(
$
(
this
).
data
(
'
done
'
));
}
else
{
alert
(
'
ok
'
);
}
});
});
})(
this
.
jQuery
);
if
(
$gdprAgree
!==
"
agreed
"
)
{
$gdprPopup
.
show
();
}
$
(
"
#gdpr-agree
"
).
click
(
function
()
{
$gdprPopup
.
fadeOut
();
cookies
.
set
(
"
gdpr_compliance
"
,
"
agreed
"
,
{
path
:
"
/
"
,
expires
:
30
});
});
$
(
"
#gdpr-find-more
"
).
click
(
function
()
{
cookies
.
set
(
"
gdpr_compliance
"
,
"
morelink
"
,
{
path
:
"
/
"
,
expires
:
30
,
});
// Go to rules page.
var
$path
=
$
(
this
).
data
(
"
morelink
"
);
if
(
$path
.
substring
(
0
,
4
)
===
"
http
"
)
{
window
.
open
(
$path
);
}
if
(
$path
.
substring
(
0
,
1
)
===
"
/
"
)
{
window
.
open
(
window
.
location
.
origin
+
$path
);
}
});
$
(
"
#gdpr-clear-cookie
"
).
click
(
function
()
{
for
(
var
c
in
$
.
cookie
())
{
$
.
removeCookie
(
c
,
{
path
:
"
/
"
});
}
if
(
$
(
this
).
data
(
"
done
"
))
{
alert
(
$
(
this
).
data
(
"
done
"
));
}
else
{
alert
(
"
ok
"
);
}
});
});
},
};
})(
jQuery
,
Drupal
,
window
.
Cookies
);
This diff is collapsed.
Click to expand it.
gdpr_compliance.libraries.yml
+
1
−
1
View file @
620fa1e9
...
...
@@ -6,4 +6,4 @@ popup:
assets/css/gdpr-popup.css
:
{}
dependencies
:
-
core/jquery
-
core/j
query.
cookie
-
core/j
s-
cookie
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
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!
Save comment
Cancel
Please
register
or
sign in
to comment