Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
T
toolkit
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Service Desk
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Incidents
Environments
Packages & Registries
Packages & Registries
Container Registry
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Open source
toolkit
Commits
23c18fa2
Commit
23c18fa2
authored
Jun 19, 2020
by
rg
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Teste la présence d'un key tag
parent
1a2437e4
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
14 additions
and
4 deletions
+14
-4
javascript/jquery/rgpwhat/jquery.plugin.rgpwhat.js
javascript/jquery/rgpwhat/jquery.plugin.rgpwhat.js
+14
-4
No files found.
javascript/jquery/rgpwhat/jquery.plugin.rgpwhat.js
View file @
23c18fa2
...
...
@@ -330,11 +330,21 @@
/* Initialise les valeurs de chaque objet json représentant un cookie en spécifiant par "value" si le bouton est sur autorisé ou interdire */
var
initConsentOptions
=
function
(
consentCookie
,
consentOptions
)
{
var
showMe
=
false
;
var
jsonCookie
=
[];
if
(
typeof
consentCookie
!==
'
undefined
'
)
{
jsonCookie
=
JSON
.
parse
(
consentCookie
);
}
// Teste s'il faut dire d'afficher le bandeau: ex au moins un tags non renseigné
var
tagList
=
[];
jsonCookie
.
forEach
(
function
(
e
)
{
if
(
typeof
e
.
key
===
'
string
'
)
tagList
.
push
(
e
.
key
);
});
showMe
=
consentOptions
.
some
(
function
(
e
)
{
return
tagList
.
indexOf
(
e
.
key
)
==-
1
;
});
if
(
typeof
consentOptions
!==
"
undefined
"
)
{
var
jsonOptions
=
consentOptions
;
//JSON.parse(JSON.stringify(consentOptions));
...
...
@@ -343,7 +353,7 @@
econsent
.
value
=
(
typeof
econsent
.
default
===
"
undefined
"
||
econsent
.
default
==
"
accept
"
)?
true
:
false
;
});
if
(
typeof
jsonCookie
!==
"
object
"
)
jsonCookie
=
[];
//
if(typeof jsonCookie!=="object") jsonCookie=[];
jsonCookie
.
forEach
(
function
(
ecookie
)
{
jsonOptions
.
forEach
(
function
(
eoptions
)
{
if
(
eoptions
.
key
==
ecookie
.
key
)
{
...
...
@@ -351,8 +361,8 @@
}
});
});
return
jsonOptions
;
}
return
showMe
;
}
var
show
=
function
()
{
...
...
@@ -366,9 +376,9 @@
/* Main */
var
consentCookie
=
getCookie
(
cookieName
);
initConsentOptions
(
consentCookie
,
consentOptions
);
var
showMe
=
initConsentOptions
(
consentCookie
,
consentOptions
);
if
(
typeof
consentCookie
===
"
undefined
"
||
forceDisplay
)
{
if
(
showMe
||
forceDisplay
)
{
runCallbacks
(
consentOptions
);
if
(
delay
)
setTimeout
(
function
()
{
show
();},
delay
);
else
show
();
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a 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