Evolution #1569 » 0001-Replace-jQuery-Cookie-with-JS-Cookie-closes-1569.patch
galette/includes/galette.inc.php | ||
---|---|---|
setcookie(
|
||
'show_galette_dashboard',
|
||
true,
|
||
time() + 31536000 //valid for a year
|
||
[
|
||
'expires' => time() + 31536000, //valid for a year
|
||
'path' => '/'
|
||
]
|
||
);
|
||
}
|
||
galette/templates/default/desktop.tpl | ||
---|---|---|
$(function() {
|
||
$('#show_dashboard').change(function(){
|
||
var _checked = $(this).is(':checked');
|
||
$.cookie(
|
||
Cookies.set(
|
||
'show_galette_dashboard',
|
||
(_checked ? 1 : 0),
|
||
{ expires: 365 }
|
||
{
|
||
expires: 365,
|
||
path: '/'
|
||
}
|
||
);
|
||
if ( !_checked ) {
|
||
var _url = '{path_for name="members"}';
|
||
... | ... | |
{if not $hide_telemetry}
|
||
$('#hide_telemetry').change(function(){
|
||
var _checked = $(this).is(':checked');
|
||
$.cookie(
|
||
Cookies.set(
|
||
'hide_galette_telemetry',
|
||
(_checked ? 1 : 0),
|
||
{ expires: 365 }
|
||
{
|
||
expires: 365,
|
||
path: '/'
|
||
}
|
||
);
|
||
var _url = '{path_for name="dashboard"}';
|
||
window.location.replace(_url);
|
galette/templates/default/telemetry.tpl | ||
---|---|---|
{/if}
|
||
{if isset($renew_telemetry)}
|
||
$('#renewbox').remove();
|
||
$.cookie(
|
||
Cookies.set(
|
||
'renew_telemetry',
|
||
1,
|
||
{ expires: 365 }
|
||
{
|
||
expires: 365,
|
||
path: '/'
|
||
}
|
||
);
|
||
{/if}
|
||
}
|
||
... | ... | |
});
|
||
{if isset($renew_telemetry)}
|
||
$('#norenew').on('click', function() {
|
||
$.cookie(
|
||
Cookies.set(
|
||
'renew_telemetry',
|
||
1,
|
||
{ expires: 365 }
|
||
{
|
||
expires: 365,
|
||
path: '/'
|
||
}
|
||
);
|
||
window.location.reload();
|
||
});
|
||
$('#renewlater').on('click', function() {
|
||
$.cookie(
|
||
Cookies.set(
|
||
'renew_telemetry',
|
||
1,
|
||
{ expires: 182 }
|
||
{
|
||
expires: 182,
|
||
path: '/'
|
||
}
|
||
);
|
||
window.location.reload();
|
||
});
|
gulpfile.js | ||
---|---|---|
'./node_modules/jquery/dist/jquery.js',
|
||
'./node_modules/jquery-ui-dist/jquery-ui.js',
|
||
'./node_modules/jquery-ui/ui/i18n/*',
|
||
'./node_modules/jquery.cookie/jquery.cookie.js',
|
||
'./node_modules/js-cookie/dist/js.cookie.min.js',
|
||
'./node_modules/microplugin/src/microplugin.js',
|
||
'./node_modules/sifter/sifter.js',
|
||
'./node_modules/selectize/dist/js/selectize.min.js',
|
package-lock.json | ||
---|---|---|
"resolved": "https://registry.npmjs.org/jquery-ui-dist/-/jquery-ui-dist-1.12.1.tgz",
|
||
"integrity": "sha1-XAgV08xvkP9fqvWyaKbiO0ypBPo="
|
||
},
|
||
"jquery.cookie": {
|
||
"version": "1.4.1",
|
||
"resolved": "https://registry.npmjs.org/jquery.cookie/-/jquery.cookie-1.4.1.tgz",
|
||
"integrity": "sha1-1j3OIJ6raR/mMxbbCMqeR+D5OFs="
|
||
"js-cookie": {
|
||
"version": "3.0.1",
|
||
"resolved": "https://registry.npmjs.org/js-cookie/-/js-cookie-3.0.1.tgz",
|
||
"integrity": "sha512-+0rgsUXZu4ncpPxRL+lNEptWMOWl9etvPHc/koSRp6MPwpRYAhmk0dUG00J4bxVV3r9uUzfo24wW0knS07SKSw=="
|
||
},
|
||
"json-schema-traverse": {
|
||
"version": "0.4.1",
|
package.json | ||
---|---|---|
"jquery": "^3.5.0",
|
||
"jquery-ui": "^1.12.1",
|
||
"jquery-ui-dist": "^1.12.1",
|
||
"jquery.cookie": "^1.4.1",
|
||
"js-cookie": "^3.0.1",
|
||
"jstree": "^3.3.9",
|
||
"selectize": "^0.12.6",
|
||
"summernote": "^0.8.18"
|