alula 0.4.24 → 0.4.25
Sign up to get free protection for your applications and to get access to all the features.
- data/lib/alula/config.rb +11 -5
- data/lib/alula/content.rb +0 -1
- data/lib/alula/context.rb +1 -1
- data/lib/alula/generators/feedjson.rb +60 -0
- data/lib/alula/version.rb +1 -1
- data/locales/en.yml +19 -0
- data/locales/fi.yml +19 -0
- data/locales/l10n/ar.yml +199 -0
- data/locales/l10n/az.yml +199 -0
- data/locales/l10n/bg.yml +199 -0
- data/locales/l10n/bn-IN.yml +182 -0
- data/locales/l10n/bs.yml +242 -0
- data/locales/l10n/ca.yml +199 -0
- data/locales/l10n/cs.yml +198 -0
- data/locales/l10n/csb.yml +210 -0
- data/locales/l10n/cy.yml +199 -0
- data/locales/l10n/da.yml +199 -0
- data/locales/l10n/de-AT.yml +203 -0
- data/locales/l10n/de-CH.yml +203 -0
- data/locales/l10n/de.yml +203 -0
- data/locales/l10n/dsb.yml +215 -0
- data/locales/l10n/el.yml +199 -0
- data/locales/l10n/en-AU.yml +205 -0
- data/locales/l10n/en-CA.yml +214 -0
- data/locales/l10n/en-GB.yml +205 -0
- data/locales/l10n/en-IN.yml +205 -0
- data/locales/l10n/en-US.yml +205 -0
- data/locales/l10n/en.yml +205 -0
- data/locales/l10n/eo.yml +201 -0
- data/locales/l10n/es-AR.yml +205 -0
- data/locales/l10n/es-CL.yml +199 -0
- data/locales/l10n/es-CO.yml +205 -0
- data/locales/l10n/es-MX.yml +205 -0
- data/locales/l10n/es-PE.yml +181 -0
- data/locales/l10n/es-VE.yml +205 -0
- data/locales/l10n/es.yml +199 -0
- data/locales/l10n/et.yml +199 -0
- data/locales/l10n/eu.yml +199 -0
- data/locales/l10n/fa.yml +199 -0
- data/locales/l10n/fi.yml +199 -0
- data/locales/l10n/fr-CA.yml +207 -0
- data/locales/l10n/fr-CH.yml +207 -0
- data/locales/l10n/fr.yml +222 -0
- data/locales/l10n/fur.yml +199 -0
- data/locales/l10n/gl-ES.yml +178 -0
- data/locales/l10n/gsw-CH.yml +199 -0
- data/locales/l10n/he.yml +201 -0
- data/locales/l10n/hi-IN.yml +199 -0
- data/locales/l10n/hi.yml +199 -0
- data/locales/l10n/hr.yml +237 -0
- data/locales/l10n/hsb.yml +214 -0
- data/locales/l10n/hu.yml +199 -0
- data/locales/l10n/id.yml +200 -0
- data/locales/l10n/is.yml +213 -0
- data/locales/l10n/it.yml +205 -0
- data/locales/l10n/ja.yml +197 -0
- data/locales/l10n/kn.yml +199 -0
- data/locales/l10n/ko.yml +197 -0
- data/locales/l10n/lo.yml +186 -0
- data/locales/l10n/lt.yml +182 -0
- data/locales/l10n/lv.yml +215 -0
- data/locales/l10n/mk.yml +170 -0
- data/locales/l10n/mn.yml +205 -0
- data/locales/l10n/nb.yml +207 -0
- data/locales/l10n/nl.yml +199 -0
- data/locales/l10n/nn.yml +160 -0
- data/locales/l10n/pl.yml +221 -0
- data/locales/l10n/pt-BR.yml +207 -0
- data/locales/l10n/pt-PT.yml +207 -0
- data/locales/l10n/quotes.yml +24 -0
- data/locales/l10n/rm.yml +182 -0
- data/locales/l10n/ro.yml +199 -0
- data/locales/l10n/ru.yml +257 -0
- data/locales/l10n/sk.yml +213 -0
- data/locales/l10n/sl.yml +210 -0
- data/locales/l10n/sr-Latn.yml +170 -0
- data/locales/l10n/sr.yml +170 -0
- data/locales/l10n/sv-SE.yml +199 -0
- data/locales/l10n/sw.yml +197 -0
- data/locales/l10n/th.yml +173 -0
- data/locales/l10n/tl.yml +229 -0
- data/locales/l10n/tr.yml +199 -0
- data/locales/l10n/uk.yml +257 -0
- data/locales/l10n/vi.yml +201 -0
- data/locales/l10n/wo.yml +205 -0
- data/locales/l10n/zh-CN.yml +199 -0
- data/locales/l10n/zh-TW.yml +199 -0
- data/template/Gemfile.erb +15 -0
- data/template/README +16 -0
- data/template/config.yml.erb +42 -0
- data/vendor/assets/images/cookieconsent.cookie-consent-logo.png +0 -0
- data/vendor/assets/images/cookieconsent.cross.png +0 -0
- data/vendor/assets/images/cookieconsent.globe.png +0 -0
- data/vendor/assets/images/cookieconsent.modal-close.png +0 -0
- data/vendor/assets/images/cookieconsent.silktide-logo.png +0 -0
- data/vendor/assets/images/favicon.png +0 -0
- data/vendor/assets/images/grey.gif +0 -0
- data/vendor/assets/javascripts/cookieconsent.js.coffee.erb +15 -0
- data/vendor/assets/javascripts/jquery.alula.js.coffee +16 -0
- data/vendor/assets/javascripts/jquery.js +9227 -0
- data/vendor/assets/javascripts/jquery.lazyload.js +210 -0
- data/vendor/assets/javascripts/lazyload.js.coffee +15 -0
- data/vendor/assets/javascripts/silktide.cookieconsent.js +1515 -0
- data/vendor/assets/stylesheets/cookieconsent.css.erb +1587 -0
- data/vendor/layouts/feed.json.jbuilder +14 -0
- data/vendor/layouts/feed.xml.builder +19 -0
- data/vendor/layouts/sitemap.xml.builder +10 -0
- data/vendor/static/favicon.ico +0 -0
- data/vendor/views/feed_post.html.haml +1 -0
- metadata +123 -3
@@ -0,0 +1,210 @@
|
|
1
|
+
/*
|
2
|
+
* Lazy Load - jQuery plugin for lazy loading images
|
3
|
+
*
|
4
|
+
* Copyright (c) 2007-2012 Mika Tuupola
|
5
|
+
*
|
6
|
+
* Licensed under the MIT license:
|
7
|
+
* http://www.opensource.org/licenses/mit-license.php
|
8
|
+
*
|
9
|
+
* Project home:
|
10
|
+
* http://www.appelsiini.net/projects/lazyload
|
11
|
+
*
|
12
|
+
* Version: 1.8.0
|
13
|
+
*
|
14
|
+
*/
|
15
|
+
(function($, window) {
|
16
|
+
var $window = $(window);
|
17
|
+
|
18
|
+
$.fn.lazyload = function(options) {
|
19
|
+
var elements = this;
|
20
|
+
var $container;
|
21
|
+
var settings = {
|
22
|
+
threshold : 0,
|
23
|
+
failure_limit : 0,
|
24
|
+
event : "scroll",
|
25
|
+
effect : "show",
|
26
|
+
container : window,
|
27
|
+
data_attribute : "original",
|
28
|
+
skip_invisible : true,
|
29
|
+
appear : null,
|
30
|
+
load : null
|
31
|
+
};
|
32
|
+
|
33
|
+
function update() {
|
34
|
+
var counter = 0;
|
35
|
+
|
36
|
+
elements.each(function() {
|
37
|
+
var $this = $(this);
|
38
|
+
if (settings.skip_invisible && !$this.is(":visible")) {
|
39
|
+
return;
|
40
|
+
}
|
41
|
+
if ($.abovethetop(this, settings) ||
|
42
|
+
$.leftofbegin(this, settings)) {
|
43
|
+
/* Nothing. */
|
44
|
+
} else if (!$.belowthefold(this, settings) &&
|
45
|
+
!$.rightoffold(this, settings)) {
|
46
|
+
$this.trigger("appear");
|
47
|
+
} else {
|
48
|
+
if (++counter > settings.failure_limit) {
|
49
|
+
return false;
|
50
|
+
}
|
51
|
+
}
|
52
|
+
});
|
53
|
+
|
54
|
+
}
|
55
|
+
|
56
|
+
if(options) {
|
57
|
+
/* Maintain BC for a couple of versions. */
|
58
|
+
if (undefined !== options.failurelimit) {
|
59
|
+
options.failure_limit = options.failurelimit;
|
60
|
+
delete options.failurelimit;
|
61
|
+
}
|
62
|
+
if (undefined !== options.effectspeed) {
|
63
|
+
options.effect_speed = options.effectspeed;
|
64
|
+
delete options.effectspeed;
|
65
|
+
}
|
66
|
+
|
67
|
+
$.extend(settings, options);
|
68
|
+
}
|
69
|
+
|
70
|
+
/* Cache container as jQuery as object. */
|
71
|
+
$container = (settings.container === undefined ||
|
72
|
+
settings.container === window) ? $window : $(settings.container);
|
73
|
+
|
74
|
+
/* Fire one scroll event per scroll. Not one scroll event per image. */
|
75
|
+
if (0 === settings.event.indexOf("scroll")) {
|
76
|
+
$container.bind(settings.event, function(event) {
|
77
|
+
return update();
|
78
|
+
});
|
79
|
+
}
|
80
|
+
|
81
|
+
this.each(function() {
|
82
|
+
var self = this;
|
83
|
+
var $self = $(self);
|
84
|
+
|
85
|
+
self.loaded = false;
|
86
|
+
|
87
|
+
/* When appear is triggered load original image. */
|
88
|
+
$self.one("appear", function() {
|
89
|
+
if (!this.loaded) {
|
90
|
+
if (settings.appear) {
|
91
|
+
var elements_left = elements.length;
|
92
|
+
settings.appear.call(self, elements_left, settings);
|
93
|
+
}
|
94
|
+
$("<img />")
|
95
|
+
.bind("load", function() {
|
96
|
+
$self
|
97
|
+
.hide()
|
98
|
+
.attr("src", $self.data(settings.data_attribute))
|
99
|
+
[settings.effect](settings.effect_speed);
|
100
|
+
self.loaded = true;
|
101
|
+
|
102
|
+
/* Remove image from array so it is not looped next time. */
|
103
|
+
var temp = $.grep(elements, function(element) {
|
104
|
+
return !element.loaded;
|
105
|
+
});
|
106
|
+
elements = $(temp);
|
107
|
+
|
108
|
+
if (settings.load) {
|
109
|
+
var elements_left = elements.length;
|
110
|
+
settings.load.call(self, elements_left, settings);
|
111
|
+
}
|
112
|
+
})
|
113
|
+
.attr("src", $self.data(settings.data_attribute));
|
114
|
+
}
|
115
|
+
});
|
116
|
+
|
117
|
+
/* When wanted event is triggered load original image */
|
118
|
+
/* by triggering appear. */
|
119
|
+
if (0 !== settings.event.indexOf("scroll")) {
|
120
|
+
$self.bind(settings.event, function(event) {
|
121
|
+
if (!self.loaded) {
|
122
|
+
$self.trigger("appear");
|
123
|
+
}
|
124
|
+
});
|
125
|
+
}
|
126
|
+
});
|
127
|
+
|
128
|
+
/* Check if something appears when window is resized. */
|
129
|
+
$window.bind("resize", function(event) {
|
130
|
+
update();
|
131
|
+
});
|
132
|
+
|
133
|
+
/* Force initial check if images should appear. */
|
134
|
+
update();
|
135
|
+
|
136
|
+
return this;
|
137
|
+
};
|
138
|
+
|
139
|
+
/* Convenience methods in jQuery namespace. */
|
140
|
+
/* Use as $.belowthefold(element, {threshold : 100, container : window}) */
|
141
|
+
|
142
|
+
$.belowthefold = function(element, settings) {
|
143
|
+
var fold;
|
144
|
+
|
145
|
+
if (settings.container === undefined || settings.container === window) {
|
146
|
+
fold = $window.height() + $window.scrollTop();
|
147
|
+
} else {
|
148
|
+
fold = $(settings.container).offset().top + $(settings.container).height();
|
149
|
+
}
|
150
|
+
|
151
|
+
return fold <= $(element).offset().top - settings.threshold;
|
152
|
+
};
|
153
|
+
|
154
|
+
$.rightoffold = function(element, settings) {
|
155
|
+
var fold;
|
156
|
+
|
157
|
+
if (settings.container === undefined || settings.container === window) {
|
158
|
+
fold = $window.width() + $window.scrollLeft();
|
159
|
+
} else {
|
160
|
+
fold = $(settings.container).offset().left + $(settings.container).width();
|
161
|
+
}
|
162
|
+
|
163
|
+
return fold <= $(element).offset().left - settings.threshold;
|
164
|
+
};
|
165
|
+
|
166
|
+
$.abovethetop = function(element, settings) {
|
167
|
+
var fold;
|
168
|
+
|
169
|
+
if (settings.container === undefined || settings.container === window) {
|
170
|
+
fold = $window.scrollTop();
|
171
|
+
} else {
|
172
|
+
fold = $(settings.container).offset().top;
|
173
|
+
}
|
174
|
+
|
175
|
+
return fold >= $(element).offset().top + settings.threshold + $(element).height();
|
176
|
+
};
|
177
|
+
|
178
|
+
$.leftofbegin = function(element, settings) {
|
179
|
+
var fold;
|
180
|
+
|
181
|
+
if (settings.container === undefined || settings.container === window) {
|
182
|
+
fold = $window.scrollLeft();
|
183
|
+
} else {
|
184
|
+
fold = $(settings.container).offset().left;
|
185
|
+
}
|
186
|
+
|
187
|
+
return fold >= $(element).offset().left + settings.threshold + $(element).width();
|
188
|
+
};
|
189
|
+
|
190
|
+
$.inviewport = function(element, settings) {
|
191
|
+
return !$.rightofscreen(element, settings) && !$.leftofscreen(element, settings) &&
|
192
|
+
!$.belowthefold(element, settings) && !$.abovethetop(element, settings);
|
193
|
+
};
|
194
|
+
|
195
|
+
/* Custom selectors for your convenience. */
|
196
|
+
/* Use as $("img:below-the-fold").something() */
|
197
|
+
|
198
|
+
$.extend($.expr[':'], {
|
199
|
+
"below-the-fold" : function(a) { return $.belowthefold(a, {threshold : 0}); },
|
200
|
+
"above-the-top" : function(a) { return !$.belowthefold(a, {threshold : 0}); },
|
201
|
+
"right-of-screen": function(a) { return $.rightoffold(a, {threshold : 0}); },
|
202
|
+
"left-of-screen" : function(a) { return !$.rightoffold(a, {threshold : 0}); },
|
203
|
+
"in-viewport" : function(a) { return !$.inviewport(a, {threshold : 0}); },
|
204
|
+
/* Maintain BC for couple of versions. */
|
205
|
+
"above-the-fold" : function(a) { return !$.belowthefold(a, {threshold : 0}); },
|
206
|
+
"right-of-fold" : function(a) { return $.rightoffold(a, {threshold : 0}); },
|
207
|
+
"left-of-fold" : function(a) { return !$.rightoffold(a, {threshold : 0}); }
|
208
|
+
});
|
209
|
+
|
210
|
+
})(jQuery, window);
|
@@ -0,0 +1,15 @@
|
|
1
|
+
#=require jquery.alula
|
2
|
+
#=require jquery.lazyload
|
3
|
+
|
4
|
+
jQuery ->
|
5
|
+
# Hi-res support
|
6
|
+
if jQuery.getDevicePixelRatio() <= 1
|
7
|
+
jQuery("img[data-original]").lazyload
|
8
|
+
data_attribute: "original"
|
9
|
+
else
|
10
|
+
# Replace 2x images
|
11
|
+
jQuery("img[data-hires]").lazyload
|
12
|
+
data_attribute: "hires"
|
13
|
+
# Replace remaining
|
14
|
+
jQuery("img[data-original]:not('[data-hires]')").lazyload
|
15
|
+
data_attribute: "original"
|
@@ -0,0 +1,1515 @@
|
|
1
|
+
/*
|
2
|
+
Copyright 2012 Silktide Ltd.
|
3
|
+
|
4
|
+
This program is free software: you can redistribute it and/or modify
|
5
|
+
it under the terms of the GNU General Public License as published by
|
6
|
+
the Free Software Foundation, either version 3 of the License, or
|
7
|
+
(at your option) any later version.
|
8
|
+
|
9
|
+
This program is distributed in the hope that it will be useful,
|
10
|
+
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
11
|
+
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
12
|
+
GNU General Public License for more details.
|
13
|
+
|
14
|
+
You should have received a copy of the GNU General Public License
|
15
|
+
along with this program. If not, see <http://www.gnu.org/licenses/>
|
16
|
+
|
17
|
+
|
18
|
+
.---. .---.
|
19
|
+
: : o : me want cookie!
|
20
|
+
_..-: o : :-.._ /
|
21
|
+
.-'' ' `---' `---' " ``-.
|
22
|
+
.' " ' " . " . ' " `.
|
23
|
+
: '.---.,,.,...,.,.,.,..---. ' ;
|
24
|
+
`. " `. .' " .'
|
25
|
+
`. '`. .' ' .'
|
26
|
+
`. `-._ _.-' " .' .----.
|
27
|
+
`. " '"--...--"' . ' .' .' o `.
|
28
|
+
.'`-._' " . " _.-'`. : o :
|
29
|
+
jgs .' ```--.....--''' ' `:_ o :
|
30
|
+
.' " ' " " ; `.;";";";'
|
31
|
+
; ' " ' . ; .' ; ; ;
|
32
|
+
; ' ' ' " .' .-'
|
33
|
+
' " " ' " " _.-'
|
34
|
+
*/
|
35
|
+
|
36
|
+
var cc =
|
37
|
+
{
|
38
|
+
version: '1.0.8',
|
39
|
+
initobj: false,
|
40
|
+
ismobile: false,
|
41
|
+
setupcomplete: false,
|
42
|
+
allasked: false,
|
43
|
+
checkedlocal: false,
|
44
|
+
checkedremote: false,
|
45
|
+
remoteresponse: false,
|
46
|
+
frommodal: false,
|
47
|
+
hassetupmobile: false,
|
48
|
+
sessionkey: false,
|
49
|
+
noclosewin: false,
|
50
|
+
closingmodal: false,
|
51
|
+
jqueryattempts: 0,
|
52
|
+
reloadkey: false,
|
53
|
+
forcereload: false,
|
54
|
+
allagree: true,
|
55
|
+
checkedipdb: false,
|
56
|
+
cookies: {},
|
57
|
+
uniqelemid: 0,
|
58
|
+
executionblock: 0,
|
59
|
+
defaultCookies: { social: {}, analytics: {}, advertising: {}},
|
60
|
+
remoteCookies: {},
|
61
|
+
approved: {},
|
62
|
+
bindfunctions: {},
|
63
|
+
checkeddonottrack: false,
|
64
|
+
eumemberstates: [
|
65
|
+
"BE",
|
66
|
+
"BG",
|
67
|
+
"CZ",
|
68
|
+
"DK",
|
69
|
+
"DE",
|
70
|
+
"EE",
|
71
|
+
"IE",
|
72
|
+
"EL",
|
73
|
+
"ES",
|
74
|
+
"FR",
|
75
|
+
"IT",
|
76
|
+
"CY",
|
77
|
+
"LV",
|
78
|
+
"LT",
|
79
|
+
"LU",
|
80
|
+
"HU",
|
81
|
+
"MT",
|
82
|
+
"NL",
|
83
|
+
"AT",
|
84
|
+
"PL",
|
85
|
+
"PT",
|
86
|
+
"RO",
|
87
|
+
"SI",
|
88
|
+
"SK",
|
89
|
+
"FI",
|
90
|
+
"SE",
|
91
|
+
"UK"
|
92
|
+
],
|
93
|
+
settings: {
|
94
|
+
refreshOnConsent: false,
|
95
|
+
style: "dark",
|
96
|
+
bannerPosition: "top",
|
97
|
+
clickAnyLinkToConsent: false,
|
98
|
+
privacyPolicy: false,
|
99
|
+
collectStatistics: false,
|
100
|
+
tagPosition: 'bottom-right',
|
101
|
+
useSSL: false,
|
102
|
+
serveraddr: 'http://cookieconsent.silktide.com/',
|
103
|
+
clearprefs: false,
|
104
|
+
consenttype: 'explicit',
|
105
|
+
onlyshowbanneronce: false,
|
106
|
+
hideallsitesbutton: false,
|
107
|
+
disableallsites: false,
|
108
|
+
hideprivacysettingstab: false,
|
109
|
+
scriptdelay: 800,
|
110
|
+
testmode: false,
|
111
|
+
overridewarnings: false,
|
112
|
+
onlyshowwithineu: false,
|
113
|
+
ipinfodbkey: false
|
114
|
+
},
|
115
|
+
|
116
|
+
strings: {
|
117
|
+
jqueryWarning: "Developer: Caution! In order to use Cookie Consent, you need to use jQuery 1.4.4 or higher.",
|
118
|
+
noJsBlocksWarning: "Developer: Warning! It doesn't look like you have set up Cookie Consent correctly. You must follow all steps of the setup guide at http://silktide.com/cookieconsent/code. If you believe you are seeing this message in error, you can use the overridewarnings setting (see docs for more information).",
|
119
|
+
noKeyWarning: "Developer: Warning! You have set the plugin to only show within the EU, but you have not provided an API key for the IP Info DB. Check the documentation at http://silktide.com/cookieconsent for more information",
|
120
|
+
invalidKeyWarning: "Developer: Warning! You must provide a valid API key for IP Info DB. Check the documentation at http://silktide.com/cookieconsent for more information",
|
121
|
+
necessaryDefaultTitle: "Strictly necessary",
|
122
|
+
socialDefaultTitle: "Social media",
|
123
|
+
analyticsDefaultTitle: "Analytics",
|
124
|
+
advertisingDefaultTitle: "Advertising",
|
125
|
+
defaultTitle: "Default cookie title",
|
126
|
+
necessaryDefaultDescription: "Some cookies on this website are strictly necessary and cannot be disabled.",
|
127
|
+
socialDefaultDescription: "Facebook, Twitter and other social websites need to know who you are to work properly.",
|
128
|
+
analyticsDefaultDescription: "We anonymously measure your use of this website to improve your experience.",
|
129
|
+
advertisingDefaultDescription: "Adverts will be chosen for you automatically based on your past behaviour and interests.",
|
130
|
+
defaultDescription: "Default cookie description.",
|
131
|
+
notificationTitle: "Your experience on this site will be improved by allowing cookies",
|
132
|
+
notificationTitleImplicit: "We use cookies to ensure you get the best experience on our website",
|
133
|
+
poweredBy: "Cookie Consent plugin for the EU cookie law",
|
134
|
+
privacyPolicy: "Privacy policy",
|
135
|
+
learnMore: "Learn more",
|
136
|
+
seeDetails: "see details",
|
137
|
+
seeDetailsImplicit: "change your settings",
|
138
|
+
hideDetails: "hide details",
|
139
|
+
savePreference: 'Save preference',
|
140
|
+
saveForAllSites: 'Save for all sites',
|
141
|
+
allowCookies: 'Allow cookies',
|
142
|
+
allowCookiesImplicit: 'Close',
|
143
|
+
allowForAllSites: 'Allow for all sites',
|
144
|
+
customCookie: 'This website uses a custom type of cookie which needs specific approval',
|
145
|
+
privacySettings: "Privacy settings",
|
146
|
+
privacySettingsDialogTitleA: "Privacy settings",
|
147
|
+
privacySettingsDialogTitleB: "for this website",
|
148
|
+
privacySettingsDialogSubtitle: "Some features of this website need your consent to remember who you are.",
|
149
|
+
closeWindow: "Close window",
|
150
|
+
changeForAllSitesLink: "Change settings for all websites",
|
151
|
+
preferenceUseGlobal: 'Use global setting',
|
152
|
+
preferenceConsent: "I consent",
|
153
|
+
preferenceDecline: "I decline",
|
154
|
+
preferenceAsk: 'Ask me each time',
|
155
|
+
preferenceAlways: "Always allow",
|
156
|
+
preferenceNever: "Never allow",
|
157
|
+
notUsingCookies: "This website does not use any cookies.",
|
158
|
+
clearedCookies: "Your cookies have been cleared, you will need to reload this page for the settings to have effect.",
|
159
|
+
allSitesSettingsDialogTitleA: "Privacy settings",
|
160
|
+
allSitesSettingsDialogTitleB: "for all websites",
|
161
|
+
allSitesSettingsDialogSubtitle: "You may consent to these cookies for all websites that use this plugin.",
|
162
|
+
backToSiteSettings: "Back to website settings"
|
163
|
+
},
|
164
|
+
|
165
|
+
onconsent: function(cookieType, input)
|
166
|
+
{
|
167
|
+
if(cc.isfunction(input))
|
168
|
+
{
|
169
|
+
fn = input;
|
170
|
+
}
|
171
|
+
else
|
172
|
+
{
|
173
|
+
scriptname = input;
|
174
|
+
fn = function()
|
175
|
+
{
|
176
|
+
cc.insertscript(scriptname);
|
177
|
+
};
|
178
|
+
}
|
179
|
+
if(cc.cookies && cc.cookies[cookieType] && cc.cookies[cookieType].approved)
|
180
|
+
{
|
181
|
+
cc.cookies[cookieType].executed = true;
|
182
|
+
fn();
|
183
|
+
} else {
|
184
|
+
if(window.jQuery)
|
185
|
+
{
|
186
|
+
jQuery(document).bind("cc_"+cookieType, fn);
|
187
|
+
} else {
|
188
|
+
if(cc.bindfunctions[cookieType])
|
189
|
+
{
|
190
|
+
cc.bindfunctions[cookieType][cc.bindfunctions[cookieType].length] = fn;
|
191
|
+
} else {
|
192
|
+
cc.bindfunctions[cookieType] = new Array(fn);
|
193
|
+
}
|
194
|
+
}
|
195
|
+
}
|
196
|
+
},
|
197
|
+
|
198
|
+
geturlparameter: function (name)
|
199
|
+
{
|
200
|
+
name = name.replace(/[\[]/, "\\\[").replace(/[\]]/, "\\\]");
|
201
|
+
var regexS = "[\\?&]" + name + "=([^&#]*)";
|
202
|
+
var regex = new RegExp(regexS);
|
203
|
+
var results = regex.exec(window.location.search);
|
204
|
+
if(results == null)
|
205
|
+
return false;
|
206
|
+
else
|
207
|
+
return decodeURIComponent(results[1].replace(/\+/g, " "));
|
208
|
+
},
|
209
|
+
|
210
|
+
isfunction: function(functionToCheck) {
|
211
|
+
var getType = {};
|
212
|
+
return functionToCheck && getType.toString.call(functionToCheck) == '[object Function]';
|
213
|
+
},
|
214
|
+
|
215
|
+
setup: function()
|
216
|
+
{
|
217
|
+
jQuery.each(cc.bindfunctions, function(key, value) {
|
218
|
+
for(i = 0; i < value.length; i++)
|
219
|
+
{
|
220
|
+
jQuery(document).bind("cc_"+key, value[i]);
|
221
|
+
}
|
222
|
+
});
|
223
|
+
var verstr = jQuery().jquery.replace(/\./g, '');
|
224
|
+
while (verstr.length < 6) {
|
225
|
+
verstr = verstr + '0';
|
226
|
+
}
|
227
|
+
if (parseInt(verstr) < 144000)
|
228
|
+
{
|
229
|
+
alert(cc.strings.jqueryWarning);
|
230
|
+
}
|
231
|
+
jQuery.each(cc.defaultCookies, function(key, value) {
|
232
|
+
if(key == "necessary")
|
233
|
+
{
|
234
|
+
cc.defaultCookies[key].title = cc.strings.necessaryDefaultTitle;
|
235
|
+
cc.defaultCookies[key].description = cc.strings.necessaryDefaultDescription;
|
236
|
+
}
|
237
|
+
else if(key == "social")
|
238
|
+
{
|
239
|
+
cc.defaultCookies[key].title = cc.strings.socialDefaultTitle;
|
240
|
+
cc.defaultCookies[key].description = cc.strings.socialDefaultDescription;
|
241
|
+
}
|
242
|
+
else if(key == "analytics")
|
243
|
+
{
|
244
|
+
cc.defaultCookies[key].title = cc.strings.analyticsDefaultTitle;
|
245
|
+
cc.defaultCookies[key].description = cc.strings.analyticsDefaultDescription;
|
246
|
+
}
|
247
|
+
else if(key == "advertising")
|
248
|
+
{
|
249
|
+
cc.defaultCookies[key].title = cc.strings.advertisingDefaultTitle;
|
250
|
+
cc.defaultCookies[key].description = cc.strings.advertisingDefaultDescription;
|
251
|
+
}
|
252
|
+
});
|
253
|
+
jQuery.each(cc.initobj.cookies, function(key, value) {
|
254
|
+
|
255
|
+
if(!value.title)
|
256
|
+
{
|
257
|
+
if(key == "necessary")
|
258
|
+
{
|
259
|
+
cc.initobj.cookies[key].title = cc.strings.necessaryDefaultTitle;
|
260
|
+
}
|
261
|
+
else if(key == "social")
|
262
|
+
{
|
263
|
+
cc.initobj.cookies[key].title = cc.strings.socialDefaultTitle;
|
264
|
+
}
|
265
|
+
else if(key == "analytics")
|
266
|
+
{
|
267
|
+
cc.initobj.cookies[key].title = cc.strings.analyticsDefaultTitle;
|
268
|
+
}
|
269
|
+
else if(key == "advertising")
|
270
|
+
{
|
271
|
+
cc.initobj.cookies[key].title = cc.strings.advertisingDefaultTitle;
|
272
|
+
} else {
|
273
|
+
cc.initobj.cookies[key].title = cc.strings.defaultTitle;
|
274
|
+
}
|
275
|
+
}
|
276
|
+
if(!value.description)
|
277
|
+
{
|
278
|
+
if(key == "necessary")
|
279
|
+
{
|
280
|
+
cc.initobj.cookies[key].description = cc.strings.necessaryDefaultDescription;
|
281
|
+
}
|
282
|
+
else if(key == "social")
|
283
|
+
{
|
284
|
+
cc.initobj.cookies[key].description = cc.strings.socialDefaultDescription;
|
285
|
+
}
|
286
|
+
else if(key == "analytics")
|
287
|
+
{
|
288
|
+
cc.initobj.cookies[key].description = cc.strings.analyticsDefaultDescription;
|
289
|
+
}
|
290
|
+
else if(key == "advertising")
|
291
|
+
{
|
292
|
+
cc.initobj.cookies[key].description = cc.strings.advertisingDefaultDescription;
|
293
|
+
} else {
|
294
|
+
cc.initobj.cookies[key].description = cc.strings.defaultDescription;
|
295
|
+
}
|
296
|
+
}
|
297
|
+
|
298
|
+
if(!value.defaultstate)
|
299
|
+
{
|
300
|
+
cc.initobj.cookies[key].defaultstate = "on";
|
301
|
+
}
|
302
|
+
|
303
|
+
cc.initobj.cookies[key].asked = false;
|
304
|
+
cc.initobj.cookies[key].approved = false;
|
305
|
+
cc.initobj.cookies[key].executed = false;
|
306
|
+
});
|
307
|
+
if(cc.settings.onlyshowwithineu && !cc.settings.ipinfodbkey)
|
308
|
+
{
|
309
|
+
alert(cc.strings.noKeyWarning);
|
310
|
+
}
|
311
|
+
testmode = cc.geturlparameter('cctestmode');
|
312
|
+
if(testmode == 'accept' || testmode == 'decline')
|
313
|
+
{
|
314
|
+
cc.settings.testmode = testmode;
|
315
|
+
}
|
316
|
+
if(cc.settings.disableallsites)
|
317
|
+
{
|
318
|
+
cc.settings.hideallsitesbutton = true;
|
319
|
+
}
|
320
|
+
|
321
|
+
for (var attrname in cc.initobj.cookies)
|
322
|
+
{
|
323
|
+
cc.cookies[attrname] = cc.initobj.cookies[attrname];
|
324
|
+
if(cc.settings.testmode == "accept")
|
325
|
+
{
|
326
|
+
cc.approved[attrname] = "yes";
|
327
|
+
}
|
328
|
+
if(cc.settings.testmode == "decline")
|
329
|
+
{
|
330
|
+
cc.approved[attrname] = "no";
|
331
|
+
}
|
332
|
+
}
|
333
|
+
|
334
|
+
},
|
335
|
+
|
336
|
+
initialise: function (obj)
|
337
|
+
{
|
338
|
+
cc.initobj = obj;
|
339
|
+
if(obj.settings !== undefined)
|
340
|
+
{
|
341
|
+
for (var attrname in obj.settings) { this.settings[attrname] = obj.settings[attrname]; }
|
342
|
+
}
|
343
|
+
if(obj.strings !== undefined)
|
344
|
+
{
|
345
|
+
for (var attrname in obj.strings) { this.strings[attrname] = obj.strings[attrname]; }
|
346
|
+
}
|
347
|
+
cc.settings.style = "cc-"+cc.settings.style;
|
348
|
+
cc.settings.bannerPosition = "cc-"+cc.settings.bannerPosition;
|
349
|
+
if(cc.settings.useSSL)
|
350
|
+
{
|
351
|
+
cc.settings.serveraddr = 'https://cookieconsent.silktide.com/';
|
352
|
+
}
|
353
|
+
if(window.jQuery)
|
354
|
+
{
|
355
|
+
cc.setupcomplete = true;
|
356
|
+
cc.setup();
|
357
|
+
}
|
358
|
+
},
|
359
|
+
|
360
|
+
calculatestatsparams: function()
|
361
|
+
{
|
362
|
+
params = "c=";
|
363
|
+
first = true;
|
364
|
+
jQuery.each(cc.initobj.cookies, function(key, value) {
|
365
|
+
if(first)
|
366
|
+
{
|
367
|
+
first = false;
|
368
|
+
} else
|
369
|
+
{
|
370
|
+
params += ";";
|
371
|
+
}
|
372
|
+
params += encodeURIComponent(key)+":";
|
373
|
+
|
374
|
+
if(cc.approved[key])
|
375
|
+
{
|
376
|
+
params += cc.approved[key];
|
377
|
+
} else {
|
378
|
+
params += "none";
|
379
|
+
}
|
380
|
+
if(value.statsid)
|
381
|
+
{
|
382
|
+
params += ":" + value.statsid;
|
383
|
+
}
|
384
|
+
});
|
385
|
+
if(cc.ismobile)
|
386
|
+
{
|
387
|
+
params += "&m=1";
|
388
|
+
} else {
|
389
|
+
params += "&m=0";
|
390
|
+
}
|
391
|
+
params += "&u=" + encodeURIComponent(document.URL);
|
392
|
+
return params;
|
393
|
+
},
|
394
|
+
|
395
|
+
setsessionkey: function(data)
|
396
|
+
{
|
397
|
+
cc.sessionkey = data;
|
398
|
+
},
|
399
|
+
|
400
|
+
|
401
|
+
fetchprefs: function()
|
402
|
+
{
|
403
|
+
cc.remoteresponse = false;
|
404
|
+
params = "?s=1";
|
405
|
+
if(cc.settings.collectStatistics)
|
406
|
+
{
|
407
|
+
params = "?s=1&" + cc.calculatestatsparams();
|
408
|
+
}
|
409
|
+
if(cc.settings.clearprefs)
|
410
|
+
{
|
411
|
+
params += "&v=1";
|
412
|
+
cc.settings.clearprefs = false;
|
413
|
+
}
|
414
|
+
cc.insertscript(cc.settings.serveraddr+params);
|
415
|
+
setTimeout(function(){
|
416
|
+
if(!cc.remoteresponse)
|
417
|
+
{
|
418
|
+
cc.checkapproval();
|
419
|
+
}
|
420
|
+
}, 3000);
|
421
|
+
this.checkedremote = true;
|
422
|
+
},
|
423
|
+
|
424
|
+
responseids: function(data)
|
425
|
+
{
|
426
|
+
jQuery.each(data, function(key, value) {
|
427
|
+
cc.cookies[key].statsid = value;
|
428
|
+
});
|
429
|
+
},
|
430
|
+
|
431
|
+
insertscript: function(script)
|
432
|
+
{
|
433
|
+
var newfile = document.createElement('script');
|
434
|
+
newfile.setAttribute("type","text/javascript");
|
435
|
+
newfile.setAttribute("src", script);
|
436
|
+
document.getElementsByTagName("head")[0].appendChild(newfile);
|
437
|
+
},
|
438
|
+
|
439
|
+
insertscripttag: function(content)
|
440
|
+
{
|
441
|
+
var newfile = document.createElement('script');
|
442
|
+
newfile.setAttribute("type","text/javascript");
|
443
|
+
newfile.innerHTML = content;
|
444
|
+
document.getElementsByTagName("head")[0].appendChild(newfile);
|
445
|
+
},
|
446
|
+
|
447
|
+
checklocal: function()
|
448
|
+
{
|
449
|
+
this.checkedlocal = true;
|
450
|
+
jQuery.each(cc.cookies, function(key, value)
|
451
|
+
{
|
452
|
+
cookieval = cc.getcookie('cc_'+key);
|
453
|
+
if(cookieval)
|
454
|
+
{
|
455
|
+
cc.approved[key] = cookieval;
|
456
|
+
}
|
457
|
+
});
|
458
|
+
this.checkapproval();
|
459
|
+
},
|
460
|
+
|
461
|
+
response: function (data)
|
462
|
+
{
|
463
|
+
cc.remoteresponse = true
|
464
|
+
jQuery.each(data, function(key, value) {
|
465
|
+
if(cc.cookies[key] && (!cc.approved[key] || (cc.approved[key] && (cc.approved[key] == "always" || cc.approved[key] == "never"))))
|
466
|
+
{
|
467
|
+
cc.setcookie('cc_'+key, value, 365);
|
468
|
+
}
|
469
|
+
});
|
470
|
+
|
471
|
+
for (var attrname in data)
|
472
|
+
{
|
473
|
+
cc.remoteCookies[attrname] = data[attrname];
|
474
|
+
if(this.approved[attrname] != "yes" && this.approved[attrname] != "no")
|
475
|
+
{
|
476
|
+
this.approved[attrname] = data[attrname];
|
477
|
+
}
|
478
|
+
}
|
479
|
+
jQuery.each(cc.cookies, function(key, value) {
|
480
|
+
if(!data[key] && (cc.approved[key] == "always" || cc.approved[key] == "never"))
|
481
|
+
{
|
482
|
+
cc.cookies[key].approved = false;
|
483
|
+
cc.deletecookie(key);
|
484
|
+
delete cc.approved[key];
|
485
|
+
}
|
486
|
+
});
|
487
|
+
|
488
|
+
this.checkapproval();
|
489
|
+
},
|
490
|
+
|
491
|
+
deletecookie: function(key)
|
492
|
+
{
|
493
|
+
date = new Date();
|
494
|
+
date.setDate(date.getDate() -1);
|
495
|
+
document.cookie = escape("cc_"+key) + '=; path=/; expires=' + date;
|
496
|
+
},
|
497
|
+
|
498
|
+
reloadifnecessary: function()
|
499
|
+
{
|
500
|
+
if(cc.settings.refreshOnConsent || cc.ismobile || cc.forcereload)
|
501
|
+
{
|
502
|
+
setTimeout("location.reload(true);",50);
|
503
|
+
}
|
504
|
+
},
|
505
|
+
|
506
|
+
onkeyup: function(e)
|
507
|
+
{
|
508
|
+
if (e.keyCode == 27)
|
509
|
+
{
|
510
|
+
cc.closemodals();
|
511
|
+
}
|
512
|
+
},
|
513
|
+
|
514
|
+
closemodals: function()
|
515
|
+
{
|
516
|
+
if(!cc.closingmodal)
|
517
|
+
{
|
518
|
+
if(cc.noclosewin)
|
519
|
+
{
|
520
|
+
cc.noclosewin = false;
|
521
|
+
} else {
|
522
|
+
if(jQuery('#cc-modal').is(":visible"))
|
523
|
+
{
|
524
|
+
jQuery('#cc-modal .cc-modal-closebutton a').click();
|
525
|
+
}
|
526
|
+
if(jQuery('#cc-settingsmodal').is(":visible"))
|
527
|
+
{
|
528
|
+
jQuery('#cc-settingsmodal #cc-settingsmodal-closebutton a').click();
|
529
|
+
}
|
530
|
+
}
|
531
|
+
}
|
532
|
+
},
|
533
|
+
|
534
|
+
showbanner: function ()
|
535
|
+
{
|
536
|
+
jQuery('#cc-tag').fadeOut(null, function() {
|
537
|
+
jQuery(this).remove();
|
538
|
+
});
|
539
|
+
jQuery('#cc-notification').remove();
|
540
|
+
if(cc.ismobile)
|
541
|
+
{
|
542
|
+
cc.setupformobile();
|
543
|
+
jQuery('head').append('<meta name="viewport" content="width=device-width; initial-scale=1.0; maximum-scale=1.0;">');
|
544
|
+
jQuery('body').html('').css("margin", 0);
|
545
|
+
}
|
546
|
+
data = '<div id="cc-notification">' +
|
547
|
+
'<div id="cc-notification-wrapper">' +
|
548
|
+
'<h2><span>'+cc.strings.notificationTitle+'</span></h2>' +
|
549
|
+
'<div id="cc-notification-permissions">' +
|
550
|
+
'<a id="cc-notification-logo" class="cc-logo" target="_blank" href="http://silktide.com/cookieconsent" title="'+cc.strings.poweredBy+'"><span>'+cc.strings.poweredBy+'</span></a> ' +
|
551
|
+
'</div>' +
|
552
|
+
'<ul class="cc-notification-buttons">' +
|
553
|
+
|
554
|
+
'<li>' +
|
555
|
+
'<a class="cc-link" href="http://cookieconsent.silktide.com" id="cc-approve-button-allsites">'+cc.strings.allowForAllSites+'</a>' +
|
556
|
+
'</li>' +
|
557
|
+
'<li>' +
|
558
|
+
'<a class="cc-link" href="#" id="cc-approve-button-thissite">'+cc.strings.allowCookies+'</a>' +
|
559
|
+
'</li>' +
|
560
|
+
'</ul>' +
|
561
|
+
'<div class="cc-clear"></div>' +
|
562
|
+
'</div>' +
|
563
|
+
'</div>';
|
564
|
+
|
565
|
+
jQuery('body').prepend(data);
|
566
|
+
if(cc.settings.hideallsitesbutton)
|
567
|
+
{
|
568
|
+
jQuery('#cc-approve-button-allsites').hide();
|
569
|
+
}
|
570
|
+
if(cc.settings.consenttype == 'implicit')
|
571
|
+
{
|
572
|
+
jQuery('#cc-notification h2 span').html(cc.strings.notificationTitleImplicit);
|
573
|
+
jQuery('#cc-approve-button-thissite').html(cc.strings.allowCookiesImplicit);
|
574
|
+
jQuery('#cc-approve-button-thissite').parent().after(jQuery('#cc-approve-button-allsites').parent());
|
575
|
+
jQuery('#cc-approve-button-allsites').hide();
|
576
|
+
}
|
577
|
+
jQuery('#cc-notification-logo').hide();
|
578
|
+
if(cc.settings.privacyPolicy)
|
579
|
+
{
|
580
|
+
jQuery('#cc-notification-moreinformation').prepend('<a href="'+cc.settings.privacyPolicy+'">'+cc.strings.privacyPolicy+'</a> | ');
|
581
|
+
}
|
582
|
+
jQuery('#cc-notification').addClass(cc.settings.style).addClass(cc.settings.bannerPosition);
|
583
|
+
bannerh = jQuery('#cc-notification').height();
|
584
|
+
jQuery('#cc-notification').hide();
|
585
|
+
if(cc.ismobile)
|
586
|
+
{
|
587
|
+
jQuery('#cc-notification').addClass("cc-mobile");
|
588
|
+
}
|
589
|
+
jQuery('#cc-notification-permissions').prepend('<ul></ul>');
|
590
|
+
allcustom = true;
|
591
|
+
jQuery.each(cc.cookies, function(key, value) {
|
592
|
+
if(!value.asked)
|
593
|
+
{
|
594
|
+
jQuery('#cc-notification-permissions ul').append('<li><input type="checkbox" checked="checked" id="cc-checkbox-'+key+'" /> <label id="cc-label-'+key+'" for="cc-checkbox-'+key+'"><strong>'+value.title+'</strong> '+value.description+'</label></li>');
|
595
|
+
if(value.link)
|
596
|
+
{
|
597
|
+
jQuery('#cc-label-'+key).append(' <a target="_blank" href="'+value.link+'" class="cc-learnmore-link">'+cc.strings.learnMore+'</a>');
|
598
|
+
}
|
599
|
+
if(key == "social" || key == "analytics" || key == "advertising")
|
600
|
+
{
|
601
|
+
allcustom = false;
|
602
|
+
}
|
603
|
+
jQuery('#cc-checkbox-'+key).change(function(){
|
604
|
+
if(jQuery(this).is(':checked'))
|
605
|
+
{
|
606
|
+
jQuery(this).parent().removeClass('cc-notification-permissions-inactive');
|
607
|
+
} else {
|
608
|
+
jQuery(this).parent().addClass('cc-notification-permissions-inactive');
|
609
|
+
|
610
|
+
}
|
611
|
+
});
|
612
|
+
if(value.defaultstate == "off")
|
613
|
+
{
|
614
|
+
jQuery('#cc-checkbox-'+key).removeAttr("checked").parent().addClass('cc-notification-permissions-inactive');
|
615
|
+
}
|
616
|
+
if(key == "necessary")
|
617
|
+
{
|
618
|
+
jQuery('#cc-checkbox-'+key).attr("disabled", "disabled");
|
619
|
+
}
|
620
|
+
}
|
621
|
+
});
|
622
|
+
jQuery('#cc-notification-wrapper h2').append(' - <a class="cc-link" href="#" id="cc-notification-moreinfo">'+cc.strings.seeDetails+'</a>');
|
623
|
+
if(cc.settings.consenttype == "implicit")
|
624
|
+
{
|
625
|
+
jQuery('#cc-notification-moreinfo').html(cc.strings.seeDetailsImplicit);
|
626
|
+
}
|
627
|
+
jQuery('#cc-notification-moreinfo').click(function(){
|
628
|
+
if(jQuery(this).html() == cc.strings.seeDetails || jQuery(this).html() == cc.strings.seeDetailsImplicit)
|
629
|
+
{
|
630
|
+
if(cc.settings.consenttype == 'implicit')
|
631
|
+
{
|
632
|
+
if(!cc.settings.hideallsitesbutton)
|
633
|
+
{
|
634
|
+
jQuery('#cc-approve-button-allsites').show();
|
635
|
+
}
|
636
|
+
}
|
637
|
+
jQuery('#cc-approve-button-thissite').html(cc.strings.savePreference);
|
638
|
+
jQuery('#cc-approve-button-allsites').html(cc.strings.saveForAllSites);
|
639
|
+
jQuery(this).html(cc.strings.hideDetails);
|
640
|
+
} else {
|
641
|
+
jQuery.each(cc.cookies, function(key, value) {
|
642
|
+
if(value.defaultstate == "off")
|
643
|
+
{
|
644
|
+
jQuery('#cc-checkbox-'+key).removeAttr("checked");
|
645
|
+
jQuery(this).parent().addClass('cc-notification-permissions-inactive');
|
646
|
+
} else {
|
647
|
+
jQuery('#cc-checkbox-'+key).attr('checked', 'checked');
|
648
|
+
jQuery(this).parent().removeClass('cc-notification-permissions-inactive');
|
649
|
+
|
650
|
+
}
|
651
|
+
});
|
652
|
+
if(cc.settings.consenttype == 'implicit')
|
653
|
+
{
|
654
|
+
jQuery(this).html(cc.strings.seeDetailsImplicit);
|
655
|
+
jQuery('#cc-approve-button-thissite').html(cc.strings.allowCookiesImplicit);
|
656
|
+
jQuery('#cc-approve-button-allsites').hide();
|
657
|
+
} else {
|
658
|
+
jQuery(this).html(cc.strings.seeDetails);
|
659
|
+
jQuery('#cc-approve-button-thissite').html(cc.strings.allowCookies);
|
660
|
+
jQuery('#cc-approve-button-allsites').html(cc.strings.allowForAllSites);
|
661
|
+
}
|
662
|
+
}
|
663
|
+
jQuery('#cc-notification-logo').fadeToggle();
|
664
|
+
jQuery('#cc-notification-permissions').slideToggle();
|
665
|
+
jQuery(this).blur();
|
666
|
+
return false;
|
667
|
+
});
|
668
|
+
|
669
|
+
if(!cc.ismobile)
|
670
|
+
{
|
671
|
+
if(cc.settings.bannerPosition == "cc-push")
|
672
|
+
{
|
673
|
+
jQuery('html').animate({marginTop: bannerh}, 400);
|
674
|
+
}
|
675
|
+
jQuery('#cc-notification').slideDown();
|
676
|
+
} else {
|
677
|
+
jQuery('#cc-notification').show();
|
678
|
+
}
|
679
|
+
|
680
|
+
jQuery('#cc-approve-button-thissite').click(cc.onlocalconsentgiven);
|
681
|
+
if(cc.settings.clickAnyLinkToConsent)
|
682
|
+
{
|
683
|
+
jQuery("a").filter(':not(.cc-link)').click(cc.onlocalconsentgiven);
|
684
|
+
}
|
685
|
+
if(allcustom)
|
686
|
+
{
|
687
|
+
jQuery('#cc-notification h2 span').html(cc.strings.customCookie);
|
688
|
+
jQuery('#cc-approve-button-allsites').hide();
|
689
|
+
} else {
|
690
|
+
jQuery('#cc-approve-button-allsites').click(cc.onremoteconsentgiven);
|
691
|
+
}
|
692
|
+
|
693
|
+
},
|
694
|
+
|
695
|
+
timestamp: function()
|
696
|
+
{
|
697
|
+
return Math.round((new Date()).getTime() / 1000);
|
698
|
+
},
|
699
|
+
|
700
|
+
locationcallback: function(data)
|
701
|
+
{
|
702
|
+
if(data.statusCode == "OK" && data.countryCode)
|
703
|
+
{
|
704
|
+
ineu = "yes";
|
705
|
+
if(jQuery.inArray(data.countryCode, cc.eumemberstates) == -1)
|
706
|
+
{
|
707
|
+
//Visitor is from outside EU
|
708
|
+
ineu = "no";
|
709
|
+
jQuery.each(cc.cookies, function(key, value) {
|
710
|
+
cc.approved[key] = "yes";
|
711
|
+
});
|
712
|
+
cc.settings.hideprivacysettingstab = true;
|
713
|
+
}
|
714
|
+
cc.setcookie('cc_ineu', ineu, 365);
|
715
|
+
}
|
716
|
+
if(data.statusCode == "ERROR" && data.statusMessage == "Invalid API key.")
|
717
|
+
{
|
718
|
+
alert(cc.strings.invalidKeyWarning)
|
719
|
+
}
|
720
|
+
cc.checkapproval();
|
721
|
+
},
|
722
|
+
|
723
|
+
checkdonottrack: function()
|
724
|
+
{
|
725
|
+
cc.checkeddonottrack = true;
|
726
|
+
if(navigator.doNotTrack == "yes" || navigator.doNotTrack == "1" || navigator.msDoNotTrack == "yes" || navigator.msDoNotTrack == "1")
|
727
|
+
{
|
728
|
+
jQuery.each(cc.cookies, function(key, value) {
|
729
|
+
cc.approved[key] = "no";
|
730
|
+
});
|
731
|
+
}
|
732
|
+
cc.checkapproval();
|
733
|
+
},
|
734
|
+
|
735
|
+
checkapproval: function()
|
736
|
+
{
|
737
|
+
if(!cc.checkedipdb && cc.settings.onlyshowwithineu)
|
738
|
+
{
|
739
|
+
cc.checkedipdb = true;
|
740
|
+
ineu = cc.getcookie('cc_ineu');
|
741
|
+
if(ineu)
|
742
|
+
{
|
743
|
+
if(ineu == "no")
|
744
|
+
{
|
745
|
+
jQuery.each(cc.cookies, function(key, value) {
|
746
|
+
cc.approved[key] = "yes";
|
747
|
+
});
|
748
|
+
cc.settings.hideprivacysettingstab = true;
|
749
|
+
}
|
750
|
+
} else {
|
751
|
+
jQuery.getScript("http://api.ipinfodb.com/v3/ip-country/?key="+cc.settings.ipinfodbkey+"&format=json&callback=cc.locationcallback");
|
752
|
+
return;
|
753
|
+
}
|
754
|
+
}
|
755
|
+
|
756
|
+
cc.allasked = true;
|
757
|
+
jQuery.each(cc.cookies, function(key, value) {
|
758
|
+
if(cc.approved[key])
|
759
|
+
{
|
760
|
+
if(cc.approved[key] == "yes" || (cc.approved[key] == "always" && cc.checkedremote))
|
761
|
+
{
|
762
|
+
cc.cookies[key].asked = true;
|
763
|
+
cc.cookies[key].approved = true;
|
764
|
+
cc.execute(key);
|
765
|
+
} else if((cc.approved[key] == "never" && cc.checkedremote) || cc.approved[key] == "no")
|
766
|
+
{
|
767
|
+
cc.cookies[key].asked = true;
|
768
|
+
cc.cookies[key].approved = false;
|
769
|
+
} else {
|
770
|
+
|
771
|
+
cc.allasked = false;
|
772
|
+
}
|
773
|
+
} else {
|
774
|
+
|
775
|
+
cc.allasked = false;
|
776
|
+
}
|
777
|
+
});
|
778
|
+
|
779
|
+
if(!cc.allasked)
|
780
|
+
{
|
781
|
+
if(!cc.checkedlocal)
|
782
|
+
{
|
783
|
+
cc.checklocal();
|
784
|
+
return;
|
785
|
+
}
|
786
|
+
if(!cc.checkedremote && !cc.settings.disableallsites)
|
787
|
+
{
|
788
|
+
cc.fetchprefs();
|
789
|
+
return;
|
790
|
+
}
|
791
|
+
if(!cc.checkeddonottrack)
|
792
|
+
{
|
793
|
+
cc.checkdonottrack();
|
794
|
+
return;
|
795
|
+
}
|
796
|
+
if(cc.settings.consenttype == "implicit")
|
797
|
+
{
|
798
|
+
jQuery.each(cc.cookies, function(key, value) {
|
799
|
+
if(!cc.cookies[key].asked)
|
800
|
+
{
|
801
|
+
if(cc.settings.onlyshowbanneronce)
|
802
|
+
{
|
803
|
+
cc.setcookie('cc_'+key, 'yes', 365);
|
804
|
+
}
|
805
|
+
cc.execute(key);
|
806
|
+
}
|
807
|
+
});
|
808
|
+
}
|
809
|
+
cc.showbanner();
|
810
|
+
} else {
|
811
|
+
if(cc.settings.collectStatistics)
|
812
|
+
{
|
813
|
+
params = "";
|
814
|
+
params += "?s=1&n=1&" + cc.calculatestatsparams();
|
815
|
+
cc.insertscript(cc.settings.serveraddr+params);
|
816
|
+
}
|
817
|
+
cc.showminiconsent();
|
818
|
+
}
|
819
|
+
},
|
820
|
+
|
821
|
+
execute: function(cookieType)
|
822
|
+
{
|
823
|
+
if(cookieType == "necessary")
|
824
|
+
{
|
825
|
+
return;
|
826
|
+
}
|
827
|
+
if(cc.cookies[cookieType].executed)
|
828
|
+
{
|
829
|
+
return;
|
830
|
+
}
|
831
|
+
jQuery('.cc-placeholder-'+cookieType).remove();
|
832
|
+
jQuery('script.cc-onconsent-'+cookieType+'[type="text/plain"]').each(function(){
|
833
|
+
if(jQuery(this).attr('src'))
|
834
|
+
{
|
835
|
+
jQuery(this).after('<script type="text/javascript" src="'+jQuery(this).attr('src')+'"></script>');
|
836
|
+
} else {
|
837
|
+
jQuery(this).after('<script type="text/javascript">'+jQuery(this).html()+'</script>');
|
838
|
+
}
|
839
|
+
});
|
840
|
+
cc.cookies[cookieType].executed = true;
|
841
|
+
jQuery(document).trigger("cc_"+cookieType);
|
842
|
+
|
843
|
+
cc.executescriptinclusion(cookieType);
|
844
|
+
|
845
|
+
},
|
846
|
+
|
847
|
+
executescriptinclusion: function(cookieType)
|
848
|
+
{
|
849
|
+
timetaken = jQuery('script.cc-onconsent-inline-'+cookieType+'[type="text/plain"]').size() * cc.settings.scriptdelay;
|
850
|
+
now = new Date().getTime();
|
851
|
+
|
852
|
+
if(now < cc.executionblock)
|
853
|
+
{
|
854
|
+
setTimeout(cc.executescriptinclusion, cc.executionblock - now, [cookieType]);
|
855
|
+
return;
|
856
|
+
}
|
857
|
+
cc.executionblock = now + timetaken;
|
858
|
+
|
859
|
+
cc.insertscripts(cookieType);
|
860
|
+
},
|
861
|
+
|
862
|
+
insertscripts: function(cookieType)
|
863
|
+
{
|
864
|
+
|
865
|
+
jQuery('script.cc-onconsent-inline-'+cookieType+'[type="text/plain"]').first().each(function(){
|
866
|
+
cc.uniqelemid++;
|
867
|
+
if(jQuery(this).parents('body').size() > 0)
|
868
|
+
{
|
869
|
+
jQuery(this).after('<div id="cc-consentarea-'+cc.uniqelemid+'" class="'+cookieType+'"></div>');
|
870
|
+
document.write = function(g){ jQuery('#cc-consentarea-'+cc.uniqelemid).append(g); };
|
871
|
+
document.writeln = function(g){ jQuery('#cc-consentarea-'+cc.uniqelemid).append(g); };
|
872
|
+
}
|
873
|
+
|
874
|
+
if(jQuery(this).attr('src'))
|
875
|
+
{
|
876
|
+
jQuery(this).after('<script type="text/javascript" src="'+jQuery(this).attr('src')+'"></script>');
|
877
|
+
} else {
|
878
|
+
jQuery(this).after('<script type="text/javascript">'+jQuery(this).html()+'</script>');
|
879
|
+
}
|
880
|
+
jQuery(this).remove();
|
881
|
+
|
882
|
+
});
|
883
|
+
|
884
|
+
if(jQuery('script.cc-onconsent-inline-'+cookieType+'[type="text/plain"]').size() > 0)
|
885
|
+
{
|
886
|
+
setTimeout(cc.insertscripts, cc.settings.scriptdelay, [cookieType]);
|
887
|
+
}
|
888
|
+
},
|
889
|
+
|
890
|
+
getcookie: function(c_name)
|
891
|
+
{
|
892
|
+
var i,x,y,ARRcookies=document.cookie.split(";");
|
893
|
+
for (i=0;i<ARRcookies.length;i++)
|
894
|
+
{
|
895
|
+
x=ARRcookies[i].substr(0,ARRcookies[i].indexOf("="));
|
896
|
+
y=ARRcookies[i].substr(ARRcookies[i].indexOf("=")+1);
|
897
|
+
x=x.replace(/^\s+|\s+$/g,"");
|
898
|
+
if (x==c_name)
|
899
|
+
{
|
900
|
+
return unescape(y);
|
901
|
+
}
|
902
|
+
}
|
903
|
+
return false;
|
904
|
+
},
|
905
|
+
|
906
|
+
setcookie: function (name, value, expirydays)
|
907
|
+
{
|
908
|
+
var exdate = new Date();
|
909
|
+
exdate.setDate(exdate.getDate() + expirydays);
|
910
|
+
document.cookie = name+'='+value+'; expires='+exdate.toUTCString()+'; path=/'
|
911
|
+
},
|
912
|
+
|
913
|
+
onremoteconsentgiven: function ()
|
914
|
+
{
|
915
|
+
if(cc.settings.clickAnyLinkToConsent)
|
916
|
+
{
|
917
|
+
jQuery("a").filter(':not(.cc-link)').unbind("click");
|
918
|
+
}
|
919
|
+
cc.allagree = true;
|
920
|
+
jQuery.each(cc.cookies, function(key, value) {
|
921
|
+
if(!value.approved && !value.asked)
|
922
|
+
{
|
923
|
+
if(jQuery('#cc-checkbox-'+key).is(':checked'))
|
924
|
+
{
|
925
|
+
if(key == "social" || key == "analytics" || key == "advertising")
|
926
|
+
{
|
927
|
+
cc.remoteCookies[key] = "always";
|
928
|
+
cc.approved[key] = "always";
|
929
|
+
} else {
|
930
|
+
cc.approved[key] = "yes";
|
931
|
+
}
|
932
|
+
cc.cookies[key].asked = true;
|
933
|
+
} else {
|
934
|
+
if(key == "social" || key == "analytics" || key == "advertising")
|
935
|
+
{
|
936
|
+
cc.remoteCookies[key] = "never";
|
937
|
+
cc.approved[key] = "never";
|
938
|
+
} else {
|
939
|
+
cc.approved[key] = "no";
|
940
|
+
}
|
941
|
+
cc.allagree = false;
|
942
|
+
cc.cookies[key].asked = true;
|
943
|
+
}
|
944
|
+
cc.setcookie('cc_'+key, cc.approved[key], 365);
|
945
|
+
} else {
|
946
|
+
}
|
947
|
+
});
|
948
|
+
urlx = cc.settings.serveraddr+'?p=1&tokenonly=true&cc-key='+cc.sessionkey;
|
949
|
+
if(cc.remoteCookies['social'])
|
950
|
+
{
|
951
|
+
urlx += '&cc-cookies-social='+cc.approved['social'];
|
952
|
+
}
|
953
|
+
if(cc.remoteCookies['analytics'])
|
954
|
+
{
|
955
|
+
urlx += '&cc-cookies-analytics='+cc.approved['analytics'];
|
956
|
+
}
|
957
|
+
if(cc.remoteCookies['advertising'])
|
958
|
+
{
|
959
|
+
urlx += '&cc-cookies-advertising='+cc.approved['advertising'];
|
960
|
+
}
|
961
|
+
cc.reloadkey = true;
|
962
|
+
cc.insertscript(urlx);
|
963
|
+
|
964
|
+
if(!cc.ismobile)
|
965
|
+
{
|
966
|
+
jQuery('#cc-notification').slideUp();
|
967
|
+
if(cc.settings.bannerPosition == "cc-push")
|
968
|
+
{
|
969
|
+
//detect body margin
|
970
|
+
jQuery('html').animate({marginTop: 0}, 400);
|
971
|
+
}
|
972
|
+
}
|
973
|
+
cc.checkapproval();
|
974
|
+
|
975
|
+
return false;
|
976
|
+
},
|
977
|
+
|
978
|
+
onlocalconsentgiven: function ()
|
979
|
+
{
|
980
|
+
enableall = false;
|
981
|
+
enablejustone = false;
|
982
|
+
if(jQuery(this).hasClass('cc-button-enableall') || jQuery(this).hasClass('cc-button-enable-all'))
|
983
|
+
{
|
984
|
+
enableall = true;
|
985
|
+
jQuery.each(cc.cookies, function(key, value) {
|
986
|
+
cc.cookies[key].asked = false;
|
987
|
+
});
|
988
|
+
}
|
989
|
+
elem = this;
|
990
|
+
jQuery.each(cc.cookies, function(key, value) {
|
991
|
+
if(jQuery(elem).hasClass('cc-button-enable-'+key))
|
992
|
+
{
|
993
|
+
enablejustone = true;
|
994
|
+
cc.approved[key] = "yes";
|
995
|
+
cc.cookies[key].asked = true;
|
996
|
+
cc.setcookie('cc_'+key, cc.approved[key], 365);
|
997
|
+
}
|
998
|
+
});
|
999
|
+
|
1000
|
+
cc.allagree = true;
|
1001
|
+
if(!enablejustone)
|
1002
|
+
{
|
1003
|
+
if(cc.settings.clickAnyLinkToConsent)
|
1004
|
+
{
|
1005
|
+
jQuery("a").filter(':not(.cc-link)').unbind("click");
|
1006
|
+
}
|
1007
|
+
jQuery.each(cc.cookies, function(key, value) {
|
1008
|
+
if(!value.approved && !value.asked)
|
1009
|
+
{
|
1010
|
+
if(enableall || jQuery('#cc-checkbox-'+key).is(':checked'))
|
1011
|
+
{
|
1012
|
+
cc.approved[key] = "yes";
|
1013
|
+
cc.cookies[key].asked = true;
|
1014
|
+
} else {
|
1015
|
+
cc.approved[key] = "no";
|
1016
|
+
cc.cookies[key].asked = true;
|
1017
|
+
cc.allagree = false;
|
1018
|
+
}
|
1019
|
+
cc.setcookie('cc_'+key, cc.approved[key], 365);
|
1020
|
+
} else {
|
1021
|
+
}
|
1022
|
+
});
|
1023
|
+
}
|
1024
|
+
if(!cc.allagree && cc.settings.consenttype == "implicit")
|
1025
|
+
{
|
1026
|
+
cc.forcereload = true;
|
1027
|
+
}
|
1028
|
+
|
1029
|
+
if(!cc.ismobile)
|
1030
|
+
{
|
1031
|
+
jQuery('#cc-notification').slideUp();
|
1032
|
+
if(cc.settings.bannerPosition == "cc-push")
|
1033
|
+
{
|
1034
|
+
//detect body margin
|
1035
|
+
jQuery('html').animate({marginTop: 0}, 400);
|
1036
|
+
}
|
1037
|
+
}
|
1038
|
+
cc.checkapproval();
|
1039
|
+
cc.reloadifnecessary();
|
1040
|
+
|
1041
|
+
return false;
|
1042
|
+
},
|
1043
|
+
|
1044
|
+
showminiconsent: function()
|
1045
|
+
{
|
1046
|
+
if(jQuery('#cc-tag').length == 0)
|
1047
|
+
{
|
1048
|
+
data = '<div id="cc-tag" class="cc-tag-'+cc.settings.tagPosition+'"><a class="cc-link" href="#" id="cc-tag-button" title="'+cc.strings.privacySettings+'"><span>'+cc.strings.privacySettings+'</span></a></div>';
|
1049
|
+
jQuery('body').prepend(data);
|
1050
|
+
jQuery('#cc-tag').addClass(cc.settings.style);
|
1051
|
+
if(!cc.settings.hideprivacysettingstab)
|
1052
|
+
{
|
1053
|
+
jQuery('#cc-tag').fadeIn();
|
1054
|
+
} else {
|
1055
|
+
jQuery('#cc-tag').hide();
|
1056
|
+
}
|
1057
|
+
jQuery('.cc-privacy-link').click(cc.showmodal);
|
1058
|
+
jQuery('#cc-tag-button').click(cc.showmodal);
|
1059
|
+
}
|
1060
|
+
},
|
1061
|
+
|
1062
|
+
getsize: function(obj)
|
1063
|
+
{
|
1064
|
+
var size = 0, key;
|
1065
|
+
for (key in obj) {
|
1066
|
+
if (obj.hasOwnProperty(key)) size++;
|
1067
|
+
}
|
1068
|
+
return size;
|
1069
|
+
},
|
1070
|
+
|
1071
|
+
settoken: function(data)
|
1072
|
+
{
|
1073
|
+
if(cc.reloadkey)
|
1074
|
+
{
|
1075
|
+
cc.reloadkey = false;
|
1076
|
+
if(!cc.allagree && cc.settings.consenttype == "implicit")
|
1077
|
+
{
|
1078
|
+
cc.forcereload = true;
|
1079
|
+
}
|
1080
|
+
cc.reloadifnecessary();
|
1081
|
+
}
|
1082
|
+
cc.sessionkey = data;
|
1083
|
+
},
|
1084
|
+
|
1085
|
+
showmodal: function()
|
1086
|
+
{
|
1087
|
+
if(!cc.checkedremote && !cc.settings.disableallsites)
|
1088
|
+
{
|
1089
|
+
cc.fetchprefs();
|
1090
|
+
}
|
1091
|
+
jQuery(document).bind('keyup', cc.onkeyup);
|
1092
|
+
jQuery('body').prepend('<div id="cc-modal-overlay"></div>');
|
1093
|
+
jQuery(this).blur();
|
1094
|
+
if(cc.ismobile)
|
1095
|
+
{
|
1096
|
+
cc.setupformobile();
|
1097
|
+
}
|
1098
|
+
data = '<div id="cc-modal">' +
|
1099
|
+
'<div id="cc-modal-wrapper">' +
|
1100
|
+
'<h2>'+cc.strings.privacySettingsDialogTitleA+' <span>'+cc.strings.privacySettingsDialogTitleB+'</span></h2>' +
|
1101
|
+
'<p class="cc-subtitle">'+cc.strings.privacySettingsDialogSubtitle+'</p>' +
|
1102
|
+
|
1103
|
+
'<div class="cc-content">' +
|
1104
|
+
'</div>' +
|
1105
|
+
|
1106
|
+
'<div class="cc-clear"></div>' +
|
1107
|
+
|
1108
|
+
'<p id="cc-modal-closebutton" class="cc-modal-closebutton"><a class="cc-link" href="#" title="'+cc.strings.closeWindow+'"><span>'+cc.strings.closeWindow+'</span></a></p>' +
|
1109
|
+
'<div id="cc-modal-footer-buttons">' +
|
1110
|
+
|
1111
|
+
'<p id="cc-modal-global"><a class="cc-link" href="#" title="'+cc.strings.changeForAllSitesLink+'"><span>'+cc.strings.changeForAllSitesLink+'</span></a></p></div>' +
|
1112
|
+
'<a id="cc-notification-logo" class="cc-logo" target="_blank" href="http://silktide.com/cookieconsent" title="'+cc.strings.poweredBy+'"><span>'+cc.strings.poweredBy+'</span></a> ' +
|
1113
|
+
'<div class="cc-clear"></div>' +
|
1114
|
+
'</div>' +
|
1115
|
+
'</div>';
|
1116
|
+
jQuery('body').prepend(data);
|
1117
|
+
if(cc.settings.disableallsites)
|
1118
|
+
{
|
1119
|
+
jQuery('#cc-modal-global').hide();
|
1120
|
+
}
|
1121
|
+
jQuery('#cc-modal').addClass(cc.settings.style).click(cc.closemodals);
|
1122
|
+
if(cc.ismobile)
|
1123
|
+
{
|
1124
|
+
jQuery('#cc-modal').addClass("cc-mobile");
|
1125
|
+
}
|
1126
|
+
cc.reloadmodal();
|
1127
|
+
jQuery('#cc-modal').fadeIn();
|
1128
|
+
jQuery('#cc-modal-overlay').fadeIn();
|
1129
|
+
jQuery('#cc-modal-wrapper').click(function(){
|
1130
|
+
cc.noclosewin = true;
|
1131
|
+
});
|
1132
|
+
jQuery('#cc-modal .cc-modal-closebutton a').click(function()
|
1133
|
+
{
|
1134
|
+
cc.showhidemodal();
|
1135
|
+
cc.reloadifnecessary();
|
1136
|
+
return false;
|
1137
|
+
});
|
1138
|
+
jQuery('#cc-modal-global').click(function()
|
1139
|
+
{
|
1140
|
+
cc.frommodal = true;
|
1141
|
+
cc.gotosettings();
|
1142
|
+
return false;
|
1143
|
+
});
|
1144
|
+
jQuery('#cc-tag-button').unbind('click').click(cc.showhidemodal);
|
1145
|
+
jQuery('.cc-privacy-link').unbind('click').click(cc.showhidemodal);
|
1146
|
+
|
1147
|
+
return false;
|
1148
|
+
},
|
1149
|
+
|
1150
|
+
closepreferencesmodal: function()
|
1151
|
+
{
|
1152
|
+
jQuery.each(cc.defaultCookies, function(key, value) {
|
1153
|
+
value = jQuery('#cc-globalpreference-selector-'+key).val();
|
1154
|
+
if(cc.approved[key] != "yes" && cc.approved[key] != "no")
|
1155
|
+
{
|
1156
|
+
cc.approved[key] = value;
|
1157
|
+
cc.setcookie('cc_'+key, cc.approved[key], 365);
|
1158
|
+
}
|
1159
|
+
cc.remoteCookies[key] = value;
|
1160
|
+
|
1161
|
+
});
|
1162
|
+
urlx = cc.settings.serveraddr+'?p=1&tokenonly=true&cc-key='+cc.sessionkey;
|
1163
|
+
if(cc.remoteCookies['social'])
|
1164
|
+
{
|
1165
|
+
urlx += '&cc-cookies-social='+cc.remoteCookies['social'];
|
1166
|
+
}
|
1167
|
+
if(cc.remoteCookies['analytics'])
|
1168
|
+
{
|
1169
|
+
urlx += '&cc-cookies-analytics='+cc.remoteCookies['analytics'];
|
1170
|
+
}
|
1171
|
+
if(cc.remoteCookies['advertising'])
|
1172
|
+
{
|
1173
|
+
urlx += '&cc-cookies-advertising='+cc.remoteCookies['advertising'];
|
1174
|
+
}
|
1175
|
+
|
1176
|
+
cc.insertscript(urlx);
|
1177
|
+
|
1178
|
+
jQuery('#cc-notification').hide().remove();
|
1179
|
+
jQuery(this).blur();
|
1180
|
+
jQuery('#cc-settingsmodal').fadeOut(null, function()
|
1181
|
+
{
|
1182
|
+
jQuery('#cc-settingsmodal').remove();
|
1183
|
+
});
|
1184
|
+
if(!cc.frommodal)
|
1185
|
+
{
|
1186
|
+
cc.checkapproval();
|
1187
|
+
cc.reloadifnecessary();
|
1188
|
+
} else {
|
1189
|
+
cc.frommodal = false;
|
1190
|
+
cc.showhidemodal();
|
1191
|
+
}
|
1192
|
+
return false;
|
1193
|
+
},
|
1194
|
+
|
1195
|
+
showhidemodal: function()
|
1196
|
+
{
|
1197
|
+
jQuery(this).blur();
|
1198
|
+
cc.checkedlocal = false;
|
1199
|
+
cc.checkedremote = false;
|
1200
|
+
if(jQuery('#cc-modal').is(":visible") && !cc.frommodal)
|
1201
|
+
{
|
1202
|
+
cc.closingmodal = true;
|
1203
|
+
jQuery('#cc-modal-overlay').fadeToggle(null, function(){
|
1204
|
+
cc.closingmodal = false;
|
1205
|
+
});
|
1206
|
+
jQuery.each(cc.cookies, function(key, value) {
|
1207
|
+
thisval = jQuery('#cc-preference-selector-'+key).val();
|
1208
|
+
|
1209
|
+
if(key == "necessary")
|
1210
|
+
{
|
1211
|
+
thisval = "yes";
|
1212
|
+
}
|
1213
|
+
|
1214
|
+
if(thisval == "no")
|
1215
|
+
{
|
1216
|
+
cc.cookies[key].approved = false;
|
1217
|
+
cc.approved[key] = "no";
|
1218
|
+
cc.setcookie('cc_'+key, cc.approved[key], 365);
|
1219
|
+
} else if(thisval == "yes") {
|
1220
|
+
cc.cookies[key].approved = true;
|
1221
|
+
cc.approved[key] = "yes";
|
1222
|
+
cc.setcookie('cc_'+key, cc.approved[key], 365);
|
1223
|
+
} else {
|
1224
|
+
cc.cookies[key].approved = false;
|
1225
|
+
cc.deletecookie(key);
|
1226
|
+
delete cc.approved[key];
|
1227
|
+
}
|
1228
|
+
cc.cookies[key].asked = false;
|
1229
|
+
|
1230
|
+
});
|
1231
|
+
cc.checkapproval();
|
1232
|
+
} else if(!jQuery('#cc-settingsmodal').is(":visible") && !jQuery('#cc-modal').is(":visible"))
|
1233
|
+
{
|
1234
|
+
cc.closingmodal = true;
|
1235
|
+
jQuery('#cc-modal-overlay').fadeToggle(null, function(){
|
1236
|
+
cc.closingmodal = false;
|
1237
|
+
});
|
1238
|
+
}
|
1239
|
+
if(cc.ismobile)
|
1240
|
+
{
|
1241
|
+
jQuery('#cc-modal').toggle();
|
1242
|
+
} else {
|
1243
|
+
jQuery('#cc-modal').fadeToggle();
|
1244
|
+
}
|
1245
|
+
return false;
|
1246
|
+
},
|
1247
|
+
|
1248
|
+
|
1249
|
+
reloadmodal: function()
|
1250
|
+
{
|
1251
|
+
jQuery('#cc-modal-wrapper .cc-content').html('');
|
1252
|
+
if(cc.getsize(cc.cookies) > 0)
|
1253
|
+
{
|
1254
|
+
jQuery('#cc-modal-wrapper .cc-content').append('<ul></ul>');
|
1255
|
+
jQuery.each(cc.cookies, function(key, value) {
|
1256
|
+
|
1257
|
+
jQuery('#cc-modal-wrapper ul').append('<li id="cc-preference-element-'+key+'"><label for="cc-preference-selector-'+key+'"><strong>'+value.title+'</strong><span>'+value.description+'</span></label><select id="cc-preference-selector-'+key+'"><option value="yes">'+cc.strings.preferenceConsent+'</option><option value="no">'+cc.strings.preferenceDecline+'</option></select></li>');
|
1258
|
+
if(value.link)
|
1259
|
+
{
|
1260
|
+
jQuery('#cc-preference-element-'+key+' label span').append(' <a target="_blank" href="'+value.link+'" class="cc-learnmore-link">'+cc.strings.learnMore+'</a>');
|
1261
|
+
}
|
1262
|
+
if((key == "social" || key == "advertising" || key == "analytics") && !cc.settings.disableallsites)
|
1263
|
+
{
|
1264
|
+
jQuery('#cc-preference-selector-'+key).append('<option value="global">'+cc.strings.preferenceUseGlobal+'</option>');
|
1265
|
+
}
|
1266
|
+
jQuery('#cc-change-button-allsites').unbind('click').click(function(){
|
1267
|
+
cc.frommodal = true;
|
1268
|
+
cc.gotosettings();
|
1269
|
+
return false;
|
1270
|
+
});
|
1271
|
+
jQuery('#cc-preference-selector-'+key).change(function(){
|
1272
|
+
|
1273
|
+
});
|
1274
|
+
if(key == "necessary")
|
1275
|
+
{
|
1276
|
+
jQuery('#cc-preference-selector-'+key).remove();
|
1277
|
+
}
|
1278
|
+
if(cc.approved[key] == "yes")
|
1279
|
+
{
|
1280
|
+
jQuery('#cc-preference-selector-'+key).val("yes")
|
1281
|
+
}
|
1282
|
+
else if(cc.approved[key] == "no")
|
1283
|
+
{
|
1284
|
+
jQuery('#cc-preference-selector-'+key).val("no")
|
1285
|
+
}
|
1286
|
+
else
|
1287
|
+
{
|
1288
|
+
jQuery('#cc-preference-selector-'+key).val("global")
|
1289
|
+
}
|
1290
|
+
|
1291
|
+
});
|
1292
|
+
} else {
|
1293
|
+
jQuery('#cc-modal-wrapper .cc-content').append('<p>'+cc.strings.notUsingCookies+'</p>');
|
1294
|
+
}
|
1295
|
+
jQuery('.cc-content').append('<div class="cc-clear"></div>');
|
1296
|
+
},
|
1297
|
+
|
1298
|
+
reloadsettingsmodal: function()
|
1299
|
+
{
|
1300
|
+
jQuery('#cc-settingsmodal-wrapper .cc-content').html('');
|
1301
|
+
if(cc.getsize(cc.defaultCookies) > 0)
|
1302
|
+
{
|
1303
|
+
jQuery('#cc-settingsmodal-wrapper .cc-content').append('<ul></ul>');
|
1304
|
+
jQuery.each(cc.defaultCookies, function(key, value) {
|
1305
|
+
|
1306
|
+
jQuery('#cc-settingsmodal-wrapper ul').append('<li id="cc-globalpreference-element-'+key+'"><label for="cc-globalpreference-selector-'+key+'"><strong>'+value.title+'</strong><span>'+value.description+'</span></label><select id="cc-globalpreference-selector-'+key+'"><option value="ask">'+cc.strings.preferenceAsk+'</option><option value="always">'+cc.strings.preferenceAlways+'</option><option value="never">'+cc.strings.preferenceNever+'</option></select></li>');
|
1307
|
+
if(value.link)
|
1308
|
+
{
|
1309
|
+
jQuery('#cc-globalpreference-element-'+key+' label span').append(' <a target="_blank" href="'+value.link+'" class="cc-learnmore-link">'+cc.strings.learnMore+'</a>');
|
1310
|
+
}
|
1311
|
+
jQuery('#cc-globalpreference-selector-'+key).change(function(){
|
1312
|
+
|
1313
|
+
});
|
1314
|
+
if(cc.remoteCookies[key] == "always")
|
1315
|
+
{
|
1316
|
+
jQuery('#cc-globalpreference-selector-'+key).val("always")
|
1317
|
+
}
|
1318
|
+
else if(cc.remoteCookies[key] == "never")
|
1319
|
+
{
|
1320
|
+
jQuery('#cc-globalpreference-selector-'+key).val("never")
|
1321
|
+
}
|
1322
|
+
else
|
1323
|
+
{
|
1324
|
+
jQuery('#cc-globalpreference-selector-'+key).val("ask")
|
1325
|
+
}
|
1326
|
+
|
1327
|
+
});
|
1328
|
+
} else {
|
1329
|
+
jQuery('#cc-settingsmodal-wrapper .cc-content').append('<p>'+cc.strings.notUsingCookies+'</p>');
|
1330
|
+
}
|
1331
|
+
jQuery('#cc-settingsmodal-wrapper .cc-content').append('<div class="cc-clear"></div>');
|
1332
|
+
},
|
1333
|
+
|
1334
|
+
approvedeny: function() {
|
1335
|
+
key = jQuery(this).attr("id").split("-")[2];
|
1336
|
+
if(cc.cookies[key].approved)
|
1337
|
+
{
|
1338
|
+
cc.cookies[key].approved = false;
|
1339
|
+
cc.approved[key] = "no";
|
1340
|
+
} else {
|
1341
|
+
cc.cookies[key].approved = true;
|
1342
|
+
cc.approved[key] = "yes";
|
1343
|
+
}
|
1344
|
+
cc.setcookie('cc_'+key, cc.approved[key], 365);
|
1345
|
+
cc.checkapproval();
|
1346
|
+
cc.reloadmodal();
|
1347
|
+
return false;
|
1348
|
+
},
|
1349
|
+
|
1350
|
+
clearalllocalcookies: function() {
|
1351
|
+
var cookies = document.cookie.split(";");
|
1352
|
+
|
1353
|
+
for (var i = 0; i < cookies.length; i++) {
|
1354
|
+
var cookie = cookies[i];
|
1355
|
+
var eqPos = cookie.indexOf("=");
|
1356
|
+
var name = eqPos > -1 ? cookie.substr(0, eqPos) : cookie;
|
1357
|
+
document.cookie = name + "=;expires=Thu, 01 Jan 1970 00:00:00 GMT";
|
1358
|
+
}
|
1359
|
+
},
|
1360
|
+
|
1361
|
+
clearlocal: function()
|
1362
|
+
{
|
1363
|
+
cc.clearalllocalcookies();
|
1364
|
+
jQuery(this).before('<p>'+cc.strings.clearedCookies+'</p>')
|
1365
|
+
},
|
1366
|
+
|
1367
|
+
getcurrenturl: function()
|
1368
|
+
{
|
1369
|
+
return window.location.protocol + "//" + window.location.host + window.location.pathname;
|
1370
|
+
},
|
1371
|
+
|
1372
|
+
gotosettings: function()
|
1373
|
+
{
|
1374
|
+
if(jQuery('#cc-modal').is(":visible"))
|
1375
|
+
{
|
1376
|
+
cc.showhidemodal();
|
1377
|
+
}
|
1378
|
+
jQuery(this).blur();
|
1379
|
+
if(cc.ismobile)
|
1380
|
+
{
|
1381
|
+
cc.setupformobile();
|
1382
|
+
jQuery('#cc-notification').remove();
|
1383
|
+
}
|
1384
|
+
if(cc.frommodal)
|
1385
|
+
{
|
1386
|
+
buttontext = cc.strings.backToSiteSettings;
|
1387
|
+
} else {
|
1388
|
+
buttontext = cc.strings.closeWindow;
|
1389
|
+
}
|
1390
|
+
|
1391
|
+
data = '<div id="cc-settingsmodal">' +
|
1392
|
+
'<div id="cc-settingsmodal-wrapper">' +
|
1393
|
+
'<h2>'+cc.strings.allSitesSettingsDialogTitleA+' <span>'+cc.strings.allSitesSettingsDialogTitleB+'</span></h2>' +
|
1394
|
+
'<p class="cc-subtitle">'+cc.strings.allSitesSettingsDialogSubtitle+'</p>' +
|
1395
|
+
'<div class="cc-content">' +
|
1396
|
+
'</div>' +
|
1397
|
+
'<div class="cc-clear"></div>' +
|
1398
|
+
'<p id="cc-settingsmodal-closebutton" class="cc-settingsmodal-closebutton"><a class="cc-link" href="#" title="'+buttontext+'"><span>'+buttontext+'</span></a></p>' +
|
1399
|
+
'<div id="cc-settingsmodal-footer-buttons">' +
|
1400
|
+
'<p id="cc-settingsmodal-secondclosebutton" class="cc-settingsmodal-closebutton"><a class="cc-link" href="#" title="'+buttontext+'"><span>'+buttontext+'</span></a></p>' +
|
1401
|
+
'</div>' +
|
1402
|
+
'<a id="cc-notification-logo" class="cc-logo" target="_blank" href="http://silktide.com/cookieconsent" title="'+cc.strings.poweredBy+'"><span>'+cc.strings.poweredBy+'</span></a> ' +
|
1403
|
+
'</div>' +
|
1404
|
+
'</div>';
|
1405
|
+
jQuery('body').prepend(data);
|
1406
|
+
cc.reloadsettingsmodal();
|
1407
|
+
jQuery('#cc-settingsmodal').addClass(cc.settings.style).click(cc.closemodals);
|
1408
|
+
jQuery('#cc-settingsmodal-wrapper').click(function(){
|
1409
|
+
cc.noclosewin = true;
|
1410
|
+
});
|
1411
|
+
if(cc.ismobile)
|
1412
|
+
{
|
1413
|
+
jQuery('#cc-settingsmodal').addClass("cc-mobile");
|
1414
|
+
}
|
1415
|
+
jQuery('#cc-settingsmodal').fadeIn();
|
1416
|
+
jQuery('.cc-settingsmodal-closebutton').click(cc.closepreferencesmodal);
|
1417
|
+
|
1418
|
+
return false;
|
1419
|
+
},
|
1420
|
+
|
1421
|
+
setupformobile: function()
|
1422
|
+
{
|
1423
|
+
if(!cc.hassetupmobile)
|
1424
|
+
{
|
1425
|
+
cc.hassetupmobile = true;
|
1426
|
+
jQuery('head').append('<meta name="viewport" content="width=device-width; initial-scale=1.0; maximum-scale=1.0;">');
|
1427
|
+
if(cc.settings.style == 'cc-light')
|
1428
|
+
{
|
1429
|
+
bgcol = '#e1e1e1';
|
1430
|
+
} else {
|
1431
|
+
bgcol = '#1d1d1d'
|
1432
|
+
}
|
1433
|
+
jQuery('body').html('').css("margin", 0).css('width', 'auto').css("backgroundColor", bgcol).css("backgroundImage", 'none');
|
1434
|
+
}
|
1435
|
+
},
|
1436
|
+
|
1437
|
+
onfirstload: function()
|
1438
|
+
{
|
1439
|
+
if(!cc.setupcomplete && cc.initobj)
|
1440
|
+
{
|
1441
|
+
if(!(window.jQuery))
|
1442
|
+
{
|
1443
|
+
cc.jqueryattempts++;
|
1444
|
+
if(cc.jqueryattempts >= 5)
|
1445
|
+
{
|
1446
|
+
return;
|
1447
|
+
}
|
1448
|
+
setTimeout(cc.onfirstload, 200);
|
1449
|
+
return;
|
1450
|
+
}
|
1451
|
+
cc.setupcomplete = true;
|
1452
|
+
cc.setup();
|
1453
|
+
}
|
1454
|
+
setTimeout(cc.afterload, 50);
|
1455
|
+
cc.checkapproval();
|
1456
|
+
},
|
1457
|
+
|
1458
|
+
afterload: function()
|
1459
|
+
{
|
1460
|
+
jQuery('.cc-button-enableall').addClass('cc-link').click(cc.onlocalconsentgiven);
|
1461
|
+
jQuery('.cc-button-enable-all').addClass('cc-link').click(cc.onlocalconsentgiven);
|
1462
|
+
jQuery.each(cc.cookies, function(key, value) {
|
1463
|
+
jQuery('.cc-button-enable-'+key).addClass('cc-link').click(cc.onlocalconsentgiven);
|
1464
|
+
});
|
1465
|
+
}
|
1466
|
+
}
|
1467
|
+
|
1468
|
+
if(!(window.jQuery)) {
|
1469
|
+
var s = document.createElement('script');
|
1470
|
+
s.setAttribute('src', 'https://ajax.googleapis.com/ajax/libs/jquery/1.7.2/jquery.min.js');
|
1471
|
+
s.setAttribute('type', 'text/javascript');
|
1472
|
+
document.getElementsByTagName('head')[0].appendChild(s);
|
1473
|
+
if ( window.onload != null ) {
|
1474
|
+
var oldOnload = window.onload;
|
1475
|
+
window.onload = function (e) {
|
1476
|
+
oldOnload(e);
|
1477
|
+
cc.onfirstload();
|
1478
|
+
};
|
1479
|
+
}
|
1480
|
+
else
|
1481
|
+
{
|
1482
|
+
window.onload = cc.onfirstload;
|
1483
|
+
}
|
1484
|
+
} else {
|
1485
|
+
jQuery(document).ready(cc.onfirstload);
|
1486
|
+
}
|
1487
|
+
|
1488
|
+
/**
|
1489
|
+
* jQuery.browser.mobile (http://detectmobilebrowser.com/)
|
1490
|
+
*
|
1491
|
+
* jQuery.browser.mobile will be true if the browser is a mobile device - modified so that cc.ismobile is true
|
1492
|
+
*
|
1493
|
+
**/
|
1494
|
+
(function(a){
|
1495
|
+
cc.ismobile=/android.+mobile|avantgo|bada\/|blackberry|blazer|compal|elaine|fennec|hiptop|iemobile|ip(hone|od)|iris|kindle|lge |maemo|midp|mmp|netfront|opera m(ob|in)i|palm( os)?|phone|p(ixi|re)\/|plucker|pocket|psp|symbian|treo|up\.(browser|link)|vodafone|wap|windows (ce|phone)|xda|xiino/i.test(a)||/1207|6310|6590|3gso|4thp|50[1-6]i|770s|802s|a wa|abac|ac(er|oo|s\-)|ai(ko|rn)|al(av|ca|co)|amoi|an(ex|ny|yw)|aptu|ar(ch|go)|as(te|us)|attw|au(di|\-m|r |s )|avan|be(ck|ll|nq)|bi(lb|rd)|bl(ac|az)|br(e|v)w|bumb|bw\-(n|u)|c55\/|capi|ccwa|cdm\-|cell|chtm|cldc|cmd\-|co(mp|nd)|craw|da(it|ll|ng)|dbte|dc\-s|devi|dica|dmob|do(c|p)o|ds(12|\-d)|el(49|ai)|em(l2|ul)|er(ic|k0)|esl8|ez([4-7]0|os|wa|ze)|fetc|fly(\-|_)|g1 u|g560|gene|gf\-5|g\-mo|go(\.w|od)|gr(ad|un)|haie|hcit|hd\-(m|p|t)|hei\-|hi(pt|ta)|hp( i|ip)|hs\-c|ht(c(\-| |_|a|g|p|s|t)|tp)|hu(aw|tc)|i\-(20|go|ma)|i230|iac( |\-|\/)|ibro|idea|ig01|ikom|im1k|inno|ipaq|iris|ja(t|v)a|jbro|jemu|jigs|kddi|keji|kgt( |\/)|klon|kpt |kwc\-|kyo(c|k)|le(no|xi)|lg( g|\/(k|l|u)|50|54|e\-|e\/|\-[a-w])|libw|lynx|m1\-w|m3ga|m50\/|ma(te|ui|xo)|mc(01|21|ca)|m\-cr|me(di|rc|ri)|mi(o8|oa|ts)|mmef|mo(01|02|bi|de|do|t(\-| |o|v)|zz)|mt(50|p1|v )|mwbp|mywa|n10[0-2]|n20[2-3]|n30(0|2)|n50(0|2|5)|n7(0(0|1)|10)|ne((c|m)\-|on|tf|wf|wg|wt)|nok(6|i)|nzph|o2im|op(ti|wv)|oran|owg1|p800|pan(a|d|t)|pdxg|pg(13|\-([1-8]|c))|phil|pire|pl(ay|uc)|pn\-2|po(ck|rt|se)|prox|psio|pt\-g|qa\-a|qc(07|12|21|32|60|\-[2-7]|i\-)|qtek|r380|r600|raks|rim9|ro(ve|zo)|s55\/|sa(ge|ma|mm|ms|ny|va)|sc(01|h\-|oo|p\-)|sdk\/|se(c(\-|0|1)|47|mc|nd|ri)|sgh\-|shar|sie(\-|m)|sk\-0|sl(45|id)|sm(al|ar|b3|it|t5)|so(ft|ny)|sp(01|h\-|v\-|v )|sy(01|mb)|t2(18|50)|t6(00|10|18)|ta(gt|lk)|tcl\-|tdg\-|tel(i|m)|tim\-|t\-mo|to(pl|sh)|ts(70|m\-|m3|m5)|tx\-9|up(\.b|g1|si)|utst|v400|v750|veri|vi(rg|te)|vk(40|5[0-3]|\-v)|vm40|voda|vulc|vx(52|53|60|61|70|80|81|83|85|98)|w3c(\-| )|webc|whit|wi(g |nc|nw)|wmlb|wonu|x700|xda(\-|2|g)|yas\-|your|zeto|zte\-/i.test(a.substr(0,4))
|
1496
|
+
})(navigator.userAgent||navigator.vendor||window.opera);
|
1497
|
+
|
1498
|
+
|
1499
|
+
/**
|
1500
|
+
* Load web font
|
1501
|
+
*
|
1502
|
+
**/
|
1503
|
+
|
1504
|
+
|
1505
|
+
|
1506
|
+
|
1507
|
+
|
1508
|
+
|
1509
|
+
|
1510
|
+
|
1511
|
+
|
1512
|
+
|
1513
|
+
|
1514
|
+
|
1515
|
+
|