mirror of
https://github.com/typecho/typecho.git
synced 2025-03-23 19:40:22 +01:00
将cookie存储替换为sessionStorage
This commit is contained in:
parent
1d7f07ae15
commit
298780e6ee
@ -118,7 +118,9 @@ include 'common-js.php';
|
||||
|
||||
<script>
|
||||
$(document).ready(function () {
|
||||
var ul = $('.intro-link ul'), html = $.cookie('__typecho_feed'), update = $.cookie('__typecho_update');
|
||||
var ul = $('.intro-link ul'), cache = window.sessionStorage,
|
||||
html = cache ? cache.getItem('feed') : '',
|
||||
update = cache ? cache.getItem('update') : '';
|
||||
|
||||
if (!!html) {
|
||||
ul.html(html);
|
||||
@ -132,8 +134,8 @@ $(document).ready(function () {
|
||||
}
|
||||
|
||||
ul.html(html);
|
||||
$.cookie('__typecho_feed', html);
|
||||
});
|
||||
cache.setItem('feed', html);
|
||||
}, 'json');
|
||||
}
|
||||
|
||||
function applyUpdate(update) {
|
||||
@ -152,8 +154,8 @@ $(document).ready(function () {
|
||||
update = '';
|
||||
$.get('<?php $options->index('/action/ajax?do=checkVersion'); ?>', function (o, status, resp) {
|
||||
applyUpdate(o);
|
||||
$.cookie('__typecho_update', resp.responseText);
|
||||
});
|
||||
cache.setItem('update', resp.responseText);
|
||||
}, 'json');
|
||||
}
|
||||
});
|
||||
|
||||
|
@ -261,7 +261,7 @@ $(document).ready(function () {
|
||||
$.post(t.attr('action'), t.serialize(), function (o) {
|
||||
reply.html(o.comment.content)
|
||||
.effect('highlight');
|
||||
});
|
||||
}, 'json');
|
||||
|
||||
t.remove();
|
||||
return false;
|
||||
@ -333,7 +333,7 @@ $(document).ready(function () {
|
||||
$.post(t.attr('action'), comment, function (o) {
|
||||
$('.comment-content', oldTr).html(o.comment.content)
|
||||
.effect('highlight');
|
||||
});
|
||||
}, 'json');
|
||||
|
||||
oldTr.show();
|
||||
tr.remove();
|
||||
|
@ -149,7 +149,7 @@ $(document).ready(function() {
|
||||
cid = o.cid;
|
||||
autoSave.text('<?php _e('内容已经保存'); ?>' + ' (' + o.time + ')').effect('highlight', 1000);
|
||||
locked = false;
|
||||
});
|
||||
}, 'json');
|
||||
}
|
||||
}, 10000);
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user