Indefero

Indefero Commit Details


Date:2011-01-25 18:37:29 (13 years 10 months ago)
Author:Thomas Keller
Branch:develop, feature-issue_links, feature.better-home, feature.content-md5, feature.diff-whitespace, feature.download-md5, feature.issue-links, feature.issue-of-others, feature.issue-summary, feature.search-filter, feature.webrepos, feature.wiki-default-page, master, release-1.1, release-1.2, release-1.3
Commit:ccb1bd33d4b3868fd871efb3ccc4293654c51307
Parents: 41fb1bf13c3cf0e0c5fb09cb9f3e207bd57023a4
Message:Add a clear button to the tag / branch filter input fields; simplify the jQuery code a bit.

Changes:

File differences

src/IDF/templates/idf/list-filter.html
88
99
1010
11
11
12
1213
1314
1415
16
1517
1618
1719
1820
1921
2022
21
22
23
24
2325
2426
25
26
27
28
29
30
2731
28
32
2933
30
31
34
35
36
37
3238
33
39
3440
3541
3642
......
4147
4248
4349
50
51
52
4453
45
46
54
4755
4856
4957
{literal}
$(document).ready(function() {
$("input.filter-list").each(function() {
var lists = $("ul#" + $(this).attr("rel"));
var input = $(this);
var lists = $("ul#" + input.attr("rel"));
if (lists.length == 0)
return;
var list = $(lists[0]);
var wrapper = input.parent();
// a list should contain a reasonable amount of items
// to be filterable - we also give the filter input a
// special class here so we recognize it later in case
// we have to hide it when the list view is collapsed
if (list.children("li").length > 10) {
$(this).addClass("activated");
$(this).focus(function() {
wrapper.addClass("activated");
input.focus(function() {
// ensure that the parent of the list keeps activated / opened
list.parent().addClass("activated");
if ($(this)[0].value == $(this).attr("title"))
$(this).attr("value", "").removeClass("default");
if (input.attr("value") == input.attr("title")) {
input.attr("value", "");
wrapper.removeClass("default");
}
});
$(this).blur(function() {
input.blur(function() {
list.parent().removeClass("activated");
if ($(this)[0].value.length == 0)
$(this).attr("value", $(this).attr("title")).addClass("default");
if (input.attr("value").length == 0) {
input.attr("value", input.attr("title"));
wrapper.addClass("default");
}
});
$(this).keyup(function(ev) {
input.keyup(function(ev) {
var filter = $(this)[0];
list.children("li").css('display', 'block');
list.children("li").filter(function(index) {
return true;
}).css('display', 'none');
});
wrapper.children('span').click(function() {
input.val('').keyup().blur();
});
// initialize it with the default
$(this)[0].value = "";
$(this).blur();
input.val('').blur();
}
});
});
src/IDF/templates/idf/source/mtn/changelog.html
44
55
66
7
7
8
9
10
811
912
1013
......
1720
1821
1922
20
23
24
25
26
2127
2228
2329
<div class="gradient"></div>
<h1>
{trans 'Branches'}
<input type="text" rel="branch-list" class="filter-list" title="{trans 'filter branches'}" />
<div class="input-with-delete">
<input type="text" rel="branch-list" class="filter-list" title="{trans 'filter branches'}" />
<span></span>
</div>
</h1>
<ul id="branch-list">
{foreach $branches as $selector => $branch}
{if $tags}
<h1>
{trans 'Tags'}
<input type="text" rel="tag-list" class="filter-list" title="{trans 'filter tags'}" />
<div class="input-with-delete">
<input type="text" rel="tag-list" class="filter-list" title="{trans 'filter tags'}" />
<span></span>
</div>
</h1>
<ul id="tag-list">
{foreach $tags as $selector => $tag}
src/IDF/templates/idf/source/mtn/commit.html
44
55
66
7
7
8
9
10
811
912
1013
1114
12
15
1316
1417
1518
......
1720
1821
1922
20
23
24
25
26
2127
2228
2329
2430
25
31
2632
2733
2834
<div class="gradient"></div>
<h1>
{trans 'Branches'}
<input type="text" rel="branch-list" class="filter-list" title="{trans 'filter branches'}" />
<div class="input-with-delete">
<input type="text" rel="branch-list" class="filter-list" title="{trans 'filter branches'}" />
<span></span>
</div>
</h1>
<ul id="branch-list">
{foreach $branches as $selector => $branch}
{aurl 'url', 'IDF_Views_Source::treeBase', array($project.shortname, $selector)}
<li class="{if in_array($branch, $tree_in)}active{/if}">
<li class="{if in_array($selector, $tree_in)}active{/if}">
<a href="{$url}" class="label">{$branch}</a>
</li>
{/foreach}
{if $tags}
<h1>
{trans 'Tags'}
<input type="text" rel="tag-list" class="filter-list" title="{trans 'filter tags'}" />
<div class="input-with-delete">
<input type="text" rel="tag-list" class="filter-list" title="{trans 'filter tags'}" />
<span></span>
</div>
</h1>
<ul id="tag-list">
{foreach $tags as $selector => $tag}
{aurl 'url', 'IDF_Views_Source::treeBase', array($project.shortname, $selector)}
<li class="{if in_array($tag, $tags_in)}active{/if}">
<li class="{if in_array($selector, $tags_in)}active{/if}">
<a href="{$url}" class="label">{$tag}</a>
</li>
{/foreach}
src/IDF/templates/idf/source/mtn/file.html
1919
2020
2121
22
22
23
24
25
2326
2427
25
28
29
30
31
32
33
34
35
36
37
2638
2739
28
29
30
31
32
40
41
42
3343
34
44
3545
36
46
47
48
49
50
51
52
53
3754
3855
39
40
41
42
43
56
57
58
4459
45
60
4661
62
4763
48
49
50
51
64
</table>
{aurl 'url', 'IDF_Views_Source::getFile', array($project.shortname, $commit, $fullpath)}
<p class="right soft"><a href="{$url}"><img style="vertical-align: text-bottom;" src="{media '/idf/img/package-grey.png'}" alt="{trans 'Archive'}" align="bottom" /></a> <a href="{$url}">{trans 'Download this file'}</a></p>
{/block}
{block javascript}
<script type="text/javascript" src="{media '/idf/js/prettify.js'}"></script>
<script type="text/javascript">prettyPrint();</script>
{/block}
{block context}
<p><strong>{trans 'Branches:'}</strong><br/>
<div class="expander">
<div class="gradient"></div>
<h1>
{trans 'Branches'}
<div class="input-with-delete">
<input type="text" rel="branch-list" class="filter-list" title="{trans 'filter branches'}" />
<span></span>
</div>
</h1>
<ul id="branch-list">
{foreach $branches as $selector => $branch}
{aurl 'url', 'IDF_Views_Source::treeBase', array($project.shortname, $selector)}
<span class="label{if in_array($branch, $tree_in)} active{/if}">
<a href="{$url}" class="label" title="{$branch}">
{$branch|shorten:25}
</a>
</span><br/>
<li class="{if in_array($selector, $tree_in)}active{/if}">
<a href="{$url}" class="label">{$branch}</a>
</li>
{/foreach}
</p>
</ul>
{if $tags}
<p><strong>{trans 'Tags:'}</strong><br/>
<h1>
{trans 'Tags'}
<div class="input-with-delete">
<input type="text" rel="tag-list" class="filter-list" title="{trans 'filter tags'}" />
<span></span>
</div>
</h1>
<ul id="tag-list">
{foreach $tags as $selector => $tag}
{aurl 'url', 'IDF_Views_Source::treeBase', array($project.shortname, $selector)}
<span class="label{if in_array($tag, $tags_in)} active{/if}">
<a href="{$url}" class="label" title="{$tag}">
{$tag|shorten:25}
</a>
</span><br/>
<li class="{if in_array($selector, $tags_in)}active{/if}">
<a href="{$url}" class="label">{$tag}</a>
</li>
{/foreach}
</p>
</ul>
{/if}
</div>
{/block}
{block javascript}
<script type="text/javascript" src="{media '/idf/js/prettify.js'}"></script>
<script type="text/javascript">prettyPrint();</script>
{/block}
src/IDF/templates/idf/source/mtn/tree.html
5151
5252
5353
54
55
5654
5755
5856
5957
6058
6159
62
60
61
62
63
6364
6465
6566
......
7273
7374
7475
75
76
77
78
79
7680
7781
7882
......
8589
8690
8791
92
<a href="{$url}"><img style="vertical-align: text-bottom;" src="{media '/idf/img/package-grey.png'}" alt="{trans 'Archive'}" align="bottom" /></a> <a href="{$url}">{trans 'Download this version'}</a> {trans 'or'}
<kbd>mtn clone {$project.getSourceAccessUrl($user, $commit)}</kbd> <a href="{url 'IDF_Views_Source::help', array($project.shortname)}"><img style="vertical-align: text-bottom;" src="{media '/idf/img/help.png'}" alt="{trans 'Help'}" /></a>
</p>
{/block}
{block context}
<div class="expander">
<div class="gradient"></div>
<h1>
{trans 'Branches'}
<input type="text" rel="branch-list" class="filter-list" title="{trans 'filter branches'}" />
<div class="input-with-delete">
<input type="text" rel="branch-list" class="filter-list" title="{trans 'filter branches'}" />
<span></span>
</div>
</h1>
<ul id="branch-list">
{foreach $branches as $selector => $branch}
{if $tags}
<h1>
{trans 'Tags'}
<input type="text" rel="tag-list" class="filter-list" title="{trans 'filter tags'}" />
<div class="input-with-delete">
<input type="text" rel="tag-list" class="filter-list" title="{trans 'filter tags'}" />
<span></span>
</div>
</h1>
<ul id="tag-list">
{foreach $tags as $selector => $tag}
{/if}
</div>
{/block}
www/media/idf/css/style.css
918918
919919
920920
921
922
923
924
921
922
925923
926
927
928
929924
930925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
931949
932950
933
934
951
952
935953
936954
937955
938
939
940
956
957
941958
display: none;
}
.context > .expander input.filter-list {
font-size: 11px;
font-weight: normal;
color: #333;
.context > .expander div.input-with-delete {
padding: 1px;
border: 1px dotted #474747;
margin-left: 10px;
padding: 2px;
width: 80px;
display: none;
float: right;
margin-left: 10px;
margin-top: -3px;
}
.context > .expander div.input-with-delete * {
vertical-align: middle;
}
.context > .expander div.input-with-delete span {
display: inline-block;
width: 13px;
height: 12px;
background: url(../img/clear.png) left top no-repeat;
cursor: pointer;
}
.context > .expander div.input-with-delete input.filter-list {
font-size: 11px;
font-weight: normal;
color: #333;
border: 0;
width: 100px;
height: 11px;
}
.context > .expander:hover input.filter-list.activated,
.context > .expander.activated input.filter-list.activated {
.context > .expander:hover div.input-with-delete.activated,
.context > .expander.activated div.input-with-delete.activated {
display: block;
}
.context > .expander input.filter-list.default {
color: #aaa;
border-color: #aaa;
.context > .expander div.input-with-delete.default {
opacity: 0.5;
}

Archive Download the corresponding diff file

Page rendered in 0.09507s using 13 queries.