Mercurial > kallithea
annotate rhodecode/templates/files/files_source.html @ 1483:7b67b0dcad6d beta
Added initial support for creating new nodes in repos
author | Marcin Kuzminski <marcin@python-works.com> |
---|---|
date | Thu, 22 Sep 2011 04:33:29 +0300 |
parents | aaec08ad9daf |
children | bf263968da47 623b228cf325 |
rev | line source |
---|---|
362
558eb7c5028f
version bump to 0.8
Marcin Kuzminski <marcin@python-works.com>
parents:
278
diff
changeset
|
1 <dl> |
802
4a7432d0a1a5
fixed file source and annotation revision links
Marcin Kuzminski <marcin@python-works.com>
parents:
644
diff
changeset
|
2 <dt>${_('Revision')}</dt> |
410
9a7ae16ff53e
fixes translations, style updates.
Marcin Kuzminski <marcin@python-works.com>
parents:
387
diff
changeset
|
3 <dd> |
636
ffd07396d315
Fixes for raw_id, needed for git
Marcin Kuzminski <marcin@python-works.com>
parents:
547
diff
changeset
|
4 ${h.link_to("r%s:%s" % (c.files_list.last_changeset.revision,h.short_id(c.files_list.last_changeset.raw_id)), |
802
4a7432d0a1a5
fixed file source and annotation revision links
Marcin Kuzminski <marcin@python-works.com>
parents:
644
diff
changeset
|
5 h.url('changeset_home',repo_name=c.repo_name,revision=c.files_list.last_changeset.raw_id))} |
410
9a7ae16ff53e
fixes translations, style updates.
Marcin Kuzminski <marcin@python-works.com>
parents:
387
diff
changeset
|
6 </dd> |
128
9deb6f1d5b90
Implemented file history.
Marcin Kuzminski <marcin@python-works.com>
parents:
diff
changeset
|
7 <dt>${_('Size')}</dt> |
167
e5a25c57c97f
files source updated to use webhelpers huminizer for file size, and added link to annotation
Marcin Kuzminski <marcin@python-works.com>
parents:
158
diff
changeset
|
8 <dd>${h.format_byte_size(c.files_list.size,binary=True)}</dd> |
495
15f837c62fa5
added mimetypes to files
Marcin Kuzminski <marcin@python-works.com>
parents:
485
diff
changeset
|
9 <dt>${_('Mimetype')}</dt> |
15f837c62fa5
added mimetypes to files
Marcin Kuzminski <marcin@python-works.com>
parents:
485
diff
changeset
|
10 <dd>${c.files_list.mimetype}</dd> |
128
9deb6f1d5b90
Implemented file history.
Marcin Kuzminski <marcin@python-works.com>
parents:
diff
changeset
|
11 <dt>${_('Options')}</dt> |
278
ed7abf925696
#4: changes proposed by feedback to annotation
Marcin Kuzminski <marcin@python-works.com>
parents:
267
diff
changeset
|
12 <dd>${h.link_to(_('show annotation'), |
644
c8bd0e6cc3da
some changes for #45.
Marcin Kuzminski <marcin@python-works.com>
parents:
636
diff
changeset
|
13 h.url('files_annotate_home',repo_name=c.repo_name,revision=c.changeset.raw_id,f_path=c.f_path))} |
485
9836541b0509
added limit for showing pygemntized source codes larger than 250kb.
Marcin Kuzminski <marcin@python-works.com>
parents:
413
diff
changeset
|
14 / ${h.link_to(_('show as raw'), |
644
c8bd0e6cc3da
some changes for #45.
Marcin Kuzminski <marcin@python-works.com>
parents:
636
diff
changeset
|
15 h.url('files_raw_home',repo_name=c.repo_name,revision=c.changeset.raw_id,f_path=c.f_path))} |
278
ed7abf925696
#4: changes proposed by feedback to annotation
Marcin Kuzminski <marcin@python-works.com>
parents:
267
diff
changeset
|
16 / ${h.link_to(_('download as raw'), |
644
c8bd0e6cc3da
some changes for #45.
Marcin Kuzminski <marcin@python-works.com>
parents:
636
diff
changeset
|
17 h.url('files_rawfile_home',repo_name=c.repo_name,revision=c.changeset.raw_id,f_path=c.f_path))} |
1305
166317d464f3
Added server side file editing with commit
Marcin Kuzminski <marcin@python-works.com>
parents:
1304
diff
changeset
|
18 % if h.HasRepoPermissionAny('repository.write','repository.admin')(c.repo_name): |
1313
856be614d9a4
disabled edition of binary files
Marcin Kuzminski <marcin@python-works.com>
parents:
1305
diff
changeset
|
19 % if not c.files_list.is_binary: |
1305
166317d464f3
Added server side file editing with commit
Marcin Kuzminski <marcin@python-works.com>
parents:
1304
diff
changeset
|
20 / ${h.link_to(_('edit'), |
166317d464f3
Added server side file editing with commit
Marcin Kuzminski <marcin@python-works.com>
parents:
1304
diff
changeset
|
21 h.url('files_edit_home',repo_name=c.repo_name,revision=c.changeset.raw_id,f_path=c.f_path))} |
1313
856be614d9a4
disabled edition of binary files
Marcin Kuzminski <marcin@python-works.com>
parents:
1305
diff
changeset
|
22 % endif |
1305
166317d464f3
Added server side file editing with commit
Marcin Kuzminski <marcin@python-works.com>
parents:
1304
diff
changeset
|
23 % endif |
278
ed7abf925696
#4: changes proposed by feedback to annotation
Marcin Kuzminski <marcin@python-works.com>
parents:
267
diff
changeset
|
24 </dd> |
128
9deb6f1d5b90
Implemented file history.
Marcin Kuzminski <marcin@python-works.com>
parents:
diff
changeset
|
25 <dt>${_('History')}</dt> |
9deb6f1d5b90
Implemented file history.
Marcin Kuzminski <marcin@python-works.com>
parents:
diff
changeset
|
26 <dd> |
410
9a7ae16ff53e
fixes translations, style updates.
Marcin Kuzminski <marcin@python-works.com>
parents:
387
diff
changeset
|
27 <div> |
9a7ae16ff53e
fixes translations, style updates.
Marcin Kuzminski <marcin@python-works.com>
parents:
387
diff
changeset
|
28 ${h.form(h.url('files_diff_home',repo_name=c.repo_name,f_path=c.f_path),method='get')} |
636
ffd07396d315
Fixes for raw_id, needed for git
Marcin Kuzminski <marcin@python-works.com>
parents:
547
diff
changeset
|
29 ${h.hidden('diff2',c.files_list.last_changeset.raw_id)} |
ffd07396d315
Fixes for raw_id, needed for git
Marcin Kuzminski <marcin@python-works.com>
parents:
547
diff
changeset
|
30 ${h.select('diff1',c.files_list.last_changeset.raw_id,c.file_history)} |
1304
5a96551ee9c0
gui-improvments
Marcin Kuzminski <marcin@python-works.com>
parents:
1241
diff
changeset
|
31 ${h.submit('diff','diff to revision',class_="ui-button-small")} |
5a96551ee9c0
gui-improvments
Marcin Kuzminski <marcin@python-works.com>
parents:
1241
diff
changeset
|
32 ${h.submit('show_rev','show at revision',class_="ui-button-small")} |
128
9deb6f1d5b90
Implemented file history.
Marcin Kuzminski <marcin@python-works.com>
parents:
diff
changeset
|
33 ${h.end_form()} |
410
9a7ae16ff53e
fixes translations, style updates.
Marcin Kuzminski <marcin@python-works.com>
parents:
387
diff
changeset
|
34 </div> |
128
9deb6f1d5b90
Implemented file history.
Marcin Kuzminski <marcin@python-works.com>
parents:
diff
changeset
|
35 </dd> |
362
558eb7c5028f
version bump to 0.8
Marcin Kuzminski <marcin@python-works.com>
parents:
278
diff
changeset
|
36 </dl> |
558eb7c5028f
version bump to 0.8
Marcin Kuzminski <marcin@python-works.com>
parents:
278
diff
changeset
|
37 |
558eb7c5028f
version bump to 0.8
Marcin Kuzminski <marcin@python-works.com>
parents:
278
diff
changeset
|
38 |
128
9deb6f1d5b90
Implemented file history.
Marcin Kuzminski <marcin@python-works.com>
parents:
diff
changeset
|
39 <div id="body" class="codeblock"> |
144
ea89ac73bef8
Update css +file browsing and diffs
Marcin Kuzminski <marcin@python-works.com>
parents:
129
diff
changeset
|
40 <div class="code-header"> |
636
ffd07396d315
Fixes for raw_id, needed for git
Marcin Kuzminski <marcin@python-works.com>
parents:
547
diff
changeset
|
41 <div class="revision">${c.files_list.name}@r${c.files_list.last_changeset.revision}:${h.short_id(c.files_list.last_changeset.raw_id)}</div> |
387
2a18192fbd1e
templating updates (font sizes)
Marcin Kuzminski <marcin@python-works.com>
parents:
362
diff
changeset
|
42 <div class="commit">"${c.files_list.last_changeset.message}"</div> |
144
ea89ac73bef8
Update css +file browsing and diffs
Marcin Kuzminski <marcin@python-works.com>
parents:
129
diff
changeset
|
43 </div> |
ea89ac73bef8
Update css +file browsing and diffs
Marcin Kuzminski <marcin@python-works.com>
parents:
129
diff
changeset
|
44 <div class="code-body"> |
1043
6ec53c16c744
fixed binary file issues
Marcin Kuzminski <marcin@python-works.com>
parents:
1035
diff
changeset
|
45 %if c.files_list.is_binary: |
1241
ed5270522724
changed raw action to show images instead of saying about binary file
Marcin Kuzminski <marcin@python-works.com>
parents:
1043
diff
changeset
|
46 ${_('Binary file (%s)') % c.files_list.mimetype} |
1043
6ec53c16c744
fixed binary file issues
Marcin Kuzminski <marcin@python-works.com>
parents:
1035
diff
changeset
|
47 %else: |
813
e8b5be26fb78
fixed small issue made on latest patches
Marcin Kuzminski <marcin@python-works.com>
parents:
802
diff
changeset
|
48 % if c.files_list.size < c.cut_off_limit: |
965
5da1286ddd28
#107 added single line highlight
Marcin Kuzminski <marcin@python-works.com>
parents:
888
diff
changeset
|
49 ${h.pygmentize(c.files_list,linenos=True,anchorlinenos=True,lineanchors='L',cssclass="code-highlight")} |
485
9836541b0509
added limit for showing pygemntized source codes larger than 250kb.
Marcin Kuzminski <marcin@python-works.com>
parents:
413
diff
changeset
|
50 %else: |
1472
aaec08ad9daf
Added pt_BR localization, added i18n wrappers on some places missing, fixed css in settings screen for longer labels.
Augusto Herrmann <augusto.herrmann@planejamento.gov.br>
parents:
1322
diff
changeset
|
51 ${_('File is too big to display')} ${h.link_to(_('show as raw'), |
644
c8bd0e6cc3da
some changes for #45.
Marcin Kuzminski <marcin@python-works.com>
parents:
636
diff
changeset
|
52 h.url('files_raw_home',repo_name=c.repo_name,revision=c.changeset.raw_id,f_path=c.f_path))} |
485
9836541b0509
added limit for showing pygemntized source codes larger than 250kb.
Marcin Kuzminski <marcin@python-works.com>
parents:
413
diff
changeset
|
53 %endif |
969
6e070138d173
implemented #107 variable lines can be now highlighted
Marcin Kuzminski <marcin@python-works.com>
parents:
965
diff
changeset
|
54 <script type="text/javascript"> |
6e070138d173
implemented #107 variable lines can be now highlighted
Marcin Kuzminski <marcin@python-works.com>
parents:
965
diff
changeset
|
55 function highlight_lines(lines){ |
6e070138d173
implemented #107 variable lines can be now highlighted
Marcin Kuzminski <marcin@python-works.com>
parents:
965
diff
changeset
|
56 for(pos in lines){ |
6e070138d173
implemented #107 variable lines can be now highlighted
Marcin Kuzminski <marcin@python-works.com>
parents:
965
diff
changeset
|
57 YUD.setStyle('L'+lines[pos],'background-color','#FFFFBE'); |
1320
09c3fb460fcb
Fixed problem with anchor link positioning when passed in ranges.
Marcin Kuzminski <marcin@python-works.com>
parents:
1313
diff
changeset
|
58 } |
969
6e070138d173
implemented #107 variable lines can be now highlighted
Marcin Kuzminski <marcin@python-works.com>
parents:
965
diff
changeset
|
59 } |
6e070138d173
implemented #107 variable lines can be now highlighted
Marcin Kuzminski <marcin@python-works.com>
parents:
965
diff
changeset
|
60 page_highlights = location.href.substring(location.href.indexOf('#')+1).split('L'); |
6e070138d173
implemented #107 variable lines can be now highlighted
Marcin Kuzminski <marcin@python-works.com>
parents:
965
diff
changeset
|
61 if (page_highlights.length == 2){ |
6e070138d173
implemented #107 variable lines can be now highlighted
Marcin Kuzminski <marcin@python-works.com>
parents:
965
diff
changeset
|
62 highlight_ranges = page_highlights[1].split(","); |
6e070138d173
implemented #107 variable lines can be now highlighted
Marcin Kuzminski <marcin@python-works.com>
parents:
965
diff
changeset
|
63 |
6e070138d173
implemented #107 variable lines can be now highlighted
Marcin Kuzminski <marcin@python-works.com>
parents:
965
diff
changeset
|
64 var h_lines = []; |
6e070138d173
implemented #107 variable lines can be now highlighted
Marcin Kuzminski <marcin@python-works.com>
parents:
965
diff
changeset
|
65 for (pos in highlight_ranges){ |
6e070138d173
implemented #107 variable lines can be now highlighted
Marcin Kuzminski <marcin@python-works.com>
parents:
965
diff
changeset
|
66 var _range = highlight_ranges[pos].split('-'); |
6e070138d173
implemented #107 variable lines can be now highlighted
Marcin Kuzminski <marcin@python-works.com>
parents:
965
diff
changeset
|
67 if(_range.length == 2){ |
6e070138d173
implemented #107 variable lines can be now highlighted
Marcin Kuzminski <marcin@python-works.com>
parents:
965
diff
changeset
|
68 var start = parseInt(_range[0]); |
6e070138d173
implemented #107 variable lines can be now highlighted
Marcin Kuzminski <marcin@python-works.com>
parents:
965
diff
changeset
|
69 var end = parseInt(_range[1]); |
6e070138d173
implemented #107 variable lines can be now highlighted
Marcin Kuzminski <marcin@python-works.com>
parents:
965
diff
changeset
|
70 if (start < end){ |
6e070138d173
implemented #107 variable lines can be now highlighted
Marcin Kuzminski <marcin@python-works.com>
parents:
965
diff
changeset
|
71 for(var i=start;i<=end;i++){ |
6e070138d173
implemented #107 variable lines can be now highlighted
Marcin Kuzminski <marcin@python-works.com>
parents:
965
diff
changeset
|
72 h_lines.push(i); |
6e070138d173
implemented #107 variable lines can be now highlighted
Marcin Kuzminski <marcin@python-works.com>
parents:
965
diff
changeset
|
73 } |
6e070138d173
implemented #107 variable lines can be now highlighted
Marcin Kuzminski <marcin@python-works.com>
parents:
965
diff
changeset
|
74 } |
6e070138d173
implemented #107 variable lines can be now highlighted
Marcin Kuzminski <marcin@python-works.com>
parents:
965
diff
changeset
|
75 } |
6e070138d173
implemented #107 variable lines can be now highlighted
Marcin Kuzminski <marcin@python-works.com>
parents:
965
diff
changeset
|
76 else{ |
6e070138d173
implemented #107 variable lines can be now highlighted
Marcin Kuzminski <marcin@python-works.com>
parents:
965
diff
changeset
|
77 h_lines.push(parseInt(highlight_ranges[pos])); |
6e070138d173
implemented #107 variable lines can be now highlighted
Marcin Kuzminski <marcin@python-works.com>
parents:
965
diff
changeset
|
78 } |
6e070138d173
implemented #107 variable lines can be now highlighted
Marcin Kuzminski <marcin@python-works.com>
parents:
965
diff
changeset
|
79 } |
1320
09c3fb460fcb
Fixed problem with anchor link positioning when passed in ranges.
Marcin Kuzminski <marcin@python-works.com>
parents:
1313
diff
changeset
|
80 highlight_lines(h_lines); |
09c3fb460fcb
Fixed problem with anchor link positioning when passed in ranges.
Marcin Kuzminski <marcin@python-works.com>
parents:
1313
diff
changeset
|
81 |
09c3fb460fcb
Fixed problem with anchor link positioning when passed in ranges.
Marcin Kuzminski <marcin@python-works.com>
parents:
1313
diff
changeset
|
82 //remember original location |
09c3fb460fcb
Fixed problem with anchor link positioning when passed in ranges.
Marcin Kuzminski <marcin@python-works.com>
parents:
1313
diff
changeset
|
83 var old_hash = location.href.substring(location.href.indexOf('#')); |
09c3fb460fcb
Fixed problem with anchor link positioning when passed in ranges.
Marcin Kuzminski <marcin@python-works.com>
parents:
1313
diff
changeset
|
84 |
09c3fb460fcb
Fixed problem with anchor link positioning when passed in ranges.
Marcin Kuzminski <marcin@python-works.com>
parents:
1313
diff
changeset
|
85 // this makes a jump to anchor moved by 3 posstions for padding |
09c3fb460fcb
Fixed problem with anchor link positioning when passed in ranges.
Marcin Kuzminski <marcin@python-works.com>
parents:
1313
diff
changeset
|
86 window.location.hash = '#L'+Math.max(parseInt(h_lines[0])-3,1); |
09c3fb460fcb
Fixed problem with anchor link positioning when passed in ranges.
Marcin Kuzminski <marcin@python-works.com>
parents:
1313
diff
changeset
|
87 |
09c3fb460fcb
Fixed problem with anchor link positioning when passed in ranges.
Marcin Kuzminski <marcin@python-works.com>
parents:
1313
diff
changeset
|
88 //sets old anchor |
09c3fb460fcb
Fixed problem with anchor link positioning when passed in ranges.
Marcin Kuzminski <marcin@python-works.com>
parents:
1313
diff
changeset
|
89 window.location.hash = old_hash; |
09c3fb460fcb
Fixed problem with anchor link positioning when passed in ranges.
Marcin Kuzminski <marcin@python-works.com>
parents:
1313
diff
changeset
|
90 |
969
6e070138d173
implemented #107 variable lines can be now highlighted
Marcin Kuzminski <marcin@python-works.com>
parents:
965
diff
changeset
|
91 } |
1043
6ec53c16c744
fixed binary file issues
Marcin Kuzminski <marcin@python-works.com>
parents:
1035
diff
changeset
|
92 </script> |
6ec53c16c744
fixed binary file issues
Marcin Kuzminski <marcin@python-works.com>
parents:
1035
diff
changeset
|
93 %endif |
144
ea89ac73bef8
Update css +file browsing and diffs
Marcin Kuzminski <marcin@python-works.com>
parents:
129
diff
changeset
|
94 </div> |
413
0ebec9b88d13
added jump to revision from file history.
Marcin Kuzminski <marcin@python-works.com>
parents:
410
diff
changeset
|
95 </div> |
0ebec9b88d13
added jump to revision from file history.
Marcin Kuzminski <marcin@python-works.com>
parents:
410
diff
changeset
|
96 |
0ebec9b88d13
added jump to revision from file history.
Marcin Kuzminski <marcin@python-works.com>
parents:
410
diff
changeset
|
97 <script type="text/javascript"> |
1320
09c3fb460fcb
Fixed problem with anchor link positioning when passed in ranges.
Marcin Kuzminski <marcin@python-works.com>
parents:
1313
diff
changeset
|
98 YUE.onDOMReady(function(){ |
09c3fb460fcb
Fixed problem with anchor link positioning when passed in ranges.
Marcin Kuzminski <marcin@python-works.com>
parents:
1313
diff
changeset
|
99 YUE.on('show_rev','click',function(e){ |
09c3fb460fcb
Fixed problem with anchor link positioning when passed in ranges.
Marcin Kuzminski <marcin@python-works.com>
parents:
1313
diff
changeset
|
100 YUE.preventDefault(e); |
413
0ebec9b88d13
added jump to revision from file history.
Marcin Kuzminski <marcin@python-works.com>
parents:
410
diff
changeset
|
101 var cs = YAHOO.util.Dom.get('diff1').value; |
0ebec9b88d13
added jump to revision from file history.
Marcin Kuzminski <marcin@python-works.com>
parents:
410
diff
changeset
|
102 var url = "${h.url('files_home',repo_name=c.repo_name,revision='__CS__',f_path=c.f_path)}".replace('__CS__',cs); |
0ebec9b88d13
added jump to revision from file history.
Marcin Kuzminski <marcin@python-works.com>
parents:
410
diff
changeset
|
103 window.location = url; |
1320
09c3fb460fcb
Fixed problem with anchor link positioning when passed in ranges.
Marcin Kuzminski <marcin@python-works.com>
parents:
1313
diff
changeset
|
104 }); |
09c3fb460fcb
Fixed problem with anchor link positioning when passed in ranges.
Marcin Kuzminski <marcin@python-works.com>
parents:
1313
diff
changeset
|
105 |
09c3fb460fcb
Fixed problem with anchor link positioning when passed in ranges.
Marcin Kuzminski <marcin@python-works.com>
parents:
1313
diff
changeset
|
106 function getIdentNode(n){ |
09c3fb460fcb
Fixed problem with anchor link positioning when passed in ranges.
Marcin Kuzminski <marcin@python-works.com>
parents:
1313
diff
changeset
|
107 //iterate thru nodes untill matched interesting node ! |
09c3fb460fcb
Fixed problem with anchor link positioning when passed in ranges.
Marcin Kuzminski <marcin@python-works.com>
parents:
1313
diff
changeset
|
108 |
09c3fb460fcb
Fixed problem with anchor link positioning when passed in ranges.
Marcin Kuzminski <marcin@python-works.com>
parents:
1313
diff
changeset
|
109 if (typeof n == 'undefined'){ |
09c3fb460fcb
Fixed problem with anchor link positioning when passed in ranges.
Marcin Kuzminski <marcin@python-works.com>
parents:
1313
diff
changeset
|
110 return -1 |
09c3fb460fcb
Fixed problem with anchor link positioning when passed in ranges.
Marcin Kuzminski <marcin@python-works.com>
parents:
1313
diff
changeset
|
111 } |
09c3fb460fcb
Fixed problem with anchor link positioning when passed in ranges.
Marcin Kuzminski <marcin@python-works.com>
parents:
1313
diff
changeset
|
112 |
09c3fb460fcb
Fixed problem with anchor link positioning when passed in ranges.
Marcin Kuzminski <marcin@python-works.com>
parents:
1313
diff
changeset
|
113 if(typeof n.id != "undefined" && n.id.match('L[0-9]+')){ |
09c3fb460fcb
Fixed problem with anchor link positioning when passed in ranges.
Marcin Kuzminski <marcin@python-works.com>
parents:
1313
diff
changeset
|
114 return n |
09c3fb460fcb
Fixed problem with anchor link positioning when passed in ranges.
Marcin Kuzminski <marcin@python-works.com>
parents:
1313
diff
changeset
|
115 } |
09c3fb460fcb
Fixed problem with anchor link positioning when passed in ranges.
Marcin Kuzminski <marcin@python-works.com>
parents:
1313
diff
changeset
|
116 else{ |
09c3fb460fcb
Fixed problem with anchor link positioning when passed in ranges.
Marcin Kuzminski <marcin@python-works.com>
parents:
1313
diff
changeset
|
117 return getIdentNode(n.parentNode); |
09c3fb460fcb
Fixed problem with anchor link positioning when passed in ranges.
Marcin Kuzminski <marcin@python-works.com>
parents:
1313
diff
changeset
|
118 } |
09c3fb460fcb
Fixed problem with anchor link positioning when passed in ranges.
Marcin Kuzminski <marcin@python-works.com>
parents:
1313
diff
changeset
|
119 } |
09c3fb460fcb
Fixed problem with anchor link positioning when passed in ranges.
Marcin Kuzminski <marcin@python-works.com>
parents:
1313
diff
changeset
|
120 |
09c3fb460fcb
Fixed problem with anchor link positioning when passed in ranges.
Marcin Kuzminski <marcin@python-works.com>
parents:
1313
diff
changeset
|
121 function getSelectionLink() { |
09c3fb460fcb
Fixed problem with anchor link positioning when passed in ranges.
Marcin Kuzminski <marcin@python-works.com>
parents:
1313
diff
changeset
|
122 //get selection from start/to nodes |
09c3fb460fcb
Fixed problem with anchor link positioning when passed in ranges.
Marcin Kuzminski <marcin@python-works.com>
parents:
1313
diff
changeset
|
123 if (typeof window.getSelection != "undefined") { |
09c3fb460fcb
Fixed problem with anchor link positioning when passed in ranges.
Marcin Kuzminski <marcin@python-works.com>
parents:
1313
diff
changeset
|
124 s = window.getSelection(); |
09c3fb460fcb
Fixed problem with anchor link positioning when passed in ranges.
Marcin Kuzminski <marcin@python-works.com>
parents:
1313
diff
changeset
|
125 |
09c3fb460fcb
Fixed problem with anchor link positioning when passed in ranges.
Marcin Kuzminski <marcin@python-works.com>
parents:
1313
diff
changeset
|
126 from = getIdentNode(s.anchorNode); |
09c3fb460fcb
Fixed problem with anchor link positioning when passed in ranges.
Marcin Kuzminski <marcin@python-works.com>
parents:
1313
diff
changeset
|
127 till = getIdentNode(s.focusNode); |
09c3fb460fcb
Fixed problem with anchor link positioning when passed in ranges.
Marcin Kuzminski <marcin@python-works.com>
parents:
1313
diff
changeset
|
128 |
09c3fb460fcb
Fixed problem with anchor link positioning when passed in ranges.
Marcin Kuzminski <marcin@python-works.com>
parents:
1313
diff
changeset
|
129 f_int = parseInt(from.id.replace('L','')); |
09c3fb460fcb
Fixed problem with anchor link positioning when passed in ranges.
Marcin Kuzminski <marcin@python-works.com>
parents:
1313
diff
changeset
|
130 t_int = parseInt(till.id.replace('L','')); |
09c3fb460fcb
Fixed problem with anchor link positioning when passed in ranges.
Marcin Kuzminski <marcin@python-works.com>
parents:
1313
diff
changeset
|
131 |
09c3fb460fcb
Fixed problem with anchor link positioning when passed in ranges.
Marcin Kuzminski <marcin@python-works.com>
parents:
1313
diff
changeset
|
132 if (f_int > t_int){ |
09c3fb460fcb
Fixed problem with anchor link positioning when passed in ranges.
Marcin Kuzminski <marcin@python-works.com>
parents:
1313
diff
changeset
|
133 //highlight from bottom |
09c3fb460fcb
Fixed problem with anchor link positioning when passed in ranges.
Marcin Kuzminski <marcin@python-works.com>
parents:
1313
diff
changeset
|
134 offset = -35; |
1322
8cca07df79dd
fixed small bug in selection links when sorting messes up for <10 numbers
Marcin Kuzminski <marcin@python-works.com>
parents:
1320
diff
changeset
|
135 ranges = [t_int,f_int]; |
8cca07df79dd
fixed small bug in selection links when sorting messes up for <10 numbers
Marcin Kuzminski <marcin@python-works.com>
parents:
1320
diff
changeset
|
136 |
1320
09c3fb460fcb
Fixed problem with anchor link positioning when passed in ranges.
Marcin Kuzminski <marcin@python-works.com>
parents:
1313
diff
changeset
|
137 } |
09c3fb460fcb
Fixed problem with anchor link positioning when passed in ranges.
Marcin Kuzminski <marcin@python-works.com>
parents:
1313
diff
changeset
|
138 else{ |
09c3fb460fcb
Fixed problem with anchor link positioning when passed in ranges.
Marcin Kuzminski <marcin@python-works.com>
parents:
1313
diff
changeset
|
139 //highligth from top |
09c3fb460fcb
Fixed problem with anchor link positioning when passed in ranges.
Marcin Kuzminski <marcin@python-works.com>
parents:
1313
diff
changeset
|
140 offset = 35; |
1322
8cca07df79dd
fixed small bug in selection links when sorting messes up for <10 numbers
Marcin Kuzminski <marcin@python-works.com>
parents:
1320
diff
changeset
|
141 ranges = [f_int,t_int]; |
1320
09c3fb460fcb
Fixed problem with anchor link positioning when passed in ranges.
Marcin Kuzminski <marcin@python-works.com>
parents:
1313
diff
changeset
|
142 } |
09c3fb460fcb
Fixed problem with anchor link positioning when passed in ranges.
Marcin Kuzminski <marcin@python-works.com>
parents:
1313
diff
changeset
|
143 |
09c3fb460fcb
Fixed problem with anchor link positioning when passed in ranges.
Marcin Kuzminski <marcin@python-works.com>
parents:
1313
diff
changeset
|
144 if (ranges[0] != ranges[1]){ |
09c3fb460fcb
Fixed problem with anchor link positioning when passed in ranges.
Marcin Kuzminski <marcin@python-works.com>
parents:
1313
diff
changeset
|
145 if(YUD.get('linktt') == null){ |
09c3fb460fcb
Fixed problem with anchor link positioning when passed in ranges.
Marcin Kuzminski <marcin@python-works.com>
parents:
1313
diff
changeset
|
146 hl_div = document.createElement('div'); |
09c3fb460fcb
Fixed problem with anchor link positioning when passed in ranges.
Marcin Kuzminski <marcin@python-works.com>
parents:
1313
diff
changeset
|
147 hl_div.id = 'linktt'; |
09c3fb460fcb
Fixed problem with anchor link positioning when passed in ranges.
Marcin Kuzminski <marcin@python-works.com>
parents:
1313
diff
changeset
|
148 } |
09c3fb460fcb
Fixed problem with anchor link positioning when passed in ranges.
Marcin Kuzminski <marcin@python-works.com>
parents:
1313
diff
changeset
|
149 anchor = '#L'+ranges[0]+'-'+ranges[1]; |
09c3fb460fcb
Fixed problem with anchor link positioning when passed in ranges.
Marcin Kuzminski <marcin@python-works.com>
parents:
1313
diff
changeset
|
150 hl_div.innerHTML = ''; |
09c3fb460fcb
Fixed problem with anchor link positioning when passed in ranges.
Marcin Kuzminski <marcin@python-works.com>
parents:
1313
diff
changeset
|
151 l = document.createElement('a'); |
09c3fb460fcb
Fixed problem with anchor link positioning when passed in ranges.
Marcin Kuzminski <marcin@python-works.com>
parents:
1313
diff
changeset
|
152 l.href = location.href.substring(0,location.href.indexOf('#'))+anchor; |
09c3fb460fcb
Fixed problem with anchor link positioning when passed in ranges.
Marcin Kuzminski <marcin@python-works.com>
parents:
1313
diff
changeset
|
153 l.innerHTML = "${_('Selection link')}" |
09c3fb460fcb
Fixed problem with anchor link positioning when passed in ranges.
Marcin Kuzminski <marcin@python-works.com>
parents:
1313
diff
changeset
|
154 hl_div.appendChild(l); |
09c3fb460fcb
Fixed problem with anchor link positioning when passed in ranges.
Marcin Kuzminski <marcin@python-works.com>
parents:
1313
diff
changeset
|
155 |
09c3fb460fcb
Fixed problem with anchor link positioning when passed in ranges.
Marcin Kuzminski <marcin@python-works.com>
parents:
1313
diff
changeset
|
156 YUD.get('body').appendChild(hl_div); |
09c3fb460fcb
Fixed problem with anchor link positioning when passed in ranges.
Marcin Kuzminski <marcin@python-works.com>
parents:
1313
diff
changeset
|
157 |
09c3fb460fcb
Fixed problem with anchor link positioning when passed in ranges.
Marcin Kuzminski <marcin@python-works.com>
parents:
1313
diff
changeset
|
158 xy = YUD.getXY(till.id); |
09c3fb460fcb
Fixed problem with anchor link positioning when passed in ranges.
Marcin Kuzminski <marcin@python-works.com>
parents:
1313
diff
changeset
|
159 |
09c3fb460fcb
Fixed problem with anchor link positioning when passed in ranges.
Marcin Kuzminski <marcin@python-works.com>
parents:
1313
diff
changeset
|
160 YUD.addClass('linktt','yui-tt'); |
09c3fb460fcb
Fixed problem with anchor link positioning when passed in ranges.
Marcin Kuzminski <marcin@python-works.com>
parents:
1313
diff
changeset
|
161 YUD.setStyle('linktt','top',xy[1]+offset+'px'); |
09c3fb460fcb
Fixed problem with anchor link positioning when passed in ranges.
Marcin Kuzminski <marcin@python-works.com>
parents:
1313
diff
changeset
|
162 YUD.setStyle('linktt','left',xy[0]+'px'); |
09c3fb460fcb
Fixed problem with anchor link positioning when passed in ranges.
Marcin Kuzminski <marcin@python-works.com>
parents:
1313
diff
changeset
|
163 YUD.setStyle('linktt','visibility','visible'); |
09c3fb460fcb
Fixed problem with anchor link positioning when passed in ranges.
Marcin Kuzminski <marcin@python-works.com>
parents:
1313
diff
changeset
|
164 } |
09c3fb460fcb
Fixed problem with anchor link positioning when passed in ranges.
Marcin Kuzminski <marcin@python-works.com>
parents:
1313
diff
changeset
|
165 else{ |
09c3fb460fcb
Fixed problem with anchor link positioning when passed in ranges.
Marcin Kuzminski <marcin@python-works.com>
parents:
1313
diff
changeset
|
166 YUD.setStyle('linktt','visibility','hidden'); |
09c3fb460fcb
Fixed problem with anchor link positioning when passed in ranges.
Marcin Kuzminski <marcin@python-works.com>
parents:
1313
diff
changeset
|
167 } |
09c3fb460fcb
Fixed problem with anchor link positioning when passed in ranges.
Marcin Kuzminski <marcin@python-works.com>
parents:
1313
diff
changeset
|
168 } |
09c3fb460fcb
Fixed problem with anchor link positioning when passed in ranges.
Marcin Kuzminski <marcin@python-works.com>
parents:
1313
diff
changeset
|
169 } |
09c3fb460fcb
Fixed problem with anchor link positioning when passed in ranges.
Marcin Kuzminski <marcin@python-works.com>
parents:
1313
diff
changeset
|
170 |
09c3fb460fcb
Fixed problem with anchor link positioning when passed in ranges.
Marcin Kuzminski <marcin@python-works.com>
parents:
1313
diff
changeset
|
171 YUE.on('hlcode','mouseup',getSelectionLink) |
09c3fb460fcb
Fixed problem with anchor link positioning when passed in ranges.
Marcin Kuzminski <marcin@python-works.com>
parents:
1313
diff
changeset
|
172 |
413
0ebec9b88d13
added jump to revision from file history.
Marcin Kuzminski <marcin@python-works.com>
parents:
410
diff
changeset
|
173 }); |
1472
aaec08ad9daf
Added pt_BR localization, added i18n wrappers on some places missing, fixed css in settings screen for longer labels.
Augusto Herrmann <augusto.herrmann@planejamento.gov.br>
parents:
1322
diff
changeset
|
174 </script> |