1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
|
<html
xmlns="http://www.w3.org/1999/xhtml"
xmlns:tal="http://xml.zope.org/namespaces/tal"
xmlns:metal="http://xml.zope.org/namespaces/metal"
xmlns:i18n="http://xml.zope.org/namespaces/i18n"
metal:use-macro="view/macro:page/main_only"
i18n:domain="launchpad"
>
<body>
<div metal:fill-slot="main">
<div class="top-portlet">
<div metal:use-macro="context/@@launchpad_form/form">
<div class="form" metal:fill-slot="widgets">
<table>
<tal:primary_dependency
define="widget nocall:view/widgets/primary_dependencies|nothing"
condition="widget">
<metal:widget
metal:use-macro="context/@@launchpad_form/widget_row" />
</tal:primary_dependency>
<tal:primary_components
define="widget nocall:view/widgets/primary_components|nothing"
condition="widget">
<metal:widget
metal:use-macro="context/@@launchpad_form/widget_row" />
</tal:primary_components>
<tr style="height: 2em;">
<td colspan="2"> </td>
</tr>
<tal:add_dependency
define="widget nocall:view/widgets/dependency_candidate|nothing"
condition="widget">
<metal:widget
metal:use-macro="context/@@launchpad_form/widget_row" />
</tal:add_dependency>
<tr tal:condition="not: view/has_dependencies">
<td></td>
<td>
<p id="empty-dependencies"
><i>No dependencies recorded for this PPA yet.</i></p>
</td>
</tr>
<tal:dependencies
define="widget nocall:view/widgets/selected_dependencies|nothing"
condition="view/has_dependencies">
<metal:widget
metal:use-macro="context/@@launchpad_form/widget_row" />
</tal:dependencies>
</table>
</div> <!-- widgets -->
</div> <!-- launchpad_form -->
<script type="text/javascript">
LPS.use("node", function(Y) {
// Highlight (setting bold font-weight) the label for the
// selected option in a given NodesList. Assumes the input is
// contained by the label.
function highlight_checked (nodes) {
nodes.each(function(input) {
var label = Y.one(input.get("parentNode"));
if (input.get("checked")) {
label.setStyle("fontWeight", "bold");
}
else {
label.setStyle("fontWeight", "normal");
}
});
};
var main_area = Y.one("#mainarea");
// Highlight the selected radio button input on page load.
var inputs = main_area.all("input.highlight-selected");
highlight_checked(inputs);
// Install signal handlers for all radio-button inputs to
// recalculate with options should be highlighted when one of
// them is clicked.
inputs.on("click", function(e) {
highlight_checked(inputs);
}, this);
// Install handlers to decorate selected check-box inputs when
// they get clicked. Selected options text (next sibling) will
// be decorated with 'line-through' style and rendered in
// 'red'. Options not selected (or unselected) text will be
// rendered in 'blue' and without any decoration.
main_area.all(
"input.line-through-when-checked").on('click', function(e) {
var input = e.currentTarget;
var link = input.next();
if (input.get("checked")) {
link.setStyle("color", "red");
link.setStyle("textDecoration", "line-through");
}
else {
link.setStyle("color", "blue");
link.setStyle("textDecoration", "none");
}
});
});
});
</script>
</div> <!--top-portlet -->
</div> <!--main -->
</body>
</html>
|