annotate rhodecode/templates/files/files.html @ 3527:87c97fcea029 beta

Adding the context bar too all pages related to a Repository. Deleted top menu items that are on the context bar already.
author Leonardo <leo@unity3d.com>
date Mon, 04 Mar 2013 12:15:34 +0100
parents f74be3359044
children 9e677f6d34cb
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
128
9deb6f1d5b90 Implemented file history.
Marcin Kuzminski <marcin@python-works.com>
parents: 106
diff changeset
1 <%inherit file="/base/base.html"/>
99
5b57295601b6 Updated basic files browser with, pygments
Marcin Kuzminski <marcin@python-works.com>
parents:
diff changeset
2
5b57295601b6 Updated basic files browser with, pygments
Marcin Kuzminski <marcin@python-works.com>
parents:
diff changeset
3 <%def name="title()">
2686
269c6e0b54cc Reimplemented file-browser using partial-ajax
Marcin Kuzminski <marcin@python-works.com>
parents: 2492
diff changeset
4 ${_('%s files') % c.repo_name} - ${c.rhodecode_name}
99
5b57295601b6 Updated basic files browser with, pygments
Marcin Kuzminski <marcin@python-works.com>
parents:
diff changeset
5 </%def>
362
558eb7c5028f version bump to 0.8
Marcin Kuzminski <marcin@python-works.com>
parents: 278
diff changeset
6
558eb7c5028f version bump to 0.8
Marcin Kuzminski <marcin@python-works.com>
parents: 278
diff changeset
7 <%def name="breadcrumbs_links()">
2492
79818f546538 i18n 'Home' in breadcrumbs
Takumi IINO <trot.thunder@gmail.com>
parents: 2428
diff changeset
8 ${h.link_to(_(u'Home'),h.url('/'))}
362
558eb7c5028f version bump to 0.8
Marcin Kuzminski <marcin@python-works.com>
parents: 278
diff changeset
9 &raquo;
3392
f74be3359044 unified breadcrumbs display
Marcin Kuzminski <marcin@python-works.com>
parents: 3197
diff changeset
10 ${h.repo_link(c.rhodecode_db_repo.groups_and_repo)}
362
558eb7c5028f version bump to 0.8
Marcin Kuzminski <marcin@python-works.com>
parents: 278
diff changeset
11 &raquo;
558eb7c5028f version bump to 0.8
Marcin Kuzminski <marcin@python-works.com>
parents: 278
diff changeset
12 ${_('files')}
1737
61eda8bf70d0 new files views
Marcin Kuzminski <marcin@python-works.com>
parents: 1705
diff changeset
13 %if c.file:
644
c8bd0e6cc3da some changes for #45.
Marcin Kuzminski <marcin@python-works.com>
parents: 636
diff changeset
14 @ r${c.changeset.revision}:${h.short_id(c.changeset.raw_id)}
1888
f91d3f9b7230 White-space cleanup
Marcin Kuzminski <marcin@python-works.com>
parents: 1749
diff changeset
15 %endif
362
558eb7c5028f version bump to 0.8
Marcin Kuzminski <marcin@python-works.com>
parents: 278
diff changeset
16 </%def>
558eb7c5028f version bump to 0.8
Marcin Kuzminski <marcin@python-works.com>
parents: 278
diff changeset
17
99
5b57295601b6 Updated basic files browser with, pygments
Marcin Kuzminski <marcin@python-works.com>
parents:
diff changeset
18 <%def name="page_nav()">
1888
f91d3f9b7230 White-space cleanup
Marcin Kuzminski <marcin@python-works.com>
parents: 1749
diff changeset
19 ${self.menu('files')}
99
5b57295601b6 Updated basic files browser with, pygments
Marcin Kuzminski <marcin@python-works.com>
parents:
diff changeset
20 </%def>
362
558eb7c5028f version bump to 0.8
Marcin Kuzminski <marcin@python-works.com>
parents: 278
diff changeset
21
99
5b57295601b6 Updated basic files browser with, pygments
Marcin Kuzminski <marcin@python-works.com>
parents:
diff changeset
22 <%def name="main()">
3527
87c97fcea029 Adding the context bar too all pages related to a Repository.
Leonardo <leo@unity3d.com>
parents: 3392
diff changeset
23 ${self.context_bar('files')}
362
558eb7c5028f version bump to 0.8
Marcin Kuzminski <marcin@python-works.com>
parents: 278
diff changeset
24 <div class="box">
558eb7c5028f version bump to 0.8
Marcin Kuzminski <marcin@python-works.com>
parents: 278
diff changeset
25 <!-- box / title -->
558eb7c5028f version bump to 0.8
Marcin Kuzminski <marcin@python-works.com>
parents: 278
diff changeset
26 <div class="title">
644
c8bd0e6cc3da some changes for #45.
Marcin Kuzminski <marcin@python-works.com>
parents: 636
diff changeset
27 ${self.breadcrumbs()}
3197
b4f401524060 html: don't use tabs
Mads Kiilerich <madski@unity3d.com>
parents: 3029
diff changeset
28 <ul class="links">
b4f401524060 html: don't use tabs
Mads Kiilerich <madski@unity3d.com>
parents: 3029
diff changeset
29 <li>
b4f401524060 html: don't use tabs
Mads Kiilerich <madski@unity3d.com>
parents: 3029
diff changeset
30 <span style="text-transform: uppercase;"><a href="#">${_('branch')}: ${c.changeset.branch}</a></span>
b4f401524060 html: don't use tabs
Mads Kiilerich <madski@unity3d.com>
parents: 3029
diff changeset
31 </li>
b4f401524060 html: don't use tabs
Mads Kiilerich <madski@unity3d.com>
parents: 3029
diff changeset
32 </ul>
362
558eb7c5028f version bump to 0.8
Marcin Kuzminski <marcin@python-works.com>
parents: 278
diff changeset
33 </div>
558eb7c5028f version bump to 0.8
Marcin Kuzminski <marcin@python-works.com>
parents: 278
diff changeset
34 <div class="table">
3197
b4f401524060 html: don't use tabs
Mads Kiilerich <madski@unity3d.com>
parents: 3029
diff changeset
35 <div id="files_data">
b4f401524060 html: don't use tabs
Mads Kiilerich <madski@unity3d.com>
parents: 3029
diff changeset
36 <%include file='files_ypjax.html'/>
b4f401524060 html: don't use tabs
Mads Kiilerich <madski@unity3d.com>
parents: 3029
diff changeset
37 </div>
362
558eb7c5028f version bump to 0.8
Marcin Kuzminski <marcin@python-works.com>
parents: 278
diff changeset
38 </div>
1888
f91d3f9b7230 White-space cleanup
Marcin Kuzminski <marcin@python-works.com>
parents: 1749
diff changeset
39 </div>
2686
269c6e0b54cc Reimplemented file-browser using partial-ajax
Marcin Kuzminski <marcin@python-works.com>
parents: 2492
diff changeset
40
1699
623b228cf325 cleaned up JS files in files templates.
Marcin Kuzminski <marcin@python-works.com>
parents: 644
diff changeset
41 <script type="text/javascript">
2686
269c6e0b54cc Reimplemented file-browser using partial-ajax
Marcin Kuzminski <marcin@python-works.com>
parents: 2492
diff changeset
42 var CACHE = {};
3001
37c7abd34d44 implements #636, lazy loading of history and authors to speed up page responsiveness.
Marcin Kuzminski <marcin@python-works.com>
parents: 2977
diff changeset
43 var CACHE_EXPIRE = 5*60*1000; //cache for 5*60s
2687
4d7dfda32d10 Disable the html4 history mock for old browsers.
Marcin Kuzminski <marcin@python-works.com>
parents: 2686
diff changeset
44 //used to construct links from the search list
2891
9812e617c564 fix files quick filter links
Marcin Kuzminski <marcin@python-works.com>
parents: 2867
diff changeset
45 var url_base = '${h.url("files_home",repo_name=c.repo_name,revision='__REV__',f_path='__FPATH__')}';
2687
4d7dfda32d10 Disable the html4 history mock for old browsers.
Marcin Kuzminski <marcin@python-works.com>
parents: 2686
diff changeset
46 //send the nodelist request to this url
2891
9812e617c564 fix files quick filter links
Marcin Kuzminski <marcin@python-works.com>
parents: 2867
diff changeset
47 var node_list_url = '${h.url("files_nodelist_home",repo_name=c.repo_name,revision='__REV__',f_path='__FPATH__')}';
3001
37c7abd34d44 implements #636, lazy loading of history and authors to speed up page responsiveness.
Marcin Kuzminski <marcin@python-works.com>
parents: 2977
diff changeset
48 // send the node history requst to this url
37c7abd34d44 implements #636, lazy loading of history and authors to speed up page responsiveness.
Marcin Kuzminski <marcin@python-works.com>
parents: 2977
diff changeset
49 var node_history_url = '${h.url("files_history_home",repo_name=c.repo_name,revision='__REV__',f_path='__FPATH__')}';
2686
269c6e0b54cc Reimplemented file-browser using partial-ajax
Marcin Kuzminski <marcin@python-works.com>
parents: 2492
diff changeset
50
269c6e0b54cc Reimplemented file-browser using partial-ajax
Marcin Kuzminski <marcin@python-works.com>
parents: 2492
diff changeset
51 var ypjax_links = function(){
269c6e0b54cc Reimplemented file-browser using partial-ajax
Marcin Kuzminski <marcin@python-works.com>
parents: 2492
diff changeset
52 YUE.on(YUQ('.ypjax-link'), 'click',function(e){
2815
acc05c33cc0c White space cleanup
Marcin Kuzminski <marcin@python-works.com>
parents: 2691
diff changeset
53
3197
b4f401524060 html: don't use tabs
Mads Kiilerich <madski@unity3d.com>
parents: 3029
diff changeset
54 //don't do ypjax on middle click
b4f401524060 html: don't use tabs
Mads Kiilerich <madski@unity3d.com>
parents: 3029
diff changeset
55 if(e.which == 2 || !History.enabled){
b4f401524060 html: don't use tabs
Mads Kiilerich <madski@unity3d.com>
parents: 3029
diff changeset
56 return true;
b4f401524060 html: don't use tabs
Mads Kiilerich <madski@unity3d.com>
parents: 3029
diff changeset
57 }
2815
acc05c33cc0c White space cleanup
Marcin Kuzminski <marcin@python-works.com>
parents: 2691
diff changeset
58
2686
269c6e0b54cc Reimplemented file-browser using partial-ajax
Marcin Kuzminski <marcin@python-works.com>
parents: 2492
diff changeset
59 var el = e.currentTarget;
269c6e0b54cc Reimplemented file-browser using partial-ajax
Marcin Kuzminski <marcin@python-works.com>
parents: 2492
diff changeset
60 var url = el.href;
2691
e70be4cf96e8 fixed issues with non-ascii chars in new file browser
Marcin Kuzminski <marcin@python-works.com>
parents: 2687
diff changeset
61
2686
269c6e0b54cc Reimplemented file-browser using partial-ajax
Marcin Kuzminski <marcin@python-works.com>
parents: 2492
diff changeset
62 var _base_url = '${h.url("files_home",repo_name=c.repo_name,revision='',f_path='')}';
269c6e0b54cc Reimplemented file-browser using partial-ajax
Marcin Kuzminski <marcin@python-works.com>
parents: 2492
diff changeset
63 _base_url = _base_url.replace('//','/')
2815
acc05c33cc0c White space cleanup
Marcin Kuzminski <marcin@python-works.com>
parents: 2691
diff changeset
64
2686
269c6e0b54cc Reimplemented file-browser using partial-ajax
Marcin Kuzminski <marcin@python-works.com>
parents: 2492
diff changeset
65 //extract rev and the f_path from url.
269c6e0b54cc Reimplemented file-browser using partial-ajax
Marcin Kuzminski <marcin@python-works.com>
parents: 2492
diff changeset
66 parts = url.split(_base_url)
269c6e0b54cc Reimplemented file-browser using partial-ajax
Marcin Kuzminski <marcin@python-works.com>
parents: 2492
diff changeset
67 if(parts.length != 2){
3197
b4f401524060 html: don't use tabs
Mads Kiilerich <madski@unity3d.com>
parents: 3029
diff changeset
68 return false;
2686
269c6e0b54cc Reimplemented file-browser using partial-ajax
Marcin Kuzminski <marcin@python-works.com>
parents: 2492
diff changeset
69 }
2815
acc05c33cc0c White space cleanup
Marcin Kuzminski <marcin@python-works.com>
parents: 2691
diff changeset
70
2686
269c6e0b54cc Reimplemented file-browser using partial-ajax
Marcin Kuzminski <marcin@python-works.com>
parents: 2492
diff changeset
71 var parts2 = parts[1].split('/');
3197
b4f401524060 html: don't use tabs
Mads Kiilerich <madski@unity3d.com>
parents: 3029
diff changeset
72 var rev = parts2.shift(); // pop the first element which is the revision
b4f401524060 html: don't use tabs
Mads Kiilerich <madski@unity3d.com>
parents: 3029
diff changeset
73 var f_path = parts2.join('/');
2815
acc05c33cc0c White space cleanup
Marcin Kuzminski <marcin@python-works.com>
parents: 2691
diff changeset
74
2686
269c6e0b54cc Reimplemented file-browser using partial-ajax
Marcin Kuzminski <marcin@python-works.com>
parents: 2492
diff changeset
75 var title = "${_('%s files') % c.repo_name}" + " - " + f_path;
2815
acc05c33cc0c White space cleanup
Marcin Kuzminski <marcin@python-works.com>
parents: 2691
diff changeset
76
2891
9812e617c564 fix files quick filter links
Marcin Kuzminski <marcin@python-works.com>
parents: 2867
diff changeset
77 var _node_list_url = node_list_url.replace('__REV__',rev).replace('__FPATH__', f_path);
9812e617c564 fix files quick filter links
Marcin Kuzminski <marcin@python-works.com>
parents: 2867
diff changeset
78 var _url_base = url_base.replace('__REV__',rev);
2691
e70be4cf96e8 fixed issues with non-ascii chars in new file browser
Marcin Kuzminski <marcin@python-works.com>
parents: 2687
diff changeset
79
2686
269c6e0b54cc Reimplemented file-browser using partial-ajax
Marcin Kuzminski <marcin@python-works.com>
parents: 2492
diff changeset
80 // Change our States and save some data for handling events
2687
4d7dfda32d10 Disable the html4 history mock for old browsers.
Marcin Kuzminski <marcin@python-works.com>
parents: 2686
diff changeset
81 var data = {url:url,title:title, url_base:_url_base,
3001
37c7abd34d44 implements #636, lazy loading of history and authors to speed up page responsiveness.
Marcin Kuzminski <marcin@python-works.com>
parents: 2977
diff changeset
82 node_list_url:_node_list_url, rev:rev, f_path:f_path};
2815
acc05c33cc0c White space cleanup
Marcin Kuzminski <marcin@python-works.com>
parents: 2691
diff changeset
83 History.pushState(data, title, url);
acc05c33cc0c White space cleanup
Marcin Kuzminski <marcin@python-works.com>
parents: 2691
diff changeset
84
2686
269c6e0b54cc Reimplemented file-browser using partial-ajax
Marcin Kuzminski <marcin@python-works.com>
parents: 2492
diff changeset
85 //now we're sure that we can do ypjax things
2977
cff9d4e1d821 Fixed issue when node didn't exists at 'tip' and we tried calculate history based on that assumption.
Marcin Kuzminski <marcin@python-works.com>
parents: 2891
diff changeset
86 YUE.preventDefault(e);
2686
269c6e0b54cc Reimplemented file-browser using partial-ajax
Marcin Kuzminski <marcin@python-works.com>
parents: 2492
diff changeset
87 return false;
269c6e0b54cc Reimplemented file-browser using partial-ajax
Marcin Kuzminski <marcin@python-works.com>
parents: 2492
diff changeset
88 });
269c6e0b54cc Reimplemented file-browser using partial-ajax
Marcin Kuzminski <marcin@python-works.com>
parents: 2492
diff changeset
89 }
269c6e0b54cc Reimplemented file-browser using partial-ajax
Marcin Kuzminski <marcin@python-works.com>
parents: 2492
diff changeset
90
269c6e0b54cc Reimplemented file-browser using partial-ajax
Marcin Kuzminski <marcin@python-works.com>
parents: 2492
diff changeset
91 var callbacks = function(State){
269c6e0b54cc Reimplemented file-browser using partial-ajax
Marcin Kuzminski <marcin@python-works.com>
parents: 2492
diff changeset
92 ypjax_links();
269c6e0b54cc Reimplemented file-browser using partial-ajax
Marcin Kuzminski <marcin@python-works.com>
parents: 2492
diff changeset
93 tooltip_activate();
269c6e0b54cc Reimplemented file-browser using partial-ajax
Marcin Kuzminski <marcin@python-works.com>
parents: 2492
diff changeset
94 fileBrowserListeners(State.url, State.data.node_list_url, State.data.url_base);
3029
685ebc84c2e9 White space cleanup
Marcin Kuzminski <marcin@python-works.com>
parents: 3003
diff changeset
95
3001
37c7abd34d44 implements #636, lazy loading of history and authors to speed up page responsiveness.
Marcin Kuzminski <marcin@python-works.com>
parents: 2977
diff changeset
96 if(YUD.get('hlcode')){
3197
b4f401524060 html: don't use tabs
Mads Kiilerich <madski@unity3d.com>
parents: 3029
diff changeset
97 YUE.on('hlcode', 'mouseup', getSelectionLink);
3001
37c7abd34d44 implements #636, lazy loading of history and authors to speed up page responsiveness.
Marcin Kuzminski <marcin@python-works.com>
parents: 2977
diff changeset
98 }
37c7abd34d44 implements #636, lazy loading of history and authors to speed up page responsiveness.
Marcin Kuzminski <marcin@python-works.com>
parents: 2977
diff changeset
99 //console.log(State);
37c7abd34d44 implements #636, lazy loading of history and authors to speed up page responsiveness.
Marcin Kuzminski <marcin@python-works.com>
parents: 2977
diff changeset
100 if(YUD.get('load_node_history')){
37c7abd34d44 implements #636, lazy loading of history and authors to speed up page responsiveness.
Marcin Kuzminski <marcin@python-works.com>
parents: 2977
diff changeset
101 //remove all listeners due to problems of history state
37c7abd34d44 implements #636, lazy loading of history and authors to speed up page responsiveness.
Marcin Kuzminski <marcin@python-works.com>
parents: 2977
diff changeset
102 YUE.removeListener('load_node_history', 'click');
37c7abd34d44 implements #636, lazy loading of history and authors to speed up page responsiveness.
Marcin Kuzminski <marcin@python-works.com>
parents: 2977
diff changeset
103 YUE.on('load_node_history', 'click', function(e){
37c7abd34d44 implements #636, lazy loading of history and authors to speed up page responsiveness.
Marcin Kuzminski <marcin@python-works.com>
parents: 2977
diff changeset
104 var _url = node_history_url.replace('__REV__',State.data.rev).replace('__FPATH__', State.data.f_path);
3003
adf8ee7b8f2a fire tooltips after loading the history
Marcin Kuzminski <marcin@python-works.com>
parents: 3001
diff changeset
105 ypjax(_url, 'node_history', function(o){
3197
b4f401524060 html: don't use tabs
Mads Kiilerich <madski@unity3d.com>
parents: 3029
diff changeset
106 tooltip_activate();
3003
adf8ee7b8f2a fire tooltips after loading the history
Marcin Kuzminski <marcin@python-works.com>
parents: 3001
diff changeset
107 })
3001
37c7abd34d44 implements #636, lazy loading of history and authors to speed up page responsiveness.
Marcin Kuzminski <marcin@python-works.com>
parents: 2977
diff changeset
108 });
37c7abd34d44 implements #636, lazy loading of history and authors to speed up page responsiveness.
Marcin Kuzminski <marcin@python-works.com>
parents: 2977
diff changeset
109 }
2686
269c6e0b54cc Reimplemented file-browser using partial-ajax
Marcin Kuzminski <marcin@python-works.com>
parents: 2492
diff changeset
110 // Inform Google Analytics of the change
269c6e0b54cc Reimplemented file-browser using partial-ajax
Marcin Kuzminski <marcin@python-works.com>
parents: 2492
diff changeset
111 if ( typeof window.pageTracker !== 'undefined' ) {
269c6e0b54cc Reimplemented file-browser using partial-ajax
Marcin Kuzminski <marcin@python-works.com>
parents: 2492
diff changeset
112 window.pageTracker._trackPageview(State.url);
2815
acc05c33cc0c White space cleanup
Marcin Kuzminski <marcin@python-works.com>
parents: 2691
diff changeset
113 }
2686
269c6e0b54cc Reimplemented file-browser using partial-ajax
Marcin Kuzminski <marcin@python-works.com>
parents: 2492
diff changeset
114 }
269c6e0b54cc Reimplemented file-browser using partial-ajax
Marcin Kuzminski <marcin@python-works.com>
parents: 2492
diff changeset
115
2815
acc05c33cc0c White space cleanup
Marcin Kuzminski <marcin@python-works.com>
parents: 2691
diff changeset
116 YUE.onDOMReady(function(){
2686
269c6e0b54cc Reimplemented file-browser using partial-ajax
Marcin Kuzminski <marcin@python-works.com>
parents: 2492
diff changeset
117 ypjax_links();
269c6e0b54cc Reimplemented file-browser using partial-ajax
Marcin Kuzminski <marcin@python-works.com>
parents: 2492
diff changeset
118 var container = 'files_data';
269c6e0b54cc Reimplemented file-browser using partial-ajax
Marcin Kuzminski <marcin@python-works.com>
parents: 2492
diff changeset
119 //Bind to StateChange Event
269c6e0b54cc Reimplemented file-browser using partial-ajax
Marcin Kuzminski <marcin@python-works.com>
parents: 2492
diff changeset
120 History.Adapter.bind(window,'statechange',function(){
269c6e0b54cc Reimplemented file-browser using partial-ajax
Marcin Kuzminski <marcin@python-works.com>
parents: 2492
diff changeset
121 var State = History.getState();
269c6e0b54cc Reimplemented file-browser using partial-ajax
Marcin Kuzminski <marcin@python-works.com>
parents: 2492
diff changeset
122 cache_key = State.url;
269c6e0b54cc Reimplemented file-browser using partial-ajax
Marcin Kuzminski <marcin@python-works.com>
parents: 2492
diff changeset
123 //check if we have this request in cache maybe ?
269c6e0b54cc Reimplemented file-browser using partial-ajax
Marcin Kuzminski <marcin@python-works.com>
parents: 2492
diff changeset
124 var _cache_obj = CACHE[cache_key];
269c6e0b54cc Reimplemented file-browser using partial-ajax
Marcin Kuzminski <marcin@python-works.com>
parents: 2492
diff changeset
125 var _cur_time = new Date().getTime();
269c6e0b54cc Reimplemented file-browser using partial-ajax
Marcin Kuzminski <marcin@python-works.com>
parents: 2492
diff changeset
126 // get from cache if it's there and not yet expired !
269c6e0b54cc Reimplemented file-browser using partial-ajax
Marcin Kuzminski <marcin@python-works.com>
parents: 2492
diff changeset
127 if(_cache_obj !== undefined && _cache_obj[0] > _cur_time){
269c6e0b54cc Reimplemented file-browser using partial-ajax
Marcin Kuzminski <marcin@python-works.com>
parents: 2492
diff changeset
128 YUD.get(container).innerHTML=_cache_obj[1];
269c6e0b54cc Reimplemented file-browser using partial-ajax
Marcin Kuzminski <marcin@python-works.com>
parents: 2492
diff changeset
129 YUD.setStyle(container,'opacity','1.0');
269c6e0b54cc Reimplemented file-browser using partial-ajax
Marcin Kuzminski <marcin@python-works.com>
parents: 2492
diff changeset
130
269c6e0b54cc Reimplemented file-browser using partial-ajax
Marcin Kuzminski <marcin@python-works.com>
parents: 2492
diff changeset
131 //callbacks after ypjax call
269c6e0b54cc Reimplemented file-browser using partial-ajax
Marcin Kuzminski <marcin@python-works.com>
parents: 2492
diff changeset
132 callbacks(State);
269c6e0b54cc Reimplemented file-browser using partial-ajax
Marcin Kuzminski <marcin@python-works.com>
parents: 2492
diff changeset
133 }
269c6e0b54cc Reimplemented file-browser using partial-ajax
Marcin Kuzminski <marcin@python-works.com>
parents: 2492
diff changeset
134 else{
269c6e0b54cc Reimplemented file-browser using partial-ajax
Marcin Kuzminski <marcin@python-works.com>
parents: 2492
diff changeset
135 ypjax(State.url,container,function(o){
3197
b4f401524060 html: don't use tabs
Mads Kiilerich <madski@unity3d.com>
parents: 3029
diff changeset
136 //callbacks after ypjax call
b4f401524060 html: don't use tabs
Mads Kiilerich <madski@unity3d.com>
parents: 3029
diff changeset
137 callbacks(State);
b4f401524060 html: don't use tabs
Mads Kiilerich <madski@unity3d.com>
parents: 3029
diff changeset
138 if (o !== undefined){
b4f401524060 html: don't use tabs
Mads Kiilerich <madski@unity3d.com>
parents: 3029
diff changeset
139 //store our request in cache
b4f401524060 html: don't use tabs
Mads Kiilerich <madski@unity3d.com>
parents: 3029
diff changeset
140 var _expire_on = new Date().getTime()+CACHE_EXPIRE;
2686
269c6e0b54cc Reimplemented file-browser using partial-ajax
Marcin Kuzminski <marcin@python-works.com>
parents: 2492
diff changeset
141 CACHE[cache_key] = [_expire_on, o.responseText];
269c6e0b54cc Reimplemented file-browser using partial-ajax
Marcin Kuzminski <marcin@python-works.com>
parents: 2492
diff changeset
142 }
269c6e0b54cc Reimplemented file-browser using partial-ajax
Marcin Kuzminski <marcin@python-works.com>
parents: 2492
diff changeset
143 });
269c6e0b54cc Reimplemented file-browser using partial-ajax
Marcin Kuzminski <marcin@python-works.com>
parents: 2492
diff changeset
144 }
2815
acc05c33cc0c White space cleanup
Marcin Kuzminski <marcin@python-works.com>
parents: 2691
diff changeset
145 });
acc05c33cc0c White space cleanup
Marcin Kuzminski <marcin@python-works.com>
parents: 2691
diff changeset
146
2687
4d7dfda32d10 Disable the html4 history mock for old browsers.
Marcin Kuzminski <marcin@python-works.com>
parents: 2686
diff changeset
147 // init the search filter
4d7dfda32d10 Disable the html4 history mock for old browsers.
Marcin Kuzminski <marcin@python-works.com>
parents: 2686
diff changeset
148 var _State = {
4d7dfda32d10 Disable the html4 history mock for old browsers.
Marcin Kuzminski <marcin@python-works.com>
parents: 2686
diff changeset
149 url: "${h.url.current()}",
4d7dfda32d10 Disable the html4 history mock for old browsers.
Marcin Kuzminski <marcin@python-works.com>
parents: 2686
diff changeset
150 data: {
2891
9812e617c564 fix files quick filter links
Marcin Kuzminski <marcin@python-works.com>
parents: 2867
diff changeset
151 node_list_url: node_list_url.replace('__REV__',"${c.changeset.raw_id}").replace('__FPATH__', "${h.safe_unicode(c.file.path)}"),
3001
37c7abd34d44 implements #636, lazy loading of history and authors to speed up page responsiveness.
Marcin Kuzminski <marcin@python-works.com>
parents: 2977
diff changeset
152 url_base: url_base.replace('__REV__',"${c.changeset.raw_id}"),
37c7abd34d44 implements #636, lazy loading of history and authors to speed up page responsiveness.
Marcin Kuzminski <marcin@python-works.com>
parents: 2977
diff changeset
153 rev:"${c.changeset.raw_id}",
37c7abd34d44 implements #636, lazy loading of history and authors to speed up page responsiveness.
Marcin Kuzminski <marcin@python-works.com>
parents: 2977
diff changeset
154 f_path: "${h.safe_unicode(c.file.path)}"
2687
4d7dfda32d10 Disable the html4 history mock for old browsers.
Marcin Kuzminski <marcin@python-works.com>
parents: 2686
diff changeset
155 }
4d7dfda32d10 Disable the html4 history mock for old browsers.
Marcin Kuzminski <marcin@python-works.com>
parents: 2686
diff changeset
156 }
4d7dfda32d10 Disable the html4 history mock for old browsers.
Marcin Kuzminski <marcin@python-works.com>
parents: 2686
diff changeset
157 fileBrowserListeners(_State.url, _State.data.node_list_url, _State.data.url_base);
2686
269c6e0b54cc Reimplemented file-browser using partial-ajax
Marcin Kuzminski <marcin@python-works.com>
parents: 2492
diff changeset
158 });
269c6e0b54cc Reimplemented file-browser using partial-ajax
Marcin Kuzminski <marcin@python-works.com>
parents: 2492
diff changeset
159
1699
623b228cf325 cleaned up JS files in files templates.
Marcin Kuzminski <marcin@python-works.com>
parents: 644
diff changeset
160 </script>
2686
269c6e0b54cc Reimplemented file-browser using partial-ajax
Marcin Kuzminski <marcin@python-works.com>
parents: 2492
diff changeset
161
1888
f91d3f9b7230 White-space cleanup
Marcin Kuzminski <marcin@python-works.com>
parents: 1749
diff changeset
162 </%def>