Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
D
dokuwiki
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
BRIC
dokuwiki
Commits
fbd8067e
Commit
fbd8067e
authored
11 years ago
by
Andreas Gohr
Browse files
Options
Downloads
Patches
Plain Diff
updated jquery.cookie.js to 1.3.1 FS#2804
parent
89e71fa9
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
lib/scripts/jquery/jquery.cookie.js
+41
-18
41 additions, 18 deletions
lib/scripts/jquery/jquery.cookie.js
with
41 additions
and
18 deletions
lib/scripts/jquery/jquery.cookie.js
+
41
−
18
View file @
fbd8067e
/*!
* jQuery Cookie Plugin v1.3
* jQuery Cookie Plugin v1.3
.1
* https://github.com/carhartl/jquery-cookie
*
* Copyright 2011, Klaus Hartl
* Dual licensed under the MIT or GPL Version 2 licenses.
* http://www.opensource.org/licenses/mit-license.php
* http://www.opensource.org/licenses/GPL-2.0
* Copyright 2013 Klaus Hartl
* Released under the MIT license
*/
(
function
(
$
,
document
,
undefined
)
{
(
function
(
factory
)
{
if
(
typeof
define
===
'
function
'
&&
define
.
amd
)
{
// AMD. Register as anonymous module.
define
([
'
jquery
'
],
factory
);
}
else
{
// Browser globals.
factory
(
jQuery
);
}
}(
function
(
$
)
{
var
pluses
=
/
\+
/g
;
...
...
@@ -19,16 +25,22 @@
return
decodeURIComponent
(
s
.
replace
(
pluses
,
'
'
));
}
function
converted
(
s
)
{
if
(
s
.
indexOf
(
'
"
'
)
===
0
)
{
// This is a quoted cookie as according to RFC2068, unescape
s
=
s
.
slice
(
1
,
-
1
).
replace
(
/
\\
"/g
,
'
"
'
).
replace
(
/
\\\\
/g
,
'
\\
'
);
}
try
{
return
config
.
json
?
JSON
.
parse
(
s
)
:
s
;
}
catch
(
er
)
{}
}
var
config
=
$
.
cookie
=
function
(
key
,
value
,
options
)
{
// write
if
(
value
!==
undefined
)
{
options
=
$
.
extend
({},
config
.
defaults
,
options
);
if
(
value
===
null
)
{
options
.
expires
=
-
1
;
}
if
(
typeof
options
.
expires
===
'
number
'
)
{
var
days
=
options
.
expires
,
t
=
options
.
expires
=
new
Date
();
t
.
setDate
(
t
.
getDate
()
+
days
);
...
...
@@ -37,7 +49,9 @@
value
=
config
.
json
?
JSON
.
stringify
(
value
)
:
String
(
value
);
return
(
document
.
cookie
=
[
encodeURIComponent
(
key
),
'
=
'
,
config
.
raw
?
value
:
encodeURIComponent
(
value
),
config
.
raw
?
key
:
encodeURIComponent
(
key
),
'
=
'
,
config
.
raw
?
value
:
encodeURIComponent
(
value
),
options
.
expires
?
'
; expires=
'
+
options
.
expires
.
toUTCString
()
:
''
,
// use expires attribute, max-age is not supported by IE
options
.
path
?
'
; path=
'
+
options
.
path
:
''
,
options
.
domain
?
'
; domain=
'
+
options
.
domain
:
''
,
...
...
@@ -48,25 +62,34 @@
// read
var
decode
=
config
.
raw
?
raw
:
decoded
;
var
cookies
=
document
.
cookie
.
split
(
'
;
'
);
var
result
=
key
?
undefined
:
{};
for
(
var
i
=
0
,
l
=
cookies
.
length
;
i
<
l
;
i
++
)
{
var
parts
=
cookies
[
i
].
split
(
'
=
'
);
if
(
decode
(
parts
.
shift
())
===
key
)
{
var
cookie
=
decode
(
parts
.
join
(
'
=
'
));
return
config
.
json
?
JSON
.
parse
(
cookie
)
:
cookie
;
var
name
=
decode
(
parts
.
shift
());
var
cookie
=
decode
(
parts
.
join
(
'
=
'
));
if
(
key
&&
key
===
name
)
{
result
=
converted
(
cookie
);
break
;
}
if
(
!
key
)
{
result
[
name
]
=
converted
(
cookie
);
}
}
return
n
ul
l
;
return
res
ul
t
;
};
config
.
defaults
=
{};
$
.
removeCookie
=
function
(
key
,
options
)
{
if
(
$
.
cookie
(
key
)
!==
null
)
{
$
.
cookie
(
key
,
null
,
options
);
if
(
$
.
cookie
(
key
)
!==
undefined
)
{
// Must not alter options, thus extending a fresh object...
$
.
cookie
(
key
,
''
,
$
.
extend
({},
options
,
{
expires
:
-
1
}));
return
true
;
}
return
false
;
};
})
(
jQuery
,
document
);
}));
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