Permalink
Browse files

Pull out JS announcement stuff into unisubs.site.js

  • Loading branch information...
nicksergeant committed Mar 16, 2012
1 parent 0881245 commit 3110fae92c0a070898aae40aae1153463a150133
Showing with 11 additions and 8 deletions.
  1. +10 −0 media/js/unisubs.site.js
  2. +1 −8 templates/auth/_announcement.html
View
@@ -360,6 +360,16 @@ var Site = function(Site) {
$('#lang_select_btn').hide();
}
}
+ if ($('div.note').length) {
+ $('.note .hide-announcement').click(function() {
+ var $this = $(this);
+ $this.parents('.note').hide();
+ var d = new Date();
+ d.setTime(d.getTime() + 60*60*24*365*1000);
+ document.cookie = window.COOKIE;
+ return false;
+ });
+ }
$listsCollapsible = $('ul.list-collapsible');
if ($listsCollapsible.length) {
@@ -6,14 +6,7 @@
<div></div>
<a href="#" class="hide-announcement">{% trans "Hide" %}</a>
<script type="text/javascript">
- $('.note .hide-announcement').click(function(){
- var $this = $(this);
- $this.parents('.note').hide();
- var d = new Date()
- d.setTime(d.getTime() + 60*60*24*365*1000)
- document.cookie = '{{ cookie_name }}={{ date|urlencode }}; path=/; expires='+d.toUTCString();
- return false;
- });
+ window.COOKIE = '{{ cookie_name }}={{ date|urlencode }}; path=/; expires='+d.toUTCString();
</script>
</div>
{% endif %}

0 comments on commit 3110fae

Please sign in to comment.