##// END OF EJS Templates
urlify the commit message in file block + small css fixes
marcink -
r2029:14d8cfb9 beta
parent child Browse files
Show More
@@ -1,169 +1,175 b''
1 div.codeblock {
1 div.codeblock {
2 overflow: auto;
2 overflow: auto;
3 padding: 0px;
3 padding: 0px;
4 border: 1px solid #ccc;
4 border: 1px solid #ccc;
5 background: #f8f8f8;
5 background: #f8f8f8;
6 font-size: 100%;
6 font-size: 100%;
7 line-height: 100%;
7 line-height: 100%;
8 /* new */
8 /* new */
9 line-height: 125%;
9 line-height: 125%;
10 -webkit-border-radius: 4px;
10 -webkit-border-radius: 4px;
11 -moz-border-radius: 4px;
11 -moz-border-radius: 4px;
12 border-radius: 4px;
12 border-radius: 4px;
13 }
13 }
14 div.codeblock .code-header{
14 div.codeblock .code-header{
15 border-bottom: 1px solid #CCCCCC;
15 border-bottom: 1px solid #CCCCCC;
16 background: #EEEEEE;
16 background: #EEEEEE;
17 padding:10px 0 10px 0;
17 padding:10px 0 10px 0;
18 }
18 }
19
19
20 div.codeblock .code-header .stats{
20 div.codeblock .code-header .stats{
21 clear: both;
21 clear: both;
22 margin-top:-3px;
22 padding: 6px 8px 6px 10px;
23 padding-left: 8px;
23 border-bottom: 1px solid rgb(204, 204, 204);
24 border-bottom: 1px solid rgb(204, 204, 204);
24 height: 23px;
25 margin-bottom: 5px; height: 23px;
25 margin-bottom: 6px;
26 }
26 }
27
27
28 div.codeblock .code-header .stats .left{
28 div.codeblock .code-header .stats .left{
29 float:left;
29 float:left;
30 }
30 }
31 div.codeblock .code-header .stats .left.img{
32 margin-top:-2px;
33 }
31 div.codeblock .code-header .stats .left.item{
34 div.codeblock .code-header .stats .left.item{
32 float:left;
35 float:left;
33 padding: 0 9px 0 9px;
36 padding: 0 9px 0 9px;
34 border-right:1px solid #ccc;
37 border-right:1px solid #ccc;
35 }
38 }
39 div.codeblock .code-header .stats .left.item pre{
40
41 }
36 div.codeblock .code-header .stats .left.item.last{
42 div.codeblock .code-header .stats .left.item.last{
37 border-right:none;
43 border-right:none;
38 }
44 }
39 div.codeblock .code-header .stats .buttons{
45 div.codeblock .code-header .stats .buttons{
40 float:right;
46 float:right;
41 padding-right:4px;
47 padding-right:4px;
42 }
48 }
43
49
44 div.codeblock .code-header .author{
50 div.codeblock .code-header .author{
45 margin-left:25px;
51 margin-left:25px;
46 font-weight: bold;
52 font-weight: bold;
47 height: 25px;
53 height: 25px;
48 }
54 }
49 div.codeblock .code-header .author .user{
55 div.codeblock .code-header .author .user{
50 padding-top:3px;
56 padding-top:3px;
51 }
57 }
52 div.codeblock .code-header .commit{
58 div.codeblock .code-header .commit{
53 margin-left:25px;
59 margin-left:25px;
54 font-weight: normal;
60 font-weight: normal;
55 white-space:pre;
61 white-space:pre;
56 }
62 }
57
63
58 div.codeblock .code-body table{
64 div.codeblock .code-body table{
59 width: 0 !important;
65 width: 0 !important;
60 border: 0px !important;
66 border: 0px !important;
61 }
67 }
62 div.codeblock .code-body table td {
68 div.codeblock .code-body table td {
63 border: 0px !important;
69 border: 0px !important;
64 }
70 }
65 div.code-body {
71 div.code-body {
66 background-color: #FFFFFF;
72 background-color: #FFFFFF;
67 }
73 }
68
74
69 div.codeblock .code-header .search-path {
75 div.codeblock .code-header .search-path {
70 padding: 0px 0px 0px 10px;
76 padding: 0px 0px 0px 10px;
71 }
77 }
72
78
73 div.search-code-body {
79 div.search-code-body {
74 background-color: #FFFFFF;
80 background-color: #FFFFFF;
75 padding: 5px 0px 5px 10px;
81 padding: 5px 0px 5px 10px;
76 }
82 }
77
83
78 div.search-code-body pre .match{
84 div.search-code-body pre .match{
79 background-color: #FAFFA6;
85 background-color: #FAFFA6;
80 }
86 }
81 div.search-code-body pre .break{
87 div.search-code-body pre .break{
82 background-color: #DDE7EF;
88 background-color: #DDE7EF;
83 width: 100%;
89 width: 100%;
84 color: #747474;
90 color: #747474;
85 display: block;
91 display: block;
86
92
87 }
93 }
88 div.annotatediv{
94 div.annotatediv{
89 margin-left:2px;
95 margin-left:2px;
90 margin-right:4px;
96 margin-right:4px;
91 }
97 }
92 .code-highlight {
98 .code-highlight {
93 padding: 0px;
99 padding: 0px;
94 margin-top: 5px;
100 margin-top: 5px;
95 margin-bottom: 5px;
101 margin-bottom: 5px;
96 border-left: 2px solid #ccc;
102 border-left: 2px solid #ccc;
97 }
103 }
98 .code-highlight pre, .linenodiv pre {
104 .code-highlight pre, .linenodiv pre {
99 padding: 5px;
105 padding: 5px;
100 margin: 0;
106 margin: 0;
101 }
107 }
102 .code-highlight pre div:target {
108 .code-highlight pre div:target {
103 background-color: #FFFFBE !important;
109 background-color: #FFFFBE !important;
104 }
110 }
105
111
106 .linenos a { text-decoration: none; }
112 .linenos a { text-decoration: none; }
107
113
108 .code { display: block; }
114 .code { display: block; }
109 .code-highlight .hll, .codehilite .hll { background-color: #ffffcc }
115 .code-highlight .hll, .codehilite .hll { background-color: #ffffcc }
110 .code-highlight .c, .codehilite .c { color: #408080; font-style: italic } /* Comment */
116 .code-highlight .c, .codehilite .c { color: #408080; font-style: italic } /* Comment */
111 .code-highlight .err, .codehilite .err { border: 1px solid #FF0000 } /* Error */
117 .code-highlight .err, .codehilite .err { border: 1px solid #FF0000 } /* Error */
112 .code-highlight .k, .codehilite .k { color: #008000; font-weight: bold } /* Keyword */
118 .code-highlight .k, .codehilite .k { color: #008000; font-weight: bold } /* Keyword */
113 .code-highlight .o, .codehilite .o { color: #666666 } /* Operator */
119 .code-highlight .o, .codehilite .o { color: #666666 } /* Operator */
114 .code-highlight .cm, .codehilite .cm { color: #408080; font-style: italic } /* Comment.Multiline */
120 .code-highlight .cm, .codehilite .cm { color: #408080; font-style: italic } /* Comment.Multiline */
115 .code-highlight .cp, .codehilite .cp { color: #BC7A00 } /* Comment.Preproc */
121 .code-highlight .cp, .codehilite .cp { color: #BC7A00 } /* Comment.Preproc */
116 .code-highlight .c1, .codehilite .c1 { color: #408080; font-style: italic } /* Comment.Single */
122 .code-highlight .c1, .codehilite .c1 { color: #408080; font-style: italic } /* Comment.Single */
117 .code-highlight .cs, .codehilite .cs { color: #408080; font-style: italic } /* Comment.Special */
123 .code-highlight .cs, .codehilite .cs { color: #408080; font-style: italic } /* Comment.Special */
118 .code-highlight .gd, .codehilite .gd { color: #A00000 } /* Generic.Deleted */
124 .code-highlight .gd, .codehilite .gd { color: #A00000 } /* Generic.Deleted */
119 .code-highlight .ge, .codehilite .ge { font-style: italic } /* Generic.Emph */
125 .code-highlight .ge, .codehilite .ge { font-style: italic } /* Generic.Emph */
120 .code-highlight .gr, .codehilite .gr { color: #FF0000 } /* Generic.Error */
126 .code-highlight .gr, .codehilite .gr { color: #FF0000 } /* Generic.Error */
121 .code-highlight .gh, .codehilite .gh { color: #000080; font-weight: bold } /* Generic.Heading */
127 .code-highlight .gh, .codehilite .gh { color: #000080; font-weight: bold } /* Generic.Heading */
122 .code-highlight .gi, .codehilite .gi { color: #00A000 } /* Generic.Inserted */
128 .code-highlight .gi, .codehilite .gi { color: #00A000 } /* Generic.Inserted */
123 .code-highlight .go, .codehilite .go { color: #808080 } /* Generic.Output */
129 .code-highlight .go, .codehilite .go { color: #808080 } /* Generic.Output */
124 .code-highlight .gp, .codehilite .gp { color: #000080; font-weight: bold } /* Generic.Prompt */
130 .code-highlight .gp, .codehilite .gp { color: #000080; font-weight: bold } /* Generic.Prompt */
125 .code-highlight .gs, .codehilite .gs { font-weight: bold } /* Generic.Strong */
131 .code-highlight .gs, .codehilite .gs { font-weight: bold } /* Generic.Strong */
126 .code-highlight .gu, .codehilite .gu { color: #800080; font-weight: bold } /* Generic.Subheading */
132 .code-highlight .gu, .codehilite .gu { color: #800080; font-weight: bold } /* Generic.Subheading */
127 .code-highlight .gt, .codehilite .gt { color: #0040D0 } /* Generic.Traceback */
133 .code-highlight .gt, .codehilite .gt { color: #0040D0 } /* Generic.Traceback */
128 .code-highlight .kc, .codehilite .kc { color: #008000; font-weight: bold } /* Keyword.Constant */
134 .code-highlight .kc, .codehilite .kc { color: #008000; font-weight: bold } /* Keyword.Constant */
129 .code-highlight .kd, .codehilite .kd { color: #008000; font-weight: bold } /* Keyword.Declaration */
135 .code-highlight .kd, .codehilite .kd { color: #008000; font-weight: bold } /* Keyword.Declaration */
130 .code-highlight .kn, .codehilite .kn { color: #008000; font-weight: bold } /* Keyword.Namespace */
136 .code-highlight .kn, .codehilite .kn { color: #008000; font-weight: bold } /* Keyword.Namespace */
131 .code-highlight .kp, .codehilite .kp { color: #008000 } /* Keyword.Pseudo */
137 .code-highlight .kp, .codehilite .kp { color: #008000 } /* Keyword.Pseudo */
132 .code-highlight .kr, .codehilite .kr { color: #008000; font-weight: bold } /* Keyword.Reserved */
138 .code-highlight .kr, .codehilite .kr { color: #008000; font-weight: bold } /* Keyword.Reserved */
133 .code-highlight .kt, .codehilite .kt { color: #B00040 } /* Keyword.Type */
139 .code-highlight .kt, .codehilite .kt { color: #B00040 } /* Keyword.Type */
134 .code-highlight .m, .codehilite .m { color: #666666 } /* Literal.Number */
140 .code-highlight .m, .codehilite .m { color: #666666 } /* Literal.Number */
135 .code-highlight .s, .codehilite .s { color: #BA2121 } /* Literal.String */
141 .code-highlight .s, .codehilite .s { color: #BA2121 } /* Literal.String */
136 .code-highlight .na, .codehilite .na { color: #7D9029 } /* Name.Attribute */
142 .code-highlight .na, .codehilite .na { color: #7D9029 } /* Name.Attribute */
137 .code-highlight .nb, .codehilite .nb { color: #008000 } /* Name.Builtin */
143 .code-highlight .nb, .codehilite .nb { color: #008000 } /* Name.Builtin */
138 .code-highlight .nc, .codehilite .nc { color: #0000FF; font-weight: bold } /* Name.Class */
144 .code-highlight .nc, .codehilite .nc { color: #0000FF; font-weight: bold } /* Name.Class */
139 .code-highlight .no, .codehilite .no { color: #880000 } /* Name.Constant */
145 .code-highlight .no, .codehilite .no { color: #880000 } /* Name.Constant */
140 .code-highlight .nd, .codehilite .nd { color: #AA22FF } /* Name.Decorator */
146 .code-highlight .nd, .codehilite .nd { color: #AA22FF } /* Name.Decorator */
141 .code-highlight .ni, .codehilite .ni { color: #999999; font-weight: bold } /* Name.Entity */
147 .code-highlight .ni, .codehilite .ni { color: #999999; font-weight: bold } /* Name.Entity */
142 .code-highlight .ne, .codehilite .ne { color: #D2413A; font-weight: bold } /* Name.Exception */
148 .code-highlight .ne, .codehilite .ne { color: #D2413A; font-weight: bold } /* Name.Exception */
143 .code-highlight .nf, .codehilite .nf { color: #0000FF } /* Name.Function */
149 .code-highlight .nf, .codehilite .nf { color: #0000FF } /* Name.Function */
144 .code-highlight .nl, .codehilite .nl { color: #A0A000 } /* Name.Label */
150 .code-highlight .nl, .codehilite .nl { color: #A0A000 } /* Name.Label */
145 .code-highlight .nn, .codehilite .nn { color: #0000FF; font-weight: bold } /* Name.Namespace */
151 .code-highlight .nn, .codehilite .nn { color: #0000FF; font-weight: bold } /* Name.Namespace */
146 .code-highlight .nt, .codehilite .nt { color: #008000; font-weight: bold } /* Name.Tag */
152 .code-highlight .nt, .codehilite .nt { color: #008000; font-weight: bold } /* Name.Tag */
147 .code-highlight .nv, .codehilite .nv { color: #19177C } /* Name.Variable */
153 .code-highlight .nv, .codehilite .nv { color: #19177C } /* Name.Variable */
148 .code-highlight .ow, .codehilite .ow { color: #AA22FF; font-weight: bold } /* Operator.Word */
154 .code-highlight .ow, .codehilite .ow { color: #AA22FF; font-weight: bold } /* Operator.Word */
149 .code-highlight .w, .codehilite .w { color: #bbbbbb } /* Text.Whitespace */
155 .code-highlight .w, .codehilite .w { color: #bbbbbb } /* Text.Whitespace */
150 .code-highlight .mf, .codehilite .mf { color: #666666 } /* Literal.Number.Float */
156 .code-highlight .mf, .codehilite .mf { color: #666666 } /* Literal.Number.Float */
151 .code-highlight .mh, .codehilite .mh { color: #666666 } /* Literal.Number.Hex */
157 .code-highlight .mh, .codehilite .mh { color: #666666 } /* Literal.Number.Hex */
152 .code-highlight .mi, .codehilite .mi { color: #666666 } /* Literal.Number.Integer */
158 .code-highlight .mi, .codehilite .mi { color: #666666 } /* Literal.Number.Integer */
153 .code-highlight .mo, .codehilite .mo { color: #666666 } /* Literal.Number.Oct */
159 .code-highlight .mo, .codehilite .mo { color: #666666 } /* Literal.Number.Oct */
154 .code-highlight .sb, .codehilite .sb { color: #BA2121 } /* Literal.String.Backtick */
160 .code-highlight .sb, .codehilite .sb { color: #BA2121 } /* Literal.String.Backtick */
155 .code-highlight .sc, .codehilite .sc { color: #BA2121 } /* Literal.String.Char */
161 .code-highlight .sc, .codehilite .sc { color: #BA2121 } /* Literal.String.Char */
156 .code-highlight .sd, .codehilite .sd { color: #BA2121; font-style: italic } /* Literal.String.Doc */
162 .code-highlight .sd, .codehilite .sd { color: #BA2121; font-style: italic } /* Literal.String.Doc */
157 .code-highlight .s2, .codehilite .s2 { color: #BA2121 } /* Literal.String.Double */
163 .code-highlight .s2, .codehilite .s2 { color: #BA2121 } /* Literal.String.Double */
158 .code-highlight .se, .codehilite .se { color: #BB6622; font-weight: bold } /* Literal.String.Escape */
164 .code-highlight .se, .codehilite .se { color: #BB6622; font-weight: bold } /* Literal.String.Escape */
159 .code-highlight .sh, .codehilite .sh { color: #BA2121 } /* Literal.String.Heredoc */
165 .code-highlight .sh, .codehilite .sh { color: #BA2121 } /* Literal.String.Heredoc */
160 .code-highlight .si, .codehilite .si { color: #BB6688; font-weight: bold } /* Literal.String.Interpol */
166 .code-highlight .si, .codehilite .si { color: #BB6688; font-weight: bold } /* Literal.String.Interpol */
161 .code-highlight .sx, .codehilite .sx { color: #008000 } /* Literal.String.Other */
167 .code-highlight .sx, .codehilite .sx { color: #008000 } /* Literal.String.Other */
162 .code-highlight .sr, .codehilite .sr { color: #BB6688 } /* Literal.String.Regex */
168 .code-highlight .sr, .codehilite .sr { color: #BB6688 } /* Literal.String.Regex */
163 .code-highlight .s1, .codehilite .s1 { color: #BA2121 } /* Literal.String.Single */
169 .code-highlight .s1, .codehilite .s1 { color: #BA2121 } /* Literal.String.Single */
164 .code-highlight .ss, .codehilite .ss { color: #19177C } /* Literal.String.Symbol */
170 .code-highlight .ss, .codehilite .ss { color: #19177C } /* Literal.String.Symbol */
165 .code-highlight .bp, .codehilite .bp { color: #008000 } /* Name.Builtin.Pseudo */
171 .code-highlight .bp, .codehilite .bp { color: #008000 } /* Name.Builtin.Pseudo */
166 .code-highlight .vc, .codehilite .vc { color: #19177C } /* Name.Variable.Class */
172 .code-highlight .vc, .codehilite .vc { color: #19177C } /* Name.Variable.Class */
167 .code-highlight .vg, .codehilite .vg { color: #19177C } /* Name.Variable.Global */
173 .code-highlight .vg, .codehilite .vg { color: #19177C } /* Name.Variable.Global */
168 .code-highlight .vi, .codehilite .vi { color: #19177C } /* Name.Variable.Instance */
174 .code-highlight .vi, .codehilite .vi { color: #19177C } /* Name.Variable.Instance */
169 .code-highlight .il, .codehilite .il { color: #666666 } /* Literal.Number.Integer.Long */
175 .code-highlight .il, .codehilite .il { color: #666666 } /* Literal.Number.Integer.Long */
@@ -1,104 +1,104 b''
1 <dl>
1 <dl>
2 <dt style="padding-top:10px;font-size:16px">${_('History')}</dt>
2 <dt style="padding-top:10px;font-size:16px">${_('History')}</dt>
3 <dd>
3 <dd>
4 <div>
4 <div>
5 ${h.form(h.url('files_diff_home',repo_name=c.repo_name,f_path=c.f_path),method='get')}
5 ${h.form(h.url('files_diff_home',repo_name=c.repo_name,f_path=c.f_path),method='get')}
6 ${h.hidden('diff2',c.file.last_changeset.raw_id)}
6 ${h.hidden('diff2',c.file.last_changeset.raw_id)}
7 ${h.select('diff1',c.file.last_changeset.raw_id,c.file_history)}
7 ${h.select('diff1',c.file.last_changeset.raw_id,c.file_history)}
8 ${h.submit('diff','diff to revision',class_="ui-btn")}
8 ${h.submit('diff','diff to revision',class_="ui-btn")}
9 ${h.submit('show_rev','show at revision',class_="ui-btn")}
9 ${h.submit('show_rev','show at revision',class_="ui-btn")}
10 ${h.end_form()}
10 ${h.end_form()}
11 </div>
11 </div>
12 </dd>
12 </dd>
13 </dl>
13 </dl>
14
14
15 <div id="body" class="codeblock">
15 <div id="body" class="codeblock">
16 <div class="code-header">
16 <div class="code-header">
17 <div class="stats">
17 <div class="stats">
18 <div class="left"><img src="${h.url('/images/icons/file.png')}"/></div>
18 <div class="left img"><img src="${h.url('/images/icons/file.png')}"/></div>
19 <div class="left item"><pre>${h.link_to("r%s:%s" % (c.file.last_changeset.revision,h.short_id(c.file.last_changeset.raw_id)),h.url('changeset_home',repo_name=c.repo_name,revision=c.file.last_changeset.raw_id))}</pre></div>
19 <div class="left item"><pre>${h.link_to("r%s:%s" % (c.file.last_changeset.revision,h.short_id(c.file.last_changeset.raw_id)),h.url('changeset_home',repo_name=c.repo_name,revision=c.file.last_changeset.raw_id))}</pre></div>
20 <div class="left item">${h.format_byte_size(c.file.size,binary=True)}</div>
20 <div class="left item"><pre>${h.format_byte_size(c.file.size,binary=True)}</pre></div>
21 <div class="left item last">${c.file.mimetype}</div>
21 <div class="left item last"><pre>${c.file.mimetype}</pre></div>
22 <div class="buttons">
22 <div class="buttons">
23 ${h.link_to(_('show annotation'),h.url('files_annotate_home',repo_name=c.repo_name,revision=c.file.last_changeset.raw_id,f_path=c.f_path),class_="ui-btn")}
23 ${h.link_to(_('show annotation'),h.url('files_annotate_home',repo_name=c.repo_name,revision=c.file.last_changeset.raw_id,f_path=c.f_path),class_="ui-btn")}
24 ${h.link_to(_('show as raw'),h.url('files_raw_home',repo_name=c.repo_name,revision=c.file.last_changeset.raw_id,f_path=c.f_path),class_="ui-btn")}
24 ${h.link_to(_('show as raw'),h.url('files_raw_home',repo_name=c.repo_name,revision=c.file.last_changeset.raw_id,f_path=c.f_path),class_="ui-btn")}
25 ${h.link_to(_('download as raw'),h.url('files_rawfile_home',repo_name=c.repo_name,revision=c.file.last_changeset.raw_id,f_path=c.f_path),class_="ui-btn")}
25 ${h.link_to(_('download as raw'),h.url('files_rawfile_home',repo_name=c.repo_name,revision=c.file.last_changeset.raw_id,f_path=c.f_path),class_="ui-btn")}
26 % if h.HasRepoPermissionAny('repository.write','repository.admin')(c.repo_name):
26 % if h.HasRepoPermissionAny('repository.write','repository.admin')(c.repo_name):
27 % if not c.file.is_binary:
27 % if not c.file.is_binary:
28 ${h.link_to(_('edit'),h.url('files_edit_home',repo_name=c.repo_name,revision=c.file.last_changeset.raw_id,f_path=c.f_path),class_="ui-btn")}
28 ${h.link_to(_('edit'),h.url('files_edit_home',repo_name=c.repo_name,revision=c.file.last_changeset.raw_id,f_path=c.f_path),class_="ui-btn")}
29 % endif
29 % endif
30 % endif
30 % endif
31 </div>
31 </div>
32 </div>
32 </div>
33 <div class="author">
33 <div class="author">
34 <div class="gravatar">
34 <div class="gravatar">
35 <img alt="gravatar" src="${h.gravatar_url(h.email(c.file.last_changeset.author),16)}"/>
35 <img alt="gravatar" src="${h.gravatar_url(h.email(c.file.last_changeset.author),16)}"/>
36 </div>
36 </div>
37 <div title="${c.file.last_changeset.author}" class="user">${h.person(c.file.last_changeset.author)}</div>
37 <div title="${c.file.last_changeset.author}" class="user">${h.person(c.file.last_changeset.author)}</div>
38 </div>
38 </div>
39 <div class="commit">${c.file.last_changeset.message}</div>
39 <div class="commit">${h.urlify_commit(c.file.last_changeset.message,c.repo_name)}</div>
40 </div>
40 </div>
41 <div class="code-body">
41 <div class="code-body">
42 %if c.file.is_binary:
42 %if c.file.is_binary:
43 ${_('Binary file (%s)') % c.file.mimetype}
43 ${_('Binary file (%s)') % c.file.mimetype}
44 %else:
44 %else:
45 % if c.file.size < c.cut_off_limit:
45 % if c.file.size < c.cut_off_limit:
46 ${h.pygmentize(c.file,linenos=True,anchorlinenos=True,lineanchors='L',cssclass="code-highlight")}
46 ${h.pygmentize(c.file,linenos=True,anchorlinenos=True,lineanchors='L',cssclass="code-highlight")}
47 %else:
47 %else:
48 ${_('File is too big to display')} ${h.link_to(_('show as raw'),
48 ${_('File is too big to display')} ${h.link_to(_('show as raw'),
49 h.url('files_raw_home',repo_name=c.repo_name,revision=c.file.last_changeset.raw_id,f_path=c.f_path))}
49 h.url('files_raw_home',repo_name=c.repo_name,revision=c.file.last_changeset.raw_id,f_path=c.f_path))}
50 %endif
50 %endif
51 <script type="text/javascript">
51 <script type="text/javascript">
52 function highlight_lines(lines){
52 function highlight_lines(lines){
53 for(pos in lines){
53 for(pos in lines){
54 YUD.setStyle('L'+lines[pos],'background-color','#FFFFBE');
54 YUD.setStyle('L'+lines[pos],'background-color','#FFFFBE');
55 }
55 }
56 }
56 }
57 page_highlights = location.href.substring(location.href.indexOf('#')+1).split('L');
57 page_highlights = location.href.substring(location.href.indexOf('#')+1).split('L');
58 if (page_highlights.length == 2){
58 if (page_highlights.length == 2){
59 highlight_ranges = page_highlights[1].split(",");
59 highlight_ranges = page_highlights[1].split(",");
60
60
61 var h_lines = [];
61 var h_lines = [];
62 for (pos in highlight_ranges){
62 for (pos in highlight_ranges){
63 var _range = highlight_ranges[pos].split('-');
63 var _range = highlight_ranges[pos].split('-');
64 if(_range.length == 2){
64 if(_range.length == 2){
65 var start = parseInt(_range[0]);
65 var start = parseInt(_range[0]);
66 var end = parseInt(_range[1]);
66 var end = parseInt(_range[1]);
67 if (start < end){
67 if (start < end){
68 for(var i=start;i<=end;i++){
68 for(var i=start;i<=end;i++){
69 h_lines.push(i);
69 h_lines.push(i);
70 }
70 }
71 }
71 }
72 }
72 }
73 else{
73 else{
74 h_lines.push(parseInt(highlight_ranges[pos]));
74 h_lines.push(parseInt(highlight_ranges[pos]));
75 }
75 }
76 }
76 }
77 highlight_lines(h_lines);
77 highlight_lines(h_lines);
78
78
79 //remember original location
79 //remember original location
80 var old_hash = location.href.substring(location.href.indexOf('#'));
80 var old_hash = location.href.substring(location.href.indexOf('#'));
81
81
82 // this makes a jump to anchor moved by 3 posstions for padding
82 // this makes a jump to anchor moved by 3 posstions for padding
83 window.location.hash = '#L'+Math.max(parseInt(h_lines[0])-3,1);
83 window.location.hash = '#L'+Math.max(parseInt(h_lines[0])-3,1);
84
84
85 //sets old anchor
85 //sets old anchor
86 window.location.hash = old_hash;
86 window.location.hash = old_hash;
87
87
88 }
88 }
89 </script>
89 </script>
90 %endif
90 %endif
91 </div>
91 </div>
92 </div>
92 </div>
93
93
94 <script type="text/javascript">
94 <script type="text/javascript">
95 YUE.onDOMReady(function(){
95 YUE.onDOMReady(function(){
96 YUE.on('show_rev','click',function(e){
96 YUE.on('show_rev','click',function(e){
97 YUE.preventDefault(e);
97 YUE.preventDefault(e);
98 var cs = YUD.get('diff1').value;
98 var cs = YUD.get('diff1').value;
99 var url = "${h.url('files_home',repo_name=c.repo_name,revision='__CS__',f_path=c.f_path)}".replace('__CS__',cs);
99 var url = "${h.url('files_home',repo_name=c.repo_name,revision='__CS__',f_path=c.f_path)}".replace('__CS__',cs);
100 window.location = url;
100 window.location = url;
101 });
101 });
102 YUE.on('hlcode','mouseup',getSelectionLink("${_('Selection link')}"))
102 YUE.on('hlcode','mouseup',getSelectionLink("${_('Selection link')}"))
103 });
103 });
104 </script>
104 </script>
General Comments 0
You need to be logged in to leave comments. Login now