Unused, unnecessary and intrusive cookie/storage removed!
This commit is contained in:
parent
3720e37f06
commit
5c262a788d
76
js/util.js
76
js/util.js
@ -53,7 +53,6 @@ var SN = { // StatusNet
|
|||||||
NoticeDataGeo: 'notice_data-geo',
|
NoticeDataGeo: 'notice_data-geo',
|
||||||
NoticeDataGeoCookie: 'NoticeDataGeo',
|
NoticeDataGeoCookie: 'NoticeDataGeo',
|
||||||
NoticeDataGeoSelected: 'notice_data-geo_selected',
|
NoticeDataGeoSelected: 'notice_data-geo_selected',
|
||||||
StatusNetInstance: 'StatusNetInstance'
|
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
@ -1251,56 +1250,6 @@ var SN = { // StatusNet
|
|||||||
return date;
|
return date;
|
||||||
},
|
},
|
||||||
|
|
||||||
/**
|
|
||||||
* Some sort of object interface for storing some structured
|
|
||||||
* information in a cookie.
|
|
||||||
*
|
|
||||||
* Appears to be used to save the last-used login nickname?
|
|
||||||
* That's something that browsers usually take care of for us
|
|
||||||
* these days, do we really need to do it? Does anything else
|
|
||||||
* use this interface?
|
|
||||||
*
|
|
||||||
* @fixme what is this?
|
|
||||||
* @fixme should this use non-cookie local storage when available?
|
|
||||||
*/
|
|
||||||
StatusNetInstance: {
|
|
||||||
/**
|
|
||||||
* @fixme what is this?
|
|
||||||
*/
|
|
||||||
Set: function (value) {
|
|
||||||
var SNI = SN.U.StatusNetInstance.Get();
|
|
||||||
if (SNI !== null) {
|
|
||||||
value = $.extend(SNI, value);
|
|
||||||
}
|
|
||||||
|
|
||||||
$.cookie(
|
|
||||||
SN.C.S.StatusNetInstance,
|
|
||||||
JSON.stringify(value),
|
|
||||||
{
|
|
||||||
path: '/',
|
|
||||||
expires: SN.U.GetFullYear(2029, 0, 1)
|
|
||||||
});
|
|
||||||
},
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @fixme what is this?
|
|
||||||
*/
|
|
||||||
Get: function () {
|
|
||||||
var cookieValue = $.cookie(SN.C.S.StatusNetInstance);
|
|
||||||
if (cookieValue !== undefined) {
|
|
||||||
return JSON.parse(cookieValue);
|
|
||||||
}
|
|
||||||
return null;
|
|
||||||
},
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @fixme what is this?
|
|
||||||
*/
|
|
||||||
Delete: function () {
|
|
||||||
$.removeCookie(SN.C.S.StatusNetInstance);
|
|
||||||
}
|
|
||||||
},
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Check if the current page is a timeline where the current user's
|
* Check if the current page is a timeline where the current user's
|
||||||
* posts should be displayed immediately on success.
|
* posts should be displayed immediately on success.
|
||||||
@ -1594,28 +1543,6 @@ var SN = { // StatusNet
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
/**
|
|
||||||
* Run setup code for login form:
|
|
||||||
*
|
|
||||||
* - loads saved last-used-nickname from cookie
|
|
||||||
* - sets event handler to save nickname to cookie on submit
|
|
||||||
*
|
|
||||||
* @fixme is this necessary? Browsers do their own form saving these days.
|
|
||||||
*/
|
|
||||||
Login: function () {
|
|
||||||
if (SN.U.StatusNetInstance.Get() !== null) {
|
|
||||||
var nickname = SN.U.StatusNetInstance.Get().Nickname;
|
|
||||||
if (nickname !== null) {
|
|
||||||
$('#form_login #nickname').val(nickname);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
$('#form_login').on('submit', function () {
|
|
||||||
SN.U.StatusNetInstance.Set({Nickname: $('#form_login #nickname').val()});
|
|
||||||
return true;
|
|
||||||
});
|
|
||||||
},
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Run setup for the ajax people tags editor
|
* Run setup for the ajax people tags editor
|
||||||
*
|
*
|
||||||
@ -1744,9 +1671,6 @@ $(function () {
|
|||||||
if ($('#content .entity_actions').length > 0) {
|
if ($('#content .entity_actions').length > 0) {
|
||||||
SN.Init.EntityActions();
|
SN.Init.EntityActions();
|
||||||
}
|
}
|
||||||
if ($('#form_login').length > 0) {
|
|
||||||
SN.Init.Login();
|
|
||||||
}
|
|
||||||
if ($('#profile_search_results').length > 0) {
|
if ($('#profile_search_results').length > 0) {
|
||||||
SN.Init.ProfileSearch();
|
SN.Init.ProfileSearch();
|
||||||
}
|
}
|
||||||
|
@ -24,12 +24,6 @@
|
|||||||
* @note Everything in here should eventually migrate over to /js/util.js's SN.
|
* @note Everything in here should eventually migrate over to /js/util.js's SN.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
SN.Init.OStatusCookie = function () {
|
|
||||||
if (SN.U.StatusNetInstance.Get() === null) {
|
|
||||||
SN.U.StatusNetInstance.Set({RemoteProfile: null});
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
SN.U.DialogBox = {
|
SN.U.DialogBox = {
|
||||||
Subscribe: function (a) {
|
Subscribe: function (a) {
|
||||||
var f = a.parent().find('.form_settings');
|
var f = a.parent().find('.form_settings');
|
||||||
@ -72,16 +66,6 @@ SN.U.DialogBox = {
|
|||||||
});
|
});
|
||||||
|
|
||||||
form.find('#profile').focus();
|
form.find('#profile').focus();
|
||||||
|
|
||||||
if (form.attr('id') == 'form_ostatus_connect') {
|
|
||||||
SN.Init.OStatusCookie();
|
|
||||||
form.find('#profile').val(SN.U.StatusNetInstance.Get().RemoteProfile);
|
|
||||||
|
|
||||||
form.find("[type=submit]").bind('click', function () {
|
|
||||||
SN.U.StatusNetInstance.Set({RemoteProfile: form.find('#profile').val()});
|
|
||||||
return true;
|
|
||||||
});
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
a.removeClass('processing');
|
a.removeClass('processing');
|
||||||
|
Loading…
Reference in New Issue
Block a user