Show More
@@ -673,10 +673,7 b' var removeReviewer = function(reviewer_i' | |||||
673 | } |
|
673 | } | |
674 |
|
674 | |||
675 | var fileBrowserListeners = function(current_url, node_list_url, url_base){ |
|
675 | var fileBrowserListeners = function(current_url, node_list_url, url_base){ | |
676 |
|
||||
677 | var current_url_branch = +"?branch=__BRANCH__"; |
|
676 | var current_url_branch = +"?branch=__BRANCH__"; | |
678 | var url = url_base; |
|
|||
679 | var node_url = node_list_url; |
|
|||
680 |
|
677 | |||
681 | YUE.on('stay_at_branch','click',function(e){ |
|
678 | YUE.on('stay_at_branch','click',function(e){ | |
682 | if(e.target.checked){ |
|
679 | if(e.target.checked){ | |
@@ -700,7 +697,7 b' var fileBrowserListeners = function(curr' | |||||
700 | YUD.setStyle('search_activate_id','display','none'); |
|
697 | YUD.setStyle('search_activate_id','display','none'); | |
701 | YUD.setStyle('add_node_id','display','none'); |
|
698 | YUD.setStyle('add_node_id','display','none'); | |
702 | YUC.initHeader('X-PARTIAL-XHR',true); |
|
699 | YUC.initHeader('X-PARTIAL-XHR',true); | |
703 | YUC.asyncRequest('GET',url,{ |
|
700 | YUC.asyncRequest('GET', node_list_url, { | |
704 | success:function(o){ |
|
701 | success:function(o){ | |
705 | nodes = JSON.parse(o.responseText).nodes; |
|
702 | nodes = JSON.parse(o.responseText).nodes; | |
706 | YUD.setStyle('node_filter_box_loading','display','none'); |
|
703 | YUD.setStyle('node_filter_box_loading','display','none'); | |
@@ -743,8 +740,8 b' var fileBrowserListeners = function(curr' | |||||
743 | var n_hl = n.substring(0,pos) |
|
740 | var n_hl = n.substring(0,pos) | |
744 | +"<b>{0}</b>".format(n.substring(pos,pos+query.length)) |
|
741 | +"<b>{0}</b>".format(n.substring(pos,pos+query.length)) | |
745 | +n.substring(pos+query.length) |
|
742 | +n.substring(pos+query.length) | |
746 |
n |
|
743 | var new_url = url_base.replace('__FPATH__',n); | |
747 |
match.push('<tr><td><a class="browser-{0}" href="{1}">{2}</a></td><td colspan="5"></td></tr>'.format(t,n |
|
744 | match.push('<tr><td><a class="browser-{0}" href="{1}">{2}</a></td><td colspan="5"></td></tr>'.format(t,new_url,n_hl)); | |
748 | } |
|
745 | } | |
749 | if(match.length >= matches_max){ |
|
746 | if(match.length >= matches_max){ | |
750 | match.push('<tr><td>{0}</td><td colspan="5"></td></tr>'.format(_TM['search truncated'])); |
|
747 | match.push('<tr><td>{0}</td><td colspan="5"></td></tr>'.format(_TM['search truncated'])); |
@@ -41,9 +41,9 b'' | |||||
41 | var CACHE = {}; |
|
41 | var CACHE = {}; | |
42 | var CACHE_EXPIRE = 60*1000; //cache for 60s |
|
42 | var CACHE_EXPIRE = 60*1000; //cache for 60s | |
43 | //used to construct links from the search list |
|
43 | //used to construct links from the search list | |
44 |
var |
|
44 | var url_base = '${h.url("files_home",repo_name=c.repo_name,revision='__REV__',f_path='__FPATH__')}'; | |
45 | //send the nodelist request to this url |
|
45 | //send the nodelist request to this url | |
46 |
var url |
|
46 | var node_list_url = '${h.url("files_nodelist_home",repo_name=c.repo_name,revision='__REV__',f_path='__FPATH__')}'; | |
47 |
|
47 | |||
48 | var ypjax_links = function(){ |
|
48 | var ypjax_links = function(){ | |
49 | YUE.on(YUQ('.ypjax-link'), 'click',function(e){ |
|
49 | YUE.on(YUQ('.ypjax-link'), 'click',function(e){ | |
@@ -71,8 +71,8 b' var ypjax_links = function(){' | |||||
71 |
|
71 | |||
72 | var title = "${_('%s files') % c.repo_name}" + " - " + f_path; |
|
72 | var title = "${_('%s files') % c.repo_name}" + " - " + f_path; | |
73 |
|
73 | |||
74 | var _node_list_url = node_list_url.replace('__REV__',rev); |
|
74 | var _node_list_url = node_list_url.replace('__REV__',rev).replace('__FPATH__', f_path); | |
75 |
var _url_base = url_base.replace('__REV__',rev) |
|
75 | var _url_base = url_base.replace('__REV__',rev); | |
76 |
|
76 | |||
77 | // Change our States and save some data for handling events |
|
77 | // Change our States and save some data for handling events | |
78 | var data = {url:url,title:title, url_base:_url_base, |
|
78 | var data = {url:url,title:title, url_base:_url_base, | |
@@ -132,8 +132,8 b' YUE.onDOMReady(function(){' | |||||
132 | var _State = { |
|
132 | var _State = { | |
133 | url: "${h.url.current()}", |
|
133 | url: "${h.url.current()}", | |
134 | data: { |
|
134 | data: { | |
135 | node_list_url: node_list_url.replace('__REV__',"${c.changeset.raw_id}"), |
|
135 | node_list_url: node_list_url.replace('__REV__',"${c.changeset.raw_id}").replace('__FPATH__', "${h.safe_unicode(c.file.path)}"), | |
136 |
url_base: url_base.replace('__REV__',"${c.changeset.raw_id}") |
|
136 | url_base: url_base.replace('__REV__',"${c.changeset.raw_id}") | |
137 | } |
|
137 | } | |
138 | } |
|
138 | } | |
139 | fileBrowserListeners(_State.url, _State.data.node_list_url, _State.data.url_base); |
|
139 | fileBrowserListeners(_State.url, _State.data.node_list_url, _State.data.url_base); |
General Comments 0
You need to be logged in to leave comments.
Login now