Mercurial > kallithea
comparison rhodecode/templates/base/root.html @ 2187:b61e540122f2 beta
#415: Adding comment to changeset causes reload
- comments are now added via ajax and doesn't reload the page
author | Marcin Kuzminski <marcin@python-works.com> |
---|---|
date | Sat, 14 Apr 2012 22:13:07 +0200 |
parents | 85a64b981c07 |
children | 56e96d4e9f6e |
comparison
equal
deleted
inserted
replaced
2186:7b52c2351231 | 2187:b61e540122f2 |
---|---|
45 ## EXTRA FOR JS | 45 ## EXTRA FOR JS |
46 ${self.js_extra()} | 46 ${self.js_extra()} |
47 | 47 |
48 <script type="text/javascript"> | 48 <script type="text/javascript"> |
49 var follow_base_url = "${h.url('toggle_following')}"; | 49 var follow_base_url = "${h.url('toggle_following')}"; |
50 var stop_follow_text = "${_('Stop following this repository')}"; | 50 |
51 var start_follow_text = "${_('Start following this repository')}"; | 51 //JS translations map |
52 | 52 var TRANSLATION_MAP = { |
53 'add another comment':'${_("add another comment")}', | |
54 'Stop following this repository':"${_('Stop following this repository')}", | |
55 'Start following this repository':"${_('Start following this repository')}", | |
56 }; | |
53 | 57 |
54 var onSuccessFollow = function(target){ | 58 var onSuccessFollow = function(target){ |
55 var f = YUD.get(target.id); | 59 var f = YUD.get(target.id); |
56 var f_cnt = YUD.get('current_followers_count'); | 60 var f_cnt = YUD.get('current_followers_count'); |
57 | 61 |
58 if(f.getAttribute('class')=='follow'){ | 62 if(f.getAttribute('class')=='follow'){ |
59 f.setAttribute('class','following'); | 63 f.setAttribute('class','following'); |
60 f.setAttribute('title',stop_follow_text); | 64 f.setAttribute('title',TRANSLATION_MAP['Stop following this repository']); |
61 | 65 |
62 if(f_cnt){ | 66 if(f_cnt){ |
63 var cnt = Number(f_cnt.innerHTML)+1; | 67 var cnt = Number(f_cnt.innerHTML)+1; |
64 f_cnt.innerHTML = cnt; | 68 f_cnt.innerHTML = cnt; |
65 } | 69 } |
66 } | 70 } |
67 else{ | 71 else{ |
68 f.setAttribute('class','follow'); | 72 f.setAttribute('class','follow'); |
69 f.setAttribute('title',start_follow_text); | 73 f.setAttribute('title',TRANSLATION_MAP['Start following this repository']); |
70 if(f_cnt){ | 74 if(f_cnt){ |
71 var cnt = Number(f_cnt.innerHTML)+1; | 75 var cnt = Number(f_cnt.innerHTML)+1; |
72 f_cnt.innerHTML = cnt; | 76 f_cnt.innerHTML = cnt; |
73 } | 77 } |
74 } | 78 } |