Mercurial > kallithea
annotate rhodecode/templates/files/files.html @ 3019:e85380f05a5e beta
implements #657 added table rendering support for markdown
author | Marcin Kuzminski <marcin@python-works.com> |
---|---|
date | Fri, 23 Nov 2012 13:27:34 +0100 |
parents | adf8ee7b8f2a |
children | 685ebc84c2e9 |
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 » |
558eb7c5028f
version bump to 0.8
Marcin Kuzminski <marcin@python-works.com>
parents:
278
diff
changeset
|
10 ${h.link_to(c.repo_name,h.url('files_home',repo_name=c.repo_name))} |
558eb7c5028f
version bump to 0.8
Marcin Kuzminski <marcin@python-works.com>
parents:
278
diff
changeset
|
11 » |
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()"> |
362
558eb7c5028f
version bump to 0.8
Marcin Kuzminski <marcin@python-works.com>
parents:
278
diff
changeset
|
23 <div class="box"> |
558eb7c5028f
version bump to 0.8
Marcin Kuzminski <marcin@python-works.com>
parents:
278
diff
changeset
|
24 <!-- box / title --> |
558eb7c5028f
version bump to 0.8
Marcin Kuzminski <marcin@python-works.com>
parents:
278
diff
changeset
|
25 <div class="title"> |
644
c8bd0e6cc3da
some changes for #45.
Marcin Kuzminski <marcin@python-works.com>
parents:
636
diff
changeset
|
26 ${self.breadcrumbs()} |
c8bd0e6cc3da
some changes for #45.
Marcin Kuzminski <marcin@python-works.com>
parents:
636
diff
changeset
|
27 <ul class="links"> |
c8bd0e6cc3da
some changes for #45.
Marcin Kuzminski <marcin@python-works.com>
parents:
636
diff
changeset
|
28 <li> |
c8bd0e6cc3da
some changes for #45.
Marcin Kuzminski <marcin@python-works.com>
parents:
636
diff
changeset
|
29 <span style="text-transform: uppercase;"><a href="#">${_('branch')}: ${c.changeset.branch}</a></span> |
1888
f91d3f9b7230
White-space cleanup
Marcin Kuzminski <marcin@python-works.com>
parents:
1749
diff
changeset
|
30 </li> |
f91d3f9b7230
White-space cleanup
Marcin Kuzminski <marcin@python-works.com>
parents:
1749
diff
changeset
|
31 </ul> |
362
558eb7c5028f
version bump to 0.8
Marcin Kuzminski <marcin@python-works.com>
parents:
278
diff
changeset
|
32 </div> |
558eb7c5028f
version bump to 0.8
Marcin Kuzminski <marcin@python-works.com>
parents:
278
diff
changeset
|
33 <div class="table"> |
558eb7c5028f
version bump to 0.8
Marcin Kuzminski <marcin@python-works.com>
parents:
278
diff
changeset
|
34 <div id="files_data"> |
1699
623b228cf325
cleaned up JS files in files templates.
Marcin Kuzminski <marcin@python-works.com>
parents:
644
diff
changeset
|
35 <%include file='files_ypjax.html'/> |
1888
f91d3f9b7230
White-space cleanup
Marcin Kuzminski <marcin@python-works.com>
parents:
1749
diff
changeset
|
36 </div> |
362
558eb7c5028f
version bump to 0.8
Marcin Kuzminski <marcin@python-works.com>
parents:
278
diff
changeset
|
37 </div> |
1888
f91d3f9b7230
White-space cleanup
Marcin Kuzminski <marcin@python-works.com>
parents:
1749
diff
changeset
|
38 </div> |
2686
269c6e0b54cc
Reimplemented file-browser using partial-ajax
Marcin Kuzminski <marcin@python-works.com>
parents:
2492
diff
changeset
|
39 |
1699
623b228cf325
cleaned up JS files in files templates.
Marcin Kuzminski <marcin@python-works.com>
parents:
644
diff
changeset
|
40 <script type="text/javascript"> |
2686
269c6e0b54cc
Reimplemented file-browser using partial-ajax
Marcin Kuzminski <marcin@python-works.com>
parents:
2492
diff
changeset
|
41 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
|
42 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
|
43 //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
|
44 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
|
45 //send the nodelist request to this url |
2891
9812e617c564
fix files quick filter links
Marcin Kuzminski <marcin@python-works.com>
parents:
2867
diff
changeset
|
46 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
|
47 // 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
|
48 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
|
49 |
269c6e0b54cc
Reimplemented file-browser using partial-ajax
Marcin Kuzminski <marcin@python-works.com>
parents:
2492
diff
changeset
|
50 var ypjax_links = function(){ |
269c6e0b54cc
Reimplemented file-browser using partial-ajax
Marcin Kuzminski <marcin@python-works.com>
parents:
2492
diff
changeset
|
51 YUE.on(YUQ('.ypjax-link'), 'click',function(e){ |
2815
acc05c33cc0c
White space cleanup
Marcin Kuzminski <marcin@python-works.com>
parents:
2691
diff
changeset
|
52 |
2686
269c6e0b54cc
Reimplemented file-browser using partial-ajax
Marcin Kuzminski <marcin@python-works.com>
parents:
2492
diff
changeset
|
53 //don't do ypjax on middle click |
2815
acc05c33cc0c
White space cleanup
Marcin Kuzminski <marcin@python-works.com>
parents:
2691
diff
changeset
|
54 if(e.which == 2 || !History.enabled){ |
2686
269c6e0b54cc
Reimplemented file-browser using partial-ajax
Marcin Kuzminski <marcin@python-works.com>
parents:
2492
diff
changeset
|
55 return true; |
269c6e0b54cc
Reimplemented file-browser using partial-ajax
Marcin Kuzminski <marcin@python-works.com>
parents:
2492
diff
changeset
|
56 } |
2815
acc05c33cc0c
White space cleanup
Marcin Kuzminski <marcin@python-works.com>
parents:
2691
diff
changeset
|
57 |
2686
269c6e0b54cc
Reimplemented file-browser using partial-ajax
Marcin Kuzminski <marcin@python-works.com>
parents:
2492
diff
changeset
|
58 var el = e.currentTarget; |
269c6e0b54cc
Reimplemented file-browser using partial-ajax
Marcin Kuzminski <marcin@python-works.com>
parents:
2492
diff
changeset
|
59 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
|
60 |
2686
269c6e0b54cc
Reimplemented file-browser using partial-ajax
Marcin Kuzminski <marcin@python-works.com>
parents:
2492
diff
changeset
|
61 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
|
62 _base_url = _base_url.replace('//','/') |
2815
acc05c33cc0c
White space cleanup
Marcin Kuzminski <marcin@python-works.com>
parents:
2691
diff
changeset
|
63 |
2686
269c6e0b54cc
Reimplemented file-browser using partial-ajax
Marcin Kuzminski <marcin@python-works.com>
parents:
2492
diff
changeset
|
64 //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
|
65 parts = url.split(_base_url) |
269c6e0b54cc
Reimplemented file-browser using partial-ajax
Marcin Kuzminski <marcin@python-works.com>
parents:
2492
diff
changeset
|
66 if(parts.length != 2){ |
269c6e0b54cc
Reimplemented file-browser using partial-ajax
Marcin Kuzminski <marcin@python-works.com>
parents:
2492
diff
changeset
|
67 return false; |
269c6e0b54cc
Reimplemented file-browser using partial-ajax
Marcin Kuzminski <marcin@python-works.com>
parents:
2492
diff
changeset
|
68 } |
2815
acc05c33cc0c
White space cleanup
Marcin Kuzminski <marcin@python-works.com>
parents:
2691
diff
changeset
|
69 |
2686
269c6e0b54cc
Reimplemented file-browser using partial-ajax
Marcin Kuzminski <marcin@python-works.com>
parents:
2492
diff
changeset
|
70 var parts2 = parts[1].split('/'); |
269c6e0b54cc
Reimplemented file-browser using partial-ajax
Marcin Kuzminski <marcin@python-works.com>
parents:
2492
diff
changeset
|
71 var rev = parts2.shift(); // pop the first element which is the revision |
269c6e0b54cc
Reimplemented file-browser using partial-ajax
Marcin Kuzminski <marcin@python-works.com>
parents:
2492
diff
changeset
|
72 var f_path = parts2.join('/'); |
2815
acc05c33cc0c
White space cleanup
Marcin Kuzminski <marcin@python-works.com>
parents:
2691
diff
changeset
|
73 |
2686
269c6e0b54cc
Reimplemented file-browser using partial-ajax
Marcin Kuzminski <marcin@python-works.com>
parents:
2492
diff
changeset
|
74 var title = "${_('%s files') % c.repo_name}" + " - " + f_path; |
2815
acc05c33cc0c
White space cleanup
Marcin Kuzminski <marcin@python-works.com>
parents:
2691
diff
changeset
|
75 |
2891
9812e617c564
fix files quick filter links
Marcin Kuzminski <marcin@python-works.com>
parents:
2867
diff
changeset
|
76 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
|
77 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
|
78 |
2686
269c6e0b54cc
Reimplemented file-browser using partial-ajax
Marcin Kuzminski <marcin@python-works.com>
parents:
2492
diff
changeset
|
79 // 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
|
80 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
|
81 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
|
82 History.pushState(data, title, url); |
acc05c33cc0c
White space cleanup
Marcin Kuzminski <marcin@python-works.com>
parents:
2691
diff
changeset
|
83 |
2686
269c6e0b54cc
Reimplemented file-browser using partial-ajax
Marcin Kuzminski <marcin@python-works.com>
parents:
2492
diff
changeset
|
84 //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
|
85 YUE.preventDefault(e); |
2686
269c6e0b54cc
Reimplemented file-browser using partial-ajax
Marcin Kuzminski <marcin@python-works.com>
parents:
2492
diff
changeset
|
86 return false; |
269c6e0b54cc
Reimplemented file-browser using partial-ajax
Marcin Kuzminski <marcin@python-works.com>
parents:
2492
diff
changeset
|
87 }); |
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 var callbacks = function(State){ |
269c6e0b54cc
Reimplemented file-browser using partial-ajax
Marcin Kuzminski <marcin@python-works.com>
parents:
2492
diff
changeset
|
91 ypjax_links(); |
269c6e0b54cc
Reimplemented file-browser using partial-ajax
Marcin Kuzminski <marcin@python-works.com>
parents:
2492
diff
changeset
|
92 tooltip_activate(); |
269c6e0b54cc
Reimplemented file-browser using partial-ajax
Marcin Kuzminski <marcin@python-works.com>
parents:
2492
diff
changeset
|
93 fileBrowserListeners(State.url, State.data.node_list_url, State.data.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
|
94 |
37c7abd34d44
implements #636, lazy loading of history and authors to speed up page responsiveness.
Marcin Kuzminski <marcin@python-works.com>
parents:
2977
diff
changeset
|
95 if(YUD.get('hlcode')){ |
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 YUE.on('hlcode', 'mouseup', getSelectionLink); |
37c7abd34d44
implements #636, lazy loading of history and authors to speed up page responsiveness.
Marcin Kuzminski <marcin@python-works.com>
parents:
2977
diff
changeset
|
97 } |
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 //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
|
99 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
|
100 //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
|
101 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
|
102 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
|
103 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
|
104 ypjax(_url, 'node_history', function(o){ |
adf8ee7b8f2a
fire tooltips after loading the history
Marcin Kuzminski <marcin@python-works.com>
parents:
3001
diff
changeset
|
105 tooltip_activate(); |
adf8ee7b8f2a
fire tooltips after loading the history
Marcin Kuzminski <marcin@python-works.com>
parents:
3001
diff
changeset
|
106 }) |
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
|
107 }); |
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 } |
2686
269c6e0b54cc
Reimplemented file-browser using partial-ajax
Marcin Kuzminski <marcin@python-works.com>
parents:
2492
diff
changeset
|
109 // Inform Google Analytics of the change |
269c6e0b54cc
Reimplemented file-browser using partial-ajax
Marcin Kuzminski <marcin@python-works.com>
parents:
2492
diff
changeset
|
110 if ( typeof window.pageTracker !== 'undefined' ) { |
269c6e0b54cc
Reimplemented file-browser using partial-ajax
Marcin Kuzminski <marcin@python-works.com>
parents:
2492
diff
changeset
|
111 window.pageTracker._trackPageview(State.url); |
2815
acc05c33cc0c
White space cleanup
Marcin Kuzminski <marcin@python-works.com>
parents:
2691
diff
changeset
|
112 } |
2686
269c6e0b54cc
Reimplemented file-browser using partial-ajax
Marcin Kuzminski <marcin@python-works.com>
parents:
2492
diff
changeset
|
113 } |
269c6e0b54cc
Reimplemented file-browser using partial-ajax
Marcin Kuzminski <marcin@python-works.com>
parents:
2492
diff
changeset
|
114 |
2815
acc05c33cc0c
White space cleanup
Marcin Kuzminski <marcin@python-works.com>
parents:
2691
diff
changeset
|
115 YUE.onDOMReady(function(){ |
2686
269c6e0b54cc
Reimplemented file-browser using partial-ajax
Marcin Kuzminski <marcin@python-works.com>
parents:
2492
diff
changeset
|
116 ypjax_links(); |
269c6e0b54cc
Reimplemented file-browser using partial-ajax
Marcin Kuzminski <marcin@python-works.com>
parents:
2492
diff
changeset
|
117 var container = 'files_data'; |
269c6e0b54cc
Reimplemented file-browser using partial-ajax
Marcin Kuzminski <marcin@python-works.com>
parents:
2492
diff
changeset
|
118 //Bind to StateChange Event |
269c6e0b54cc
Reimplemented file-browser using partial-ajax
Marcin Kuzminski <marcin@python-works.com>
parents:
2492
diff
changeset
|
119 History.Adapter.bind(window,'statechange',function(){ |
269c6e0b54cc
Reimplemented file-browser using partial-ajax
Marcin Kuzminski <marcin@python-works.com>
parents:
2492
diff
changeset
|
120 var State = History.getState(); |
269c6e0b54cc
Reimplemented file-browser using partial-ajax
Marcin Kuzminski <marcin@python-works.com>
parents:
2492
diff
changeset
|
121 cache_key = State.url; |
269c6e0b54cc
Reimplemented file-browser using partial-ajax
Marcin Kuzminski <marcin@python-works.com>
parents:
2492
diff
changeset
|
122 //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
|
123 var _cache_obj = CACHE[cache_key]; |
269c6e0b54cc
Reimplemented file-browser using partial-ajax
Marcin Kuzminski <marcin@python-works.com>
parents:
2492
diff
changeset
|
124 var _cur_time = new Date().getTime(); |
269c6e0b54cc
Reimplemented file-browser using partial-ajax
Marcin Kuzminski <marcin@python-works.com>
parents:
2492
diff
changeset
|
125 // 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
|
126 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
|
127 YUD.get(container).innerHTML=_cache_obj[1]; |
269c6e0b54cc
Reimplemented file-browser using partial-ajax
Marcin Kuzminski <marcin@python-works.com>
parents:
2492
diff
changeset
|
128 YUD.setStyle(container,'opacity','1.0'); |
269c6e0b54cc
Reimplemented file-browser using partial-ajax
Marcin Kuzminski <marcin@python-works.com>
parents:
2492
diff
changeset
|
129 |
269c6e0b54cc
Reimplemented file-browser using partial-ajax
Marcin Kuzminski <marcin@python-works.com>
parents:
2492
diff
changeset
|
130 //callbacks after ypjax call |
269c6e0b54cc
Reimplemented file-browser using partial-ajax
Marcin Kuzminski <marcin@python-works.com>
parents:
2492
diff
changeset
|
131 callbacks(State); |
269c6e0b54cc
Reimplemented file-browser using partial-ajax
Marcin Kuzminski <marcin@python-works.com>
parents:
2492
diff
changeset
|
132 } |
269c6e0b54cc
Reimplemented file-browser using partial-ajax
Marcin Kuzminski <marcin@python-works.com>
parents:
2492
diff
changeset
|
133 else{ |
269c6e0b54cc
Reimplemented file-browser using partial-ajax
Marcin Kuzminski <marcin@python-works.com>
parents:
2492
diff
changeset
|
134 ypjax(State.url,container,function(o){ |
269c6e0b54cc
Reimplemented file-browser using partial-ajax
Marcin Kuzminski <marcin@python-works.com>
parents:
2492
diff
changeset
|
135 //callbacks after ypjax call |
269c6e0b54cc
Reimplemented file-browser using partial-ajax
Marcin Kuzminski <marcin@python-works.com>
parents:
2492
diff
changeset
|
136 callbacks(State); |
269c6e0b54cc
Reimplemented file-browser using partial-ajax
Marcin Kuzminski <marcin@python-works.com>
parents:
2492
diff
changeset
|
137 if (o !== undefined){ |
269c6e0b54cc
Reimplemented file-browser using partial-ajax
Marcin Kuzminski <marcin@python-works.com>
parents:
2492
diff
changeset
|
138 //store our request in cache |
269c6e0b54cc
Reimplemented file-browser using partial-ajax
Marcin Kuzminski <marcin@python-works.com>
parents:
2492
diff
changeset
|
139 var _expire_on = new Date().getTime()+CACHE_EXPIRE; |
269c6e0b54cc
Reimplemented file-browser using partial-ajax
Marcin Kuzminski <marcin@python-works.com>
parents:
2492
diff
changeset
|
140 CACHE[cache_key] = [_expire_on, o.responseText]; |
269c6e0b54cc
Reimplemented file-browser using partial-ajax
Marcin Kuzminski <marcin@python-works.com>
parents:
2492
diff
changeset
|
141 } |
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 } |
2815
acc05c33cc0c
White space cleanup
Marcin Kuzminski <marcin@python-works.com>
parents:
2691
diff
changeset
|
144 }); |
acc05c33cc0c
White space cleanup
Marcin Kuzminski <marcin@python-works.com>
parents:
2691
diff
changeset
|
145 |
2687
4d7dfda32d10
Disable the html4 history mock for old browsers.
Marcin Kuzminski <marcin@python-works.com>
parents:
2686
diff
changeset
|
146 // init the search filter |
4d7dfda32d10
Disable the html4 history mock for old browsers.
Marcin Kuzminski <marcin@python-works.com>
parents:
2686
diff
changeset
|
147 var _State = { |
4d7dfda32d10
Disable the html4 history mock for old browsers.
Marcin Kuzminski <marcin@python-works.com>
parents:
2686
diff
changeset
|
148 url: "${h.url.current()}", |
4d7dfda32d10
Disable the html4 history mock for old browsers.
Marcin Kuzminski <marcin@python-works.com>
parents:
2686
diff
changeset
|
149 data: { |
2891
9812e617c564
fix files quick filter links
Marcin Kuzminski <marcin@python-works.com>
parents:
2867
diff
changeset
|
150 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
|
151 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
|
152 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 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
|
154 } |
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 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
|
157 }); |
269c6e0b54cc
Reimplemented file-browser using partial-ajax
Marcin Kuzminski <marcin@python-works.com>
parents:
2492
diff
changeset
|
158 |
1699
623b228cf325
cleaned up JS files in files templates.
Marcin Kuzminski <marcin@python-works.com>
parents:
644
diff
changeset
|
159 </script> |
2686
269c6e0b54cc
Reimplemented file-browser using partial-ajax
Marcin Kuzminski <marcin@python-works.com>
parents:
2492
diff
changeset
|
160 |
1888
f91d3f9b7230
White-space cleanup
Marcin Kuzminski <marcin@python-works.com>
parents:
1749
diff
changeset
|
161 </%def> |