govuk_admin_template 2.5.1 → 2.6.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 2f488325511d4be67781f3c9c29f0a807d1c6c2a
|
4
|
+
data.tar.gz: cbbd2e17b10112888182b1eab06a3157526cb4dd
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: a33d76c990e7202c27dfac3bf1c4ffcd8bc3ced4983da7af956b41048c5876c37eff16d176687714968fca1e853ea0d6b2f9647030cece905ba131663ea7450b
|
7
|
+
data.tar.gz: 87c85a793fcc0bc1e32fb117c29bda17d1103d71bf3f6fb74778eebc63f355f132d2ad5f1956a0687d732fdcd78f67edb080328887d24bb25e31edf97b1360ff
|
data/CHANGELOG.md
CHANGED
@@ -111,12 +111,69 @@
|
|
111
111
|
}
|
112
112
|
}
|
113
113
|
|
114
|
-
// Useful for debugging:
|
115
|
-
// console.log(eventAnalytics);
|
116
|
-
|
117
114
|
if (typeof root.ga === "function") {
|
118
115
|
root.ga('send', eventAnalytics);
|
119
116
|
}
|
120
117
|
}
|
121
118
|
|
119
|
+
/*
|
120
|
+
Cookie methods
|
121
|
+
==============
|
122
|
+
Usage:
|
123
|
+
|
124
|
+
Setting a cookie:
|
125
|
+
GOVUKAdmin.cookie('hobnob', 'tasty', { days: 30 });
|
126
|
+
|
127
|
+
Reading a cookie:
|
128
|
+
GOVUKAdmin.cookie('hobnob');
|
129
|
+
|
130
|
+
Deleting a cookie:
|
131
|
+
GOVUKAdmin.cookie('hobnob', null);
|
132
|
+
*/
|
133
|
+
GOVUKAdmin.cookie = function(name, value, options) {
|
134
|
+
if(typeof value !== 'undefined'){
|
135
|
+
if(value === false || value === null) {
|
136
|
+
return GOVUKAdmin.setCookie(name, '', { days: -1 });
|
137
|
+
} else {
|
138
|
+
return GOVUKAdmin.setCookie(name, value, options);
|
139
|
+
}
|
140
|
+
} else {
|
141
|
+
return GOVUKAdmin.getCookie(name);
|
142
|
+
}
|
143
|
+
};
|
144
|
+
|
145
|
+
GOVUKAdmin.setCookie = function(name, value, options) {
|
146
|
+
if (typeof options === 'undefined') {
|
147
|
+
options = {};
|
148
|
+
}
|
149
|
+
var cookieString = name + "=" + value + "; path=/";
|
150
|
+
if (options.days) {
|
151
|
+
var date = new Date();
|
152
|
+
date.setTime(date.getTime() + (options.days * 24 * 60 * 60 * 1000));
|
153
|
+
cookieString = cookieString + "; expires=" + date.toGMTString();
|
154
|
+
}
|
155
|
+
if (options.domain) {
|
156
|
+
cookieString = cookieString + "; domain=" + options.domain;
|
157
|
+
}
|
158
|
+
if (document.location.protocol == 'https:'){
|
159
|
+
cookieString = cookieString + "; Secure";
|
160
|
+
}
|
161
|
+
document.cookie = cookieString;
|
162
|
+
};
|
163
|
+
|
164
|
+
GOVUKAdmin.getCookie = function(name) {
|
165
|
+
var nameEQ = name + "=";
|
166
|
+
var cookies = document.cookie.split(';');
|
167
|
+
for(var i = 0, len = cookies.length; i < len; i++) {
|
168
|
+
var cookie = cookies[i];
|
169
|
+
while (cookie.charAt(0) == ' ') {
|
170
|
+
cookie = cookie.substring(1, cookie.length);
|
171
|
+
}
|
172
|
+
if (cookie.indexOf(nameEQ) === 0) {
|
173
|
+
return decodeURIComponent(cookie.substring(nameEQ.length));
|
174
|
+
}
|
175
|
+
}
|
176
|
+
return null;
|
177
|
+
};
|
178
|
+
|
122
179
|
})(jQuery, window);
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: govuk_admin_template
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.
|
4
|
+
version: 2.6.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- GOV.UK Dev
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2015-
|
11
|
+
date: 2015-08-24 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rails
|
@@ -192,7 +192,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
192
192
|
version: '0'
|
193
193
|
requirements: []
|
194
194
|
rubyforge_project:
|
195
|
-
rubygems_version: 2.2.
|
195
|
+
rubygems_version: 2.2.5
|
196
196
|
signing_key:
|
197
197
|
specification_version: 4
|
198
198
|
summary: Styles, scripts and templates for GOV.UK admin applications
|