mirror of
https://github.com/reddit-archive/reddit.git
synced 2026-01-27 07:48:16 -05:00
change the name of the clicks cookie to recentclicks
This commit is contained in:
@@ -1364,7 +1364,7 @@ class ApiController(RedditController):
|
||||
def GET_gadget(self, form, jquery, type, links):
|
||||
if not links and type == 'click':
|
||||
# malformed cookie, clear it out
|
||||
set_user_cookie('click', '')
|
||||
set_user_cookie('recentclicks', '')
|
||||
|
||||
if not links:
|
||||
return
|
||||
|
||||
@@ -144,17 +144,17 @@ valid_click_cookie = re.compile(r'(:?t[0-9]+_[a-zA-Z0-9]+)+').match
|
||||
def read_click_cookie():
|
||||
# not used at the moment, if you start using this, you should also
|
||||
# test it
|
||||
click_cookie = read_user_cookie('click')
|
||||
click_cookie = read_user_cookie('recentclicks')
|
||||
if click_cookie:
|
||||
if valid_click_cookie(click_cookie):
|
||||
fullnames = [ x for x in UniqueIterator(click_cookie.split(':')) if x ]
|
||||
|
||||
if len(click_cookie) > 1000:
|
||||
fullnames = fullnames[:20]
|
||||
set_user_cookie('click', ':'.join(fullnames))
|
||||
set_user_cookie('recentclicks', ':'.join(fullnames))
|
||||
return fullnames
|
||||
else:
|
||||
set_user_cookie('click', '')
|
||||
set_user_cookie('recentclicks', '')
|
||||
|
||||
def read_mod_cookie():
|
||||
cook = [s.split('=')[0:2] for s in read_user_cookie('mod').split(':') if s]
|
||||
|
||||
@@ -477,7 +477,7 @@ function add_thing_id_to_cookie(id, cookie_name) {
|
||||
};
|
||||
|
||||
function clicked_items() {
|
||||
var cookie = $.cookie_read('click');
|
||||
var cookie = $.cookie_read('recentclicks');
|
||||
if(cookie && cookie.data) {
|
||||
var fullnames = cookie.data.split(":");
|
||||
/* don't return empty ones */
|
||||
@@ -493,7 +493,7 @@ function clicked_items() {
|
||||
}
|
||||
|
||||
function clear_clicked_items() {
|
||||
var cookie = $.cookie_read('click');
|
||||
var cookie = $.cookie_read('recentclicks');
|
||||
cookie.data = '';
|
||||
$.cookie_write(cookie);
|
||||
$('.gadget').remove();
|
||||
@@ -533,7 +533,7 @@ function updateEventHandlers(thing) {
|
||||
/* mark as clicked */
|
||||
$(this).addClass("click");
|
||||
/* set the click cookie. */
|
||||
add_thing_to_cookie(this, "click");
|
||||
add_thing_to_cookie(this, "recentclicks");
|
||||
/* remember this as the last thing clicked */
|
||||
var wasorganic = $(this).parents('.organic-listing').length > 0;
|
||||
last_click(thing, wasorganic);
|
||||
|
||||
@@ -132,7 +132,7 @@
|
||||
## add us to the click cookie
|
||||
<script type="text/javascript">
|
||||
$(function() {
|
||||
add_thing_id_to_cookie('${thing.link._fullname}', 'click');
|
||||
add_thing_id_to_cookie('${thing.link._fullname}', 'recentclicks');
|
||||
});
|
||||
</script>
|
||||
<span>
|
||||
|
||||
Reference in New Issue
Block a user