Mercurial > kallithea
comparison rhodecode/templates/base/root.html @ 2369:c2f131502037 beta
Autocomplete fixes
- use translation MAP
- move translation to top level in order to be used inside rhodecode.js
- re-use user and groups data in changesets page
author | Marcin Kuzminski <marcin@python-works.com> |
---|---|
date | Fri, 01 Jun 2012 23:29:41 +0200 |
parents | 56e96d4e9f6e |
children | 6bef2a9f73e2 |
comparison
equal
deleted
inserted
replaced
2368:5143b8df576c | 2369:c2f131502037 |
---|---|
34 </script> | 34 </script> |
35 %endif | 35 %endif |
36 | 36 |
37 ## JAVASCRIPT ## | 37 ## JAVASCRIPT ## |
38 <%def name="js()"> | 38 <%def name="js()"> |
39 <script type="text/javascript"> | |
40 //JS translations map | |
41 var TRANSLATION_MAP = { | |
42 'add another comment':'${_("add another comment")}', | |
43 'Stop following this repository':"${_('Stop following this repository')}", | |
44 'Start following this repository':"${_('Start following this repository')}", | |
45 'Group':"${_('Group')}", | |
46 'members':"${_('members')}" | |
47 | |
48 }; | |
49 var _TM = TRANSLATION_MAP; | |
50 </script> | |
39 <script type="text/javascript" src="${h.url('/js/yui.2.9.js')}"></script> | 51 <script type="text/javascript" src="${h.url('/js/yui.2.9.js')}"></script> |
40 <!--[if lt IE 9]> | 52 <!--[if lt IE 9]> |
41 <script language="javascript" type="text/javascript" src="${h.url('/js/excanvas.min.js')}"></script> | 53 <script language="javascript" type="text/javascript" src="${h.url('/js/excanvas.min.js')}"></script> |
42 <![endif]--> | 54 <![endif]--> |
43 <script type="text/javascript" src="${h.url('/js/yui.flot.js')}"></script> | 55 <script type="text/javascript" src="${h.url('/js/yui.flot.js')}"></script> |
46 ${self.js_extra()} | 58 ${self.js_extra()} |
47 | 59 |
48 <script type="text/javascript"> | 60 <script type="text/javascript"> |
49 var follow_base_url = "${h.url('toggle_following')}"; | 61 var follow_base_url = "${h.url('toggle_following')}"; |
50 | 62 |
51 //JS translations map | |
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 }; | |
57 | |
58 var onSuccessFollow = function(target){ | 63 var onSuccessFollow = function(target){ |
59 var f = YUD.get(target.id); | 64 var f = YUD.get(target.id); |
60 var f_cnt = YUD.get('current_followers_count'); | 65 var f_cnt = YUD.get('current_followers_count'); |
61 | 66 |
62 if(f.getAttribute('class')=='follow'){ | 67 if(f.getAttribute('class')=='follow'){ |
63 f.setAttribute('class','following'); | 68 f.setAttribute('class','following'); |
64 f.setAttribute('title',TRANSLATION_MAP['Stop following this repository']); | 69 f.setAttribute('title',_TM['Stop following this repository']); |
65 | 70 |
66 if(f_cnt){ | 71 if(f_cnt){ |
67 var cnt = Number(f_cnt.innerHTML)+1; | 72 var cnt = Number(f_cnt.innerHTML)+1; |
68 f_cnt.innerHTML = cnt; | 73 f_cnt.innerHTML = cnt; |
69 } | 74 } |
70 } | 75 } |
71 else{ | 76 else{ |
72 f.setAttribute('class','follow'); | 77 f.setAttribute('class','follow'); |
73 f.setAttribute('title',TRANSLATION_MAP['Start following this repository']); | 78 f.setAttribute('title',_TM['Start following this repository']); |
74 if(f_cnt){ | 79 if(f_cnt){ |
75 var cnt = Number(f_cnt.innerHTML)+1; | 80 var cnt = Number(f_cnt.innerHTML)+1; |
76 f_cnt.innerHTML = cnt; | 81 f_cnt.innerHTML = cnt; |
77 } | 82 } |
78 } | 83 } |