mirror of
https://github.com/haiwen/seahub.git
synced 2025-09-02 15:38:15 +00:00
[cookie]changed 'topinfo' to 'note_id'
This commit is contained in:
@@ -31,7 +31,7 @@ class InfobarMiddleware(object):
|
||||
return ret
|
||||
|
||||
def process_request(self, request):
|
||||
topinfo_close = request.COOKIES.get('topinfo', '')
|
||||
topinfo_close = request.COOKIES.get('note_id', '')
|
||||
|
||||
cur_note = cache.get('CUR_TOPINFO') if cache.get('CUR_TOPINFO') else \
|
||||
self.get_from_db()
|
||||
|
@@ -136,17 +136,17 @@ $('#info-bar .close').click(function() {
|
||||
$('#info-bar').addClass('hide');
|
||||
if (navigator.cookieEnabled) {
|
||||
var cookies = document.cookie.split('; '),
|
||||
topinfo_exist = false,
|
||||
topinfo_new_value = $(this).attr('data') + ',' + '; max-age=' + 14*24*60*60 + '; path=' + '{{ SITE_ROOT }}';
|
||||
note_id_exist = false,
|
||||
new_note_id = $(this).attr('data') + ',' + '; max-age=' + 14*24*60*60 + '; path=' + '{{ SITE_ROOT }}';
|
||||
for (var i = 0, len = cookies.length; i < len; i++) {
|
||||
if (cookies[i].split('=')[0] == 'topinfo') {
|
||||
topinfo_exist = true;
|
||||
document.cookie = 'topinfo=' + cookies[i].split('=')[1] + topinfo_new_value;
|
||||
if (cookies[i].split('=')[0] == 'note_id') {
|
||||
note_id_exist = true;
|
||||
document.cookie = 'note_id=' + cookies[i].split('=')[1] + new_note_id;
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (!topinfo_exist) {
|
||||
document.cookie = 'topinfo=' + topinfo_new_value;
|
||||
if (!note_id_exist) {
|
||||
document.cookie = 'note_id=' + new_note_id;
|
||||
}
|
||||
}
|
||||
});
|
||||
|
Reference in New Issue
Block a user