8687.15.23
by Karl Fogel
Add the copyright header block to more files. |
1 |
/* Copyright 2009 Canonical Ltd. This software is licensed under the
|
2 |
* GNU Affero General Public License version 3 (see the file LICENSE).
|
|
7530.5.10
by Michael Nelson
Finished updating comment tags for update_archive_build_statuses.js. |
3 |
*
|
4 |
* The soyuz update_archive_build_statuses module uses the LP
|
|
5 |
* DynamicDomUpdater plugin for two separate tables on the archive/ppa
|
|
6 |
* pages.
|
|
7 |
*
|
|
8 |
* The first is the Archive/PPA Build Summary table, the configuration of
|
|
9 |
* which is set in build_summary_table_dynamic_update_config.
|
|
10 |
*
|
|
11 |
* The second is the Archive/PPA source package table, the configuration of
|
|
12 |
* which is set in source_package_table_dynamic_update_config.
|
|
13 |
*/
|
|
11315.5.4
by Michael Nelson
Converted the namespace of the dynamic_dom_updater module. |
14 |
YUI.add('lp.soyuz.update_archive_build_statuses', function(Y){ |
7434.6.4
by Michael Nelson
Initial dynamic updates using generalised dynamic dom updater |
15 |
|
7530.5.10
by Michael Nelson
Finished updating comment tags for update_archive_build_statuses.js. |
16 |
/**
|
7530.5.15
by Michael Nelson
Updated with mars' recommended changes. |
17 |
* Create one Launchpad client to be used by both dynamic tables.
|
7530.5.11
by Michael Nelson
Updated update_archive_build_status to create one LP client to be used by both dynamic tables. |
18 |
*/
|
12421.1.12
by Tim Penhey
Fix up references to methods now in Y.lp.client instead of LP.client. |
19 |
var lp_client = new Y.lp.client.Launchpad(); |
7530.5.11
by Michael Nelson
Updated update_archive_build_status to create one LP client to be used by both dynamic tables. |
20 |
|
21 |
/**
|
|
9209.8.16
by Michael Nelson
Updated the archive build summary js making it formatting independent. |
22 |
* Configuration for the dynamic update of the build summary portlet.
|
7530.5.10
by Michael Nelson
Finished updating comment tags for update_archive_build_statuses.js. |
23 |
*/
|
9209.8.16
by Michael Nelson
Updated the archive build summary js making it formatting independent. |
24 |
var build_summary_portlet_dynamic_update_config = { |
7530.5.6
by Michael Nelson
Re-organised the update_archive_build_statuses.js script, moving functions into config objects. |
25 |
uri: null, // Note: we have to defer setting the uri until later as |
12442.1.1
by Tim Penhey
Rename LP.client.cache to LP.cache. |
26 |
// the LP.cache is not initialized until the end
|
7530.5.6
by Michael Nelson
Re-organised the update_archive_build_statuses.js script, moving functions into config objects. |
27 |
// of the page.
|
28 |
api_method_name: 'getBuildCounters', |
|
7530.5.11
by Michael Nelson
Updated update_archive_build_status to create one LP client to be used by both dynamic tables. |
29 |
lp_client: lp_client, |
7530.5.10
by Michael Nelson
Finished updating comment tags for update_archive_build_statuses.js. |
30 |
|
31 |
/**
|
|
7530.5.6
by Michael Nelson
Re-organised the update_archive_build_statuses.js script, moving functions into config objects. |
32 |
* This function knows how to update an Archive Build Status summary
|
9209.8.16
by Michael Nelson
Updated the archive build summary js making it formatting independent. |
33 |
* when given an object of the form:
|
7530.5.6
by Michael Nelson
Re-organised the update_archive_build_statuses.js script, moving functions into config objects. |
34 |
* {total: 5, failed: 3}
|
7530.5.15
by Michael Nelson
Updated with mars' recommended changes. |
35 |
*
|
7530.5.10
by Michael Nelson
Finished updating comment tags for update_archive_build_statuses.js. |
36 |
* @config domUpdateFunction
|
7530.5.6
by Michael Nelson
Re-organised the update_archive_build_statuses.js script, moving functions into config objects. |
37 |
*/
|
9209.8.16
by Michael Nelson
Updated the archive build summary js making it formatting independent. |
38 |
domUpdateFunction: function(portlet_node, data_object){ |
39 |
// For each node of the counter node in the portlet:
|
|
9778.1.30
by Maris Fogels
Updated a number of Node.all() callsites, and performed other small optimizations. |
40 |
portlet_node.all('.build-count').each(function(node){ |
7530.5.6
by Michael Nelson
Re-organised the update_archive_build_statuses.js script, moving functions into config objects. |
41 |
// Check whether the node has a class matching the data name
|
42 |
// of the passed in data, and if so, set the innerHTML to
|
|
9209.8.16
by Michael Nelson
Updated the archive build summary js making it formatting independent. |
43 |
// the corresponding value.
|
7530.5.6
by Michael Nelson
Re-organised the update_archive_build_statuses.js script, moving functions into config objects. |
44 |
Y.each(data_object, function(data_value, data_name){ |
45 |
if (node.hasClass(data_name)){ |
|
9778.1.30
by Maris Fogels
Updated a number of Node.all() callsites, and performed other small optimizations. |
46 |
var previous_value = node.get("innerHTML"); |
7530.5.6
by Michael Nelson
Re-organised the update_archive_build_statuses.js script, moving functions into config objects. |
47 |
node.set("innerHTML", data_value); |
48 |
// If the value changed, just put a quick anim
|
|
49 |
// on the parent row.
|
|
50 |
if (previous_value != data_value.toString()){ |
|
51 |
var anim = Y.lazr.anim.green_flash({ |
|
52 |
node: node.get("parentNode") |
|
53 |
});
|
|
54 |
anim.run(); |
|
55 |
}
|
|
7434.6.4
by Michael Nelson
Initial dynamic updates using generalised dynamic dom updater |
56 |
}
|
7530.5.6
by Michael Nelson
Re-organised the update_archive_build_statuses.js script, moving functions into config objects. |
57 |
});
|
7434.6.4
by Michael Nelson
Initial dynamic updates using generalised dynamic dom updater |
58 |
});
|
7530.5.6
by Michael Nelson
Re-organised the update_archive_build_statuses.js script, moving functions into config objects. |
59 |
},
|
7434.6.4
by Michael Nelson
Initial dynamic updates using generalised dynamic dom updater |
60 |
|
7530.5.10
by Michael Nelson
Finished updating comment tags for update_archive_build_statuses.js. |
61 |
/**
|
7530.5.6
by Michael Nelson
Re-organised the update_archive_build_statuses.js script, moving functions into config objects. |
62 |
* This function knows whether the Archive Build Summary status
|
63 |
* table should stop dynamic updating. It checks whether there are
|
|
64 |
* any pending builds.
|
|
7530.5.15
by Michael Nelson
Updated with mars' recommended changes. |
65 |
*
|
7530.5.10
by Michael Nelson
Finished updating comment tags for update_archive_build_statuses.js. |
66 |
* @config stopUpdatesCheckFunction
|
7530.5.6
by Michael Nelson
Re-organised the update_archive_build_statuses.js script, moving functions into config objects. |
67 |
*/
|
9209.8.16
by Michael Nelson
Updated the archive build summary js making it formatting independent. |
68 |
stopUpdatesCheckFunction: function(portlet_node){ |
7530.5.6
by Michael Nelson
Re-organised the update_archive_build_statuses.js script, moving functions into config objects. |
69 |
// Stop updating only when there are zero pending builds:
|
9778.1.16
by Maris Fogels
Renamed deprecated Node.query() to Node.one(). |
70 |
var pending_elem = portlet_node.one(".pending"); |
7530.5.14
by Michael Nelson
Removed JS lint and removed testing intervals of 5seconds (so default of 60secs will be used). |
71 |
if (pending_elem === null){ |
7530.5.6
by Michael Nelson
Re-organised the update_archive_build_statuses.js script, moving functions into config objects. |
72 |
return true; |
73 |
}
|
|
74 |
var pending_val = pending_elem.get("innerHTML"); |
|
75 |
return pending_val == "0"; |
|
7530.5.5
by Michael Nelson
Finished functionality for dynamic package tables. Now for a bit of a cleanup. |
76 |
}
|
7530.5.14
by Michael Nelson
Removed JS lint and removed testing intervals of 5seconds (so default of 60secs will be used). |
77 |
};
|
7530.5.6
by Michael Nelson
Re-organised the update_archive_build_statuses.js script, moving functions into config objects. |
78 |
|
7434.6.7
by Michael Nelson
Added functionality to stop dynamic updates conditionally. Updated the initialization code so that it only executes when the table is ready. |
79 |
|
80 |
/*
|
|
7530.5.4
by Michael Nelson
Initial work on updating the source package table. Work in progress. |
81 |
* Initialization of the build count summary dynamic table updates.
|
82 |
*/
|
|
7586.1.1
by Michael Nelson
Changed the initialization of the soyuz dynamic js stuff to use domready rather than contentready, related to elusive bug 316697. |
83 |
Y.on("domready", function(){ |
9209.8.16
by Michael Nelson
Updated the archive build summary js making it formatting independent. |
84 |
// Grab the Archive build count portlet and tell it how to
|
7530.5.5
by Michael Nelson
Finished functionality for dynamic package tables. Now for a bit of a cleanup. |
85 |
// update itself:
|
9778.1.12
by Maris Fogels
Update deprecated Y.get() for Y.one() |
86 |
var portlet = Y.one('div#build-status-summary'); |
9209.8.16
by Michael Nelson
Updated the archive build summary js making it formatting independent. |
87 |
build_summary_portlet_dynamic_update_config.uri = |
12442.1.1
by Tim Penhey
Rename LP.client.cache to LP.cache. |
88 |
LP.cache.context.self_link; |
11315.5.4
by Michael Nelson
Converted the namespace of the dynamic_dom_updater module. |
89 |
portlet.plug(Y.lp.soyuz.dynamic_dom_updater.DynamicDomUpdater, |
9209.8.16
by Michael Nelson
Updated the archive build summary js making it formatting independent. |
90 |
build_summary_portlet_dynamic_update_config); |
7586.1.1
by Michael Nelson
Changed the initialization of the soyuz dynamic js stuff to use domready rather than contentready, related to elusive bug 316697. |
91 |
});
|
7530.5.4
by Michael Nelson
Initial work on updating the source package table. Work in progress. |
92 |
|
7530.5.10
by Michael Nelson
Finished updating comment tags for update_archive_build_statuses.js. |
93 |
/**
|
94 |
* Configuration for the dynamic update of the source package table.
|
|
95 |
*/
|
|
7530.5.6
by Michael Nelson
Re-organised the update_archive_build_statuses.js script, moving functions into config objects. |
96 |
var source_package_table_dynamic_update_config = { |
97 |
uri: null, // Note: we have to defer setting the uri until later as |
|
12442.1.1
by Tim Penhey
Rename LP.client.cache to LP.cache. |
98 |
// the LP.cache is not initialized until the end
|
7530.5.6
by Michael Nelson
Re-organised the update_archive_build_statuses.js script, moving functions into config objects. |
99 |
// of the page.
|
100 |
api_method_name: 'getBuildSummariesForSourceIds', |
|
7530.5.11
by Michael Nelson
Updated update_archive_build_status to create one LP client to be used by both dynamic tables. |
101 |
lp_client: lp_client, |
8137.17.24
by Barry Warsaw
thread merge |
102 |
|
7530.5.10
by Michael Nelson
Finished updating comment tags for update_archive_build_statuses.js. |
103 |
/**
|
7530.5.6
by Michael Nelson
Re-organised the update_archive_build_statuses.js script, moving functions into config objects. |
104 |
* This custom function knows how to update the table on PPA/Archive
|
105 |
* pages that displays the current batch of source packages with their
|
|
106 |
* build statuses.
|
|
7530.5.15
by Michael Nelson
Updated with mars' recommended changes. |
107 |
*
|
7530.5.10
by Michael Nelson
Finished updating comment tags for update_archive_build_statuses.js. |
108 |
* @config domUpdateFunction
|
7530.5.6
by Michael Nelson
Re-organised the update_archive_build_statuses.js script, moving functions into config objects. |
109 |
*/
|
7530.5.7
by Michael Nelson
Updating js files with YUI Doc tags. |
110 |
domUpdateFunction: function(table_node, data_object){ |
7530.5.6
by Michael Nelson
Re-organised the update_archive_build_statuses.js script, moving functions into config objects. |
111 |
// For each source id in the data object:
|
112 |
Y.each(data_object, function(build_summary, source_id){ |
|
11315.5.6
by Michael Nelson
Lint |
113 |
// Grab the related td element (and fail silently if it
|
114 |
// doesn't exist).
|
|
9778.1.12
by Maris Fogels
Update deprecated Y.get() for Y.one() |
115 |
var td_elem = Y.one("#pubstatus" + source_id); |
8137.17.24
by Barry Warsaw
thread merge |
116 |
if (td_elem === null) { |
7530.5.6
by Michael Nelson
Re-organised the update_archive_build_statuses.js script, moving functions into config objects. |
117 |
return; |
118 |
}
|
|
119 |
||
120 |
// We'll need to remember whether we've change the UI so that
|
|
121 |
// we can add a flash at the end if we do:
|
|
122 |
var td_ui_changed = false; |
|
9778.1.16
by Maris Fogels
Renamed deprecated Node.query() to Node.one(). |
123 |
var img_node = td_elem.one('img'); |
7530.5.6
by Michael Nelson
Re-organised the update_archive_build_statuses.js script, moving functions into config objects. |
124 |
|
125 |
// If the status has changed then we need to update the td
|
|
126 |
// element's class and image:
|
|
8137.17.24
by Barry Warsaw
thread merge |
127 |
if (!td_elem.hasClass(build_summary.status)) { |
7530.5.6
by Michael Nelson
Re-organised the update_archive_build_statuses.js script, moving functions into config objects. |
128 |
td_ui_changed = true; |
129 |
||
130 |
// Update the class on the td element
|
|
131 |
td_elem.setAttribute("class", "build_status"); |
|
132 |
td_elem.addClass(build_summary.status); |
|
133 |
||
8155.2.2
by Michael Nelson
Updated 'update_archive_build_statuses.js' with Gavin's recommendations. |
134 |
// Clear the contents of the node and set the image
|
135 |
// icon:
|
|
8155.2.1
by Michael Nelson
Fixing bug-356864 by completely clearing the build statuses rather than deleting each individually (to avoid http://yuilibrary.com/projects/yui3/ticket/2526023). |
136 |
td_elem.set("innerHTML", ''); |
137 |
||
7530.5.6
by Michael Nelson
Re-organised the update_archive_build_statuses.js script, moving functions into config objects. |
138 |
// Change the src and title etc of the image
|
8137.17.24
by Barry Warsaw
thread merge |
139 |
if (img_node !== null) { |
8155.2.2
by Michael Nelson
Updated 'update_archive_build_statuses.js' with Gavin's recommendations. |
140 |
td_elem.appendChild(img_node); |
7530.5.6
by Michael Nelson
Re-organised the update_archive_build_statuses.js script, moving functions into config objects. |
141 |
var new_src = null; |
142 |
var new_title = ''; |
|
8137.17.24
by Barry Warsaw
thread merge |
143 |
switch(build_summary.status) { |
7530.5.6
by Michael Nelson
Re-organised the update_archive_build_statuses.js script, moving functions into config objects. |
144 |
case 'BUILDING': |
8478.4.2
by Michael Nelson
Updated to the new build icon 'processing.gif' |
145 |
new_src = '/@@/processing'; |
9778.1.30
by Maris Fogels
Updated a number of Node.all() callsites, and performed other small optimizations. |
146 |
new_title = 'There are some builds currently ' + |
7530.5.6
by Michael Nelson
Re-organised the update_archive_build_statuses.js script, moving functions into config objects. |
147 |
'building.'; |
148 |
break; |
|
149 |
case 'NEEDSBUILD': |
|
150 |
new_src = '/@@/build-needed'; |
|
9778.1.30
by Maris Fogels
Updated a number of Node.all() callsites, and performed other small optimizations. |
151 |
new_title = 'There are some builds waiting to ' + |
7530.5.6
by Michael Nelson
Re-organised the update_archive_build_statuses.js script, moving functions into config objects. |
152 |
'be built.'; |
153 |
break; |
|
154 |
case 'FAILEDTOBUILD': |
|
155 |
new_src = '/@@/no'; |
|
156 |
new_title = 'There were build failures.'; |
|
157 |
break; |
|
8137.17.24
by Barry Warsaw
thread merge |
158 |
case 'FULLYBUILT_PENDING': |
8463.1.2
by Michael Nelson
Updated the display of the FULLYBUILT_PENDING status to use the new icon. |
159 |
new_src = '/@@/build-success-publishing'; |
8137.17.24
by Barry Warsaw
thread merge |
160 |
new_title = 'All builds were built successfully' + |
161 |
' but have not yet been published.'; |
|
162 |
break; |
|
7530.5.6
by Michael Nelson
Re-organised the update_archive_build_statuses.js script, moving functions into config objects. |
163 |
default: |
164 |
new_src = '/@@/yes'; |
|
165 |
new_title = 'All builds were built successfully.'; |
|
7530.5.14
by Michael Nelson
Removed JS lint and removed testing intervals of 5seconds (so default of 60secs will be used). |
166 |
}
|
7530.5.6
by Michael Nelson
Re-organised the update_archive_build_statuses.js script, moving functions into config objects. |
167 |
img_node.setAttribute("src", new_src); |
168 |
img_node.setAttribute("title", new_title); |
|
169 |
img_node.setAttribute("alt", new_title); |
|
170 |
}
|
|
171 |
}
|
|
172 |
||
7530.5.10
by Michael Nelson
Finished updating comment tags for update_archive_build_statuses.js. |
173 |
// If the length of the builds has changed, then assume
|
174 |
// the ui has changed, otherwise we don't update them.
|
|
7530.5.6
by Michael Nelson
Re-organised the update_archive_build_statuses.js script, moving functions into config objects. |
175 |
var current_build_links = td_elem.getElementsByTagName('a'); |
8137.17.24
by Barry Warsaw
thread merge |
176 |
if (current_build_links === null) { |
7530.5.6
by Michael Nelson
Re-organised the update_archive_build_statuses.js script, moving functions into config objects. |
177 |
num_current_links = 0; |
178 |
} else { |
|
179 |
num_current_links = current_build_links.size(); |
|
180 |
}
|
|
8137.17.24
by Barry Warsaw
thread merge |
181 |
if (build_summary.builds.length != num_current_links) { |
7530.5.6
by Michael Nelson
Re-organised the update_archive_build_statuses.js script, moving functions into config objects. |
182 |
td_ui_changed = true; |
183 |
||
8155.2.2
by Michael Nelson
Updated 'update_archive_build_statuses.js' with Gavin's recommendations. |
184 |
// Clear the contents of the node and set the image icon:
|
8155.2.1
by Michael Nelson
Fixing bug-356864 by completely clearing the build statuses rather than deleting each individually (to avoid http://yuilibrary.com/projects/yui3/ticket/2526023). |
185 |
td_elem.set("innerHTML", ''); |
8155.2.2
by Michael Nelson
Updated 'update_archive_build_statuses.js' with Gavin's recommendations. |
186 |
if (img_node !== null) { |
187 |
td_elem.appendChild(img_node); |
|
188 |
}
|
|
7530.5.6
by Michael Nelson
Re-organised the update_archive_build_statuses.js script, moving functions into config objects. |
189 |
|
190 |
// Add the new links, unless the status summary is
|
|
191 |
// fullybuilt:
|
|
8137.17.24
by Barry Warsaw
thread merge |
192 |
if (build_summary.status != "FULLYBUILT") { |
7530.5.6
by Michael Nelson
Re-organised the update_archive_build_statuses.js script, moving functions into config objects. |
193 |
Y.each(build_summary.builds, function(build){ |
7530.5.10
by Michael Nelson
Finished updating comment tags for update_archive_build_statuses.js. |
194 |
// Create the web-link href from the api link:
|
7530.5.6
by Michael Nelson
Re-organised the update_archive_build_statuses.js script, moving functions into config objects. |
195 |
var build_href = build.self_link.replace( |
196 |
/\/api\/[^\/]*\//, '/'); |
|
197 |
var new_link = Y.Node.create( |
|
8155.2.1
by Michael Nelson
Fixing bug-356864 by completely clearing the build statuses rather than deleting each individually (to avoid http://yuilibrary.com/projects/yui3/ticket/2526023). |
198 |
"<a>" + build.arch_tag + "</a>"); |
7530.5.6
by Michael Nelson
Re-organised the update_archive_build_statuses.js script, moving functions into config objects. |
199 |
new_link.setAttribute("href", build_href); |
200 |
new_link.setAttribute("title", build.title); |
|
201 |
td_elem.appendChild(new_link); |
|
7530.5.14
by Michael Nelson
Removed JS lint and removed testing intervals of 5seconds (so default of 60secs will be used). |
202 |
});
|
7530.5.6
by Michael Nelson
Re-organised the update_archive_build_statuses.js script, moving functions into config objects. |
203 |
}
|
204 |
}
|
|
205 |
||
206 |
// Finally, add an animation if we've changed...
|
|
8137.17.24
by Barry Warsaw
thread merge |
207 |
if (td_ui_changed) { |
7530.5.6
by Michael Nelson
Re-organised the update_archive_build_statuses.js script, moving functions into config objects. |
208 |
var anim = Y.lazr.anim.green_flash({node: td_elem}); |
209 |
anim.run(); |
|
210 |
}
|
|
211 |
||
7530.5.14
by Michael Nelson
Removed JS lint and removed testing intervals of 5seconds (so default of 60secs will be used). |
212 |
});
|
7530.5.6
by Michael Nelson
Re-organised the update_archive_build_statuses.js script, moving functions into config objects. |
213 |
},
|
214 |
||
7530.5.10
by Michael Nelson
Finished updating comment tags for update_archive_build_statuses.js. |
215 |
/**
|
9778.1.30
by Maris Fogels
Updated a number of Node.all() callsites, and performed other small optimizations. |
216 |
* This function evaluates the parameters required for the
|
7530.5.10
by Michael Nelson
Finished updating comment tags for update_archive_build_statuses.js. |
217 |
* getBuildSummariesForSourceIds api function, using the current
|
218 |
* state of the DOM subtree (ie. It finds the ids of builds in the
|
|
219 |
* subtree that are have a class of either NEEDSBUILD or BUILDING.)
|
|
7530.5.15
by Michael Nelson
Updated with mars' recommended changes. |
220 |
*
|
7530.5.10
by Michael Nelson
Finished updating comment tags for update_archive_build_statuses.js. |
221 |
* @config parameterEvaluatorFunction
|
7530.5.6
by Michael Nelson
Re-organised the update_archive_build_statuses.js script, moving functions into config objects. |
222 |
*/
|
7530.5.8
by Michael Nelson
Finished adding YUI DOC tags to lp_dynamic_dom_updater.js. |
223 |
parameterEvaluatorFunction: function(table_node){ |
11315.5.6
by Michael Nelson
Lint |
224 |
// Grab all the td's with the class 'build_status' and an
|
225 |
// additional class of either 'NEEDSBUILD' or 'BUILDING':
|
|
9778.1.15
by Maris Fogels
Replaced deprecated Node.queryAll with Node.all(). |
226 |
var td_list = table_node.all('td.build_status'); |
7530.5.6
by Michael Nelson
Re-organised the update_archive_build_statuses.js script, moving functions into config objects. |
227 |
var tds_needsbuild = td_list.filter(".NEEDSBUILD"); |
228 |
var tds_building = td_list.filter(".BUILDING"); |
|
11315.5.6
by Michael Nelson
Lint |
229 |
var tds_fullybuilt_pending = td_list.filter( |
230 |
".FULLYBUILT_PENDING"); |
|
7530.5.6
by Michael Nelson
Re-organised the update_archive_build_statuses.js script, moving functions into config objects. |
231 |
|
9778.1.30
by Maris Fogels
Updated a number of Node.all() callsites, and performed other small optimizations. |
232 |
if (tds_needsbuild.size() === 0 && |
233 |
tds_building.size() === 0 && |
|
234 |
tds_fullybuilt_pending.size() === 0) { |
|
7530.5.6
by Michael Nelson
Re-organised the update_archive_build_statuses.js script, moving functions into config objects. |
235 |
return null; |
236 |
}
|
|
237 |
||
7530.5.14
by Michael Nelson
Removed JS lint and removed testing intervals of 5seconds (so default of 60secs will be used). |
238 |
var source_ids = []; |
7530.5.6
by Michael Nelson
Re-organised the update_archive_build_statuses.js script, moving functions into config objects. |
239 |
var appendSourceIdForTD = function(node){ |
240 |
var elem_id = node.get('id'); |
|
241 |
var source_id = elem_id.replace('pubstatus', ''); |
|
242 |
source_ids.push(source_id); |
|
7530.5.14
by Michael Nelson
Removed JS lint and removed testing intervals of 5seconds (so default of 60secs will be used). |
243 |
};
|
7530.5.6
by Michael Nelson
Re-organised the update_archive_build_statuses.js script, moving functions into config objects. |
244 |
Y.each(tds_needsbuild, appendSourceIdForTD); |
245 |
Y.each(tds_building, appendSourceIdForTD); |
|
8137.17.24
by Barry Warsaw
thread merge |
246 |
Y.each(tds_fullybuilt_pending, appendSourceIdForTD); |
7530.5.6
by Michael Nelson
Re-organised the update_archive_build_statuses.js script, moving functions into config objects. |
247 |
|
8137.17.24
by Barry Warsaw
thread merge |
248 |
if (source_ids.length === 0) { |
7530.5.6
by Michael Nelson
Re-organised the update_archive_build_statuses.js script, moving functions into config objects. |
249 |
return null; |
7530.5.5
by Michael Nelson
Finished functionality for dynamic package tables. Now for a bit of a cleanup. |
250 |
} else { |
7530.5.6
by Michael Nelson
Re-organised the update_archive_build_statuses.js script, moving functions into config objects. |
251 |
return { source_ids: "[" + source_ids.join(',') + "]"}; |
252 |
}
|
|
253 |
},
|
|
254 |
||
7530.5.10
by Michael Nelson
Finished updating comment tags for update_archive_build_statuses.js. |
255 |
/**
|
7530.5.6
by Michael Nelson
Re-organised the update_archive_build_statuses.js script, moving functions into config objects. |
256 |
* This function knows whether the dynamic updating should continue
|
7530.5.10
by Michael Nelson
Finished updating comment tags for update_archive_build_statuses.js. |
257 |
* or not, by examining the DOM subtree.
|
7530.5.6
by Michael Nelson
Re-organised the update_archive_build_statuses.js script, moving functions into config objects. |
258 |
*/
|
7530.5.8
by Michael Nelson
Finished adding YUI DOC tags to lp_dynamic_dom_updater.js. |
259 |
stopUpdatesCheckFunction: function(table_node){ |
7530.5.6
by Michael Nelson
Re-organised the update_archive_build_statuses.js script, moving functions into config objects. |
260 |
// Stop updating only when there aren't any sources to update:
|
9778.1.15
by Maris Fogels
Replaced deprecated Node.queryAll with Node.all(). |
261 |
var td_list = table_node.all('td.build_status'); |
9778.1.30
by Maris Fogels
Updated a number of Node.all() callsites, and performed other small optimizations. |
262 |
return (td_list.filter(".NEEDSBUILD").size() === 0 && |
263 |
td_list.filter(".BUILDING").size() === 0 && |
|
264 |
td_list.filter(".FULLYBUILT_PENDING").size() === 0); |
|
7530.5.6
by Michael Nelson
Re-organised the update_archive_build_statuses.js script, moving functions into config objects. |
265 |
}
|
7530.5.14
by Michael Nelson
Removed JS lint and removed testing intervals of 5seconds (so default of 60secs will be used). |
266 |
};
|
7530.5.4
by Michael Nelson
Initial work on updating the source package table. Work in progress. |
267 |
|
268 |
/*
|
|
7530.5.10
by Michael Nelson
Finished updating comment tags for update_archive_build_statuses.js. |
269 |
* Initialization of the source package table dynamic updater.
|
7434.6.4
by Michael Nelson
Initial dynamic updates using generalised dynamic dom updater |
270 |
*/
|
7586.1.1
by Michael Nelson
Changed the initialization of the soyuz dynamic js stuff to use domready rather than contentready, related to elusive bug 316697. |
271 |
Y.on("domready", function(){ |
7968.2.1
by Michael Nelson
Moved changes from previous approved but stale branch to fresh branch. |
272 |
// Grab the packages table and tell it how to update itself.
|
273 |
// Note: there are situations, such as displaying empty result
|
|
274 |
// sets, when the table will not be on the page.
|
|
9778.1.12
by Maris Fogels
Update deprecated Y.get() for Y.one() |
275 |
var table = Y.one('table#packages_list'); |
8137.17.24
by Barry Warsaw
thread merge |
276 |
if (table !== null) { |
7968.2.1
by Michael Nelson
Moved changes from previous approved but stale branch to fresh branch. |
277 |
source_package_table_dynamic_update_config.uri = |
12442.1.1
by Tim Penhey
Rename LP.client.cache to LP.cache. |
278 |
LP.cache.context.self_link; |
11315.5.4
by Michael Nelson
Converted the namespace of the dynamic_dom_updater module. |
279 |
table.plug(Y.lp.soyuz.dynamic_dom_updater.DynamicDomUpdater, |
7968.2.1
by Michael Nelson
Moved changes from previous approved but stale branch to fresh branch. |
280 |
source_package_table_dynamic_update_config); |
281 |
}
|
|
7586.1.1
by Michael Nelson
Changed the initialization of the soyuz dynamic js stuff to use domready rather than contentready, related to elusive bug 316697. |
282 |
});
|
12421.1.12
by Tim Penhey
Fix up references to methods now in Y.lp.client instead of LP.client. |
283 |
}, "0.1", {"requires":["anim", |
284 |
"node", |
|
285 |
"lazr.anim", |
|
286 |
"lp.client", |
|
287 |
"lp.soyuz.dynamic_dom_updater"]}); |