change the name of the clicks cookie to recentclicks

This commit is contained in:
KeyserSosa
2009-06-02 16:07:16 -07:00
parent ee49b18949
commit 416ee912f7
4 changed files with 8 additions and 8 deletions

View File

@@ -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

View File

@@ -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]

View File

@@ -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);

View File

@@ -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>