Merge lp:~edwin-grubbs/launchpad/bug-513260-registry-js-module-names into lp:launchpad

Proposed by Edwin Grubbs
Status: Merged
Approved by: Edwin Grubbs
Approved revision: not available
Merged at revision: not available
Proposed branch: lp:~edwin-grubbs/launchpad/bug-513260-registry-js-module-names
Merge into: lp:launchpad
Diff against target: 937 lines (+240/-224)
18 files modified
lib/canonical/launchpad/javascript/lp/dragscroll.js (+132/-122)
lib/canonical/launchpad/javascript/lp/mapping.js (+34/-34)
lib/canonical/launchpad/javascript/lp/picker.js (+4/-4)
lib/canonical/launchpad/javascript/registry/milestoneoverlay.js (+5/-5)
lib/canonical/launchpad/javascript/registry/milestonetable.js (+35/-27)
lib/canonical/launchpad/javascript/registry/tests/milestone_table.html (+5/-5)
lib/canonical/launchpad/javascript/registry/tests/test_milestone_table.js (+3/-3)
lib/canonical/launchpad/javascript/registry/tests/timeline-iframe.html (+4/-4)
lib/canonical/launchpad/javascript/registry/tests/timeline.html (+2/-1)
lib/canonical/launchpad/javascript/registry/tests/timeline.js (+1/-1)
lib/lp/app/templates/base-layout-macros.pt (+2/-0)
lib/lp/registry/browser/__init__.py (+4/-4)
lib/lp/registry/browser/tests/productrelease-views.txt (+1/-1)
lib/lp/registry/browser/tests/productseries-views.txt (+3/-3)
lib/lp/registry/templates/distroseries-index.pt (+0/-3)
lib/lp/registry/templates/object-timeline-graph.pt (+3/-2)
lib/lp/registry/templates/productrelease-add-from-series.pt (+2/-2)
lib/lp/registry/templates/productseries-index.pt (+0/-3)
To merge this branch: bzr merge lp:~edwin-grubbs/launchpad/bug-513260-registry-js-module-names
Reviewer Review Type Date Requested Status
Abel Deuring (community) code Approve
Review via email: mp+19142@code.launchpad.net

Commit message

Fixed conflicts between YUI module names, namespaces, and filenames.

To post a comment you must log in.
Revision history for this message
Edwin Grubbs (edwin-grubbs) wrote :
Download full text (4.8 KiB)

Summary
-------

Fixed conflicts between YUI module names, namespaces, and filenames.

Implementation details
----------------------

The DragScrollEventHandler was declared as a global instead of
in a YUI module, since it doesn't any YUI code. For consistency and
to avoid polluting the global namespace, I moved it into a YUI module.
This involved indenting all the code, so I have also provided a separate
diff at the bottom which shows the non-whitespace changes to the file.
    lib/canonical/launchpad/javascript/lp/dragscroll.js

The milestonetable.js file was being loaded by the productseries-index.pt
and distroseriesindex.pt files directly instead of the base layout. This
is bad since it prevents the js files from being combined.
    lib/lp/app/templates/base-layout-macros.pt
    lib/lp/registry/templates/distroseries-index.pt
    lib/lp/registry/templates/productseries-index.pt

Just renaming modules, namespaces, or files. The yui directory was
also moved from icing/yui/current/build to icing/yui a while ago, and
these tests had not been run since then, so I fixed that also.
    lib/canonical/launchpad/javascript/lp/mapping.js
    lib/canonical/launchpad/javascript/lp/picker.js
    lib/canonical/launchpad/javascript/registry/milestoneoverlay.js
    lib/canonical/launchpad/javascript/registry/milestonetable.js
    lib/canonical/launchpad/javascript/registry/tests/milestone_table.html
    lib/canonical/launchpad/javascript/registry/tests/test_milestone_table.js
    lib/canonical/launchpad/javascript/registry/tests/timeline-iframe.html
    lib/canonical/launchpad/javascript/registry/tests/timeline.html
    lib/canonical/launchpad/javascript/registry/tests/timeline.js
    lib/lp/registry/browser/__init__.py
    lib/lp/registry/browser/tests/productrelease-views.txt
    lib/lp/registry/browser/tests/productseries-views.txt
    lib/lp/registry/templates/object-timeline-graph.pt
    lib/lp/registry/templates/productrelease-add-from-series.pt

Tests
-----

./bin/test -vv --layer RegistryWindmillLayer
file:///./lib/canonical/launchpad/javascript/registry/tests/milestone_table.html
file:///./lib/canonical/launchpad/javascript/registry/tests/timeline.html

Demo and Q/A
------------

* Open https://launchpad.dev/firefox
    * Ensure that timeline graph still shows up and that it can be
      dragged if you zoom in until it doesn't fit.
* Open https://launchpad.dev/firefox/trunk
    * The "Create milestone" link should bring up a form overlay,
      and submitting the form should cause the milestone to appear
      in the table with a green flash.
* Open https://launchpad.dev/ubuntu/warty
    * Same test as for the firefox/trunk product series.
* Open https://launchpad.dev/people/+me/+editlocation
    * The map should appear and it should be possible to edit the
      location.
* Open https://bugs.launchpad.dev/bugs/3
    * The "Subscribe someone else" link should bring up a working picker.

Dragscroll diff without whitespace
----------------------------------

=== modified file 'lib/canonical/launchpad/javascript/lp/dragscroll.js'
--- lib/canonical/launchpad/javascript/lp/dragscroll.js 2009-10-08 17:13:13 +0000
+++ lib/canonical/launchpad/javascrip...

Read more...

Revision history for this message
Abel Deuring (adeuring) wrote :

Hi Edwin,

nice change. I think you should s/Copyright 2009/Copyright 2010/ in milestone_table.js and dragscroll.js.

review: Approve (code)

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'lib/canonical/launchpad/javascript/lp/dragscroll.js'
--- lib/canonical/launchpad/javascript/lp/dragscroll.js 2009-10-08 17:13:13 +0000
+++ lib/canonical/launchpad/javascript/lp/dragscroll.js 2010-02-12 16:34:16 +0000
@@ -1,4 +1,10 @@
1/*1/* Copyright 2010 Canonical Ltd. This software is licensed under the
2 * GNU Affero General Public License version 3 (see the file LICENSE).
3 *
4 * A milestone form overlay that can create a milestone within any page.
5 *
6 * @module Y.lp.dragscroll
7 *
2 * Based on dragscroll script by Nicolas Mendoza <nicolasm@opera.com>.8 * Based on dragscroll script by Nicolas Mendoza <nicolasm@opera.com>.
3 * http://people.opera.com/nicolasm/userjs/dragscroll9 * http://people.opera.com/nicolasm/userjs/dragscroll
4 */10 */
@@ -9,126 +15,130 @@
9 * @class DragScrollEventHandler15 * @class DragScrollEventHandler
10 * @constructor16 * @constructor
11 */17 */
12DragScrollEventHandler = function() {18YUI.add('lp.dragscroll', function(Y) {
13 this.dragging = false;19 var module = Y.namespace('lp.dragscroll');
14 this.last_position = null;20
15 this.event_listeners = [];21 module.DragScrollEventHandler = function() {
16}
17
18DragScrollEventHandler.prototype = {
19 /**
20 * Add the event handlers and change the cursor to indicate
21 * that drag scrolling is active.
22 *
23 * @method activate
24 */
25 activate: function() {
26 this._addEventListener("mousedown", this._startDragScroll);
27 this._addEventListener("mouseup", this._stopDragScroll);
28 this._addEventListener("mouseout", this._stopDragScroll);
29 this._addEventListener("mousemove", this._dragScroll);
30 this._setGrabCursor();
31 },
32
33 /**
34 * Remove the event handlers and change the cursor to indicate
35 * that drag scrolling is inactive.
36 *
37 * @method deactivate
38 */
39 deactivate: function() {
40 document.removeEventListener(
41 "mousedown", this._startDragScroll, false);
42 this._removeEventListeners();
43 this._unsetCursor();
44 },
45
46 _addEventListener: function(event_type, action) {
47 // Wrap the method in a different function that forces
48 // `this` to be the `DragScrollEventHandler` object.
49 var self = this;
50 var event_listener = function(e) {
51 action.call(self, e)
52 };
53 var event_args = [event_type, event_listener, false];
54 this.event_listeners.push(event_args);
55 document.addEventListener.apply(document, event_args);
56 },
57
58 _removeEventListeners: function() {
59 for (var i=0; i<this.event_listeners.length; i++) {
60 var event_args = this.event_listeners[i];
61 document.removeEventListener.apply(document, event_args);
62 }
63 },
64
65 _unsetCursor: function() {
66 document.body.style.cursor = '';
67 },
68
69 _setGrabCursor: function() {
70 // Styles for W3C, IE, Mozilla, Webkit.
71 // Unknown styles will fail to change the value.
72 document.body.style.cursor = 'move';
73 document.body.style.cursor = 'grab';
74 document.body.style.cursor = '-moz-grab';
75 document.body.style.cursor = '-webkit-grab';
76 },
77
78 _setGrabbingCursor: function() {
79 // Styles for IE, Mozilla, and Webkit.
80 // Unknown styles will fail to change the value.
81 document.body.style.cursor = 'grabbing';
82 document.body.style.cursor = '-moz-grabbing';
83 document.body.style.cursor = '-webkit-grabbing';
84 },
85
86 /**
87 * MouseDown event handler that causes _dragScroll to
88 * take action when it receives a MouseMove event.
89 *
90 * @method _startDragScroll
91 */
92 _startDragScroll: function(e) {
93 if (e.button == 0) {
94 this.dragging = true;
95 this.last_position = e;
96 this._setGrabbingCursor();
97 }
98 e.preventDefault();
99 e.stopPropagation();
100 },
101
102 /**
103 * MouseUp & MouseOut event handler that causes _dragScroll to
104 * once again ignore MouseMove events. Stopping dragging when
105 * the MouseOut event occurs is helpful, since the MouseUp event
106 * is not reliable, when the mouse is outside the window.
107 *
108 * @method _stopDragScroll
109 */
110 _stopDragScroll: function(e) {
111 this.dragging = false;22 this.dragging = false;
112 this._setGrabCursor();23 this.last_position = null;
113 e.preventDefault();24 this.event_listeners = [];
114 e.stopPropagation();25 };
115 },26
11627 module.DragScrollEventHandler.prototype = {
117 /**28 /**
118 * MouseMove event handler that calculates the movement29 * Add the event handlers and change the cursor to indicate
119 * by comparing the mouse positions in the current event and30 * that drag scrolling is active.
120 * the previous event.31 *
121 *32 * @method activate
122 * @method _dragScroll33 */
123 */34 activate: function() {
124 _dragScroll: function(e) {35 this._addEventListener("mousedown", this._startDragScroll);
125 if (this.dragging) {36 this._addEventListener("mouseup", this._stopDragScroll);
126 window.scrollBy(37 this._addEventListener("mouseout", this._stopDragScroll);
127 this.last_position.clientX - e.clientX,38 this._addEventListener("mousemove", this._dragScroll);
128 this.last_position.clientY - e.clientY);39 this._setGrabCursor();
129 this.last_position = e;40 },
130 e.preventDefault();41
131 e.stopPropagation();42 /**
43 * Remove the event handlers and change the cursor to indicate
44 * that drag scrolling is inactive.
45 *
46 * @method deactivate
47 */
48 deactivate: function() {
49 document.removeEventListener(
50 "mousedown", this._startDragScroll, false);
51 this._removeEventListeners();
52 this._unsetCursor();
53 },
54
55 _addEventListener: function(event_type, action) {
56 // Wrap the method in a different function that forces
57 // `this` to be the `DragScrollEventHandler` object.
58 var self = this;
59 var event_listener = function(e) {
60 action.call(self, e);
61 };
62 var event_args = [event_type, event_listener, false];
63 this.event_listeners.push(event_args);
64 document.addEventListener.apply(document, event_args);
65 },
66
67 _removeEventListeners: function() {
68 for (var i=0; i<this.event_listeners.length; i++) {
69 var event_args = this.event_listeners[i];
70 document.removeEventListener.apply(document, event_args);
71 }
72 },
73
74 _unsetCursor: function() {
75 document.body.style.cursor = '';
76 },
77
78 _setGrabCursor: function() {
79 // Styles for W3C, IE, Mozilla, Webkit.
80 // Unknown styles will fail to change the value.
81 document.body.style.cursor = 'move';
82 document.body.style.cursor = 'grab';
83 document.body.style.cursor = '-moz-grab';
84 document.body.style.cursor = '-webkit-grab';
85 },
86
87 _setGrabbingCursor: function() {
88 // Styles for IE, Mozilla, and Webkit.
89 // Unknown styles will fail to change the value.
90 document.body.style.cursor = 'grabbing';
91 document.body.style.cursor = '-moz-grabbing';
92 document.body.style.cursor = '-webkit-grabbing';
93 },
94
95 /**
96 * MouseDown event handler that causes _dragScroll to
97 * take action when it receives a MouseMove event.
98 *
99 * @method _startDragScroll
100 */
101 _startDragScroll: function(e) {
102 if (e.button === 0) {
103 this.dragging = true;
104 this.last_position = e;
105 this._setGrabbingCursor();
106 }
107 e.preventDefault();
108 e.stopPropagation();
109 },
110
111 /**
112 * MouseUp & MouseOut event handler that causes _dragScroll to
113 * once again ignore MouseMove events. Stopping dragging when
114 * the MouseOut event occurs is helpful, since the MouseUp event
115 * is not reliable, when the mouse is outside the window.
116 *
117 * @method _stopDragScroll
118 */
119 _stopDragScroll: function(e) {
120 this.dragging = false;
121 this._setGrabCursor();
122 e.preventDefault();
123 e.stopPropagation();
124 },
125
126 /**
127 * MouseMove event handler that calculates the movement
128 * by comparing the mouse positions in the current event and
129 * the previous event.
130 *
131 * @method _dragScroll
132 */
133 _dragScroll: function(e) {
134 if (this.dragging) {
135 window.scrollBy(
136 this.last_position.clientX - e.clientX,
137 this.last_position.clientY - e.clientY);
138 this.last_position = e;
139 e.preventDefault();
140 e.stopPropagation();
141 }
132 }142 }
133 }143 };
134};144}, "0.1", {"requires": []});
135145
=== modified file 'lib/canonical/launchpad/javascript/lp/mapping.js'
--- lib/canonical/launchpad/javascript/lp/mapping.js 2009-11-24 09:30:01 +0000
+++ lib/canonical/launchpad/javascript/lp/mapping.js 2010-02-12 16:34:16 +0000
@@ -8,19 +8,19 @@
8 * @required Google GMap28 * @required Google GMap2
9 */9 */
10YUI.add('lp.mapping', function(Y) {10YUI.add('lp.mapping', function(Y) {
11 var mapping = Y.namespace('lp.mapping');11 var module = Y.namespace('lp.mapping');
1212
13 mapping.RETURN_FALSE = function() {return false;};13 module.RETURN_FALSE = function() {return false;};
14 mapping.RETURN_NULL = function() {return null;};14 module.RETURN_NULL = function() {return null;};
1515
16 // Replace the crucial GMap functions so that the supporting functions16 // Replace the crucial GMap functions so that the supporting functions
17 // will work if the GMap script is not loaded.17 // will work if the GMap script is not loaded.
18 var gBrowserIsCompatible = mapping.RETURN_FALSE;18 var gBrowserIsCompatible = module.RETURN_FALSE;
19 var gDownloadUrl = mapping.RETURN_NULL;19 var gDownloadUrl = module.RETURN_NULL;
2020
21 mapping.has_gmaps = (typeof(GBrowserIsCompatible) == 'function');21 module.has_gmaps = (typeof(GBrowserIsCompatible) == 'function');
2222
23 if (mapping.has_gmaps) {23 if (module.has_gmaps) {
24 // The GMap2 is is loaded; use the real functions.24 // The GMap2 is is loaded; use the real functions.
25 // jslint does not like functions that look like classes.25 // jslint does not like functions that look like classes.
26 gBrowserIsCompatible = GBrowserIsCompatible;26 gBrowserIsCompatible = GBrowserIsCompatible;
@@ -37,7 +37,7 @@
37 * @param {GLatLngBounds} required_bounds the boundaries or null.37 * @param {GLatLngBounds} required_bounds the boundaries or null.
38 * @param {limit} optional max number of markers to set.38 * @param {limit} optional max number of markers to set.
39 */39 */
40 mapping.setMarkersInfoWindow = function(data, map, required_bounds,40 module.setMarkersInfoWindow = function(data, map, required_bounds,
41 limit) {41 limit) {
42 var xml = GXml.parse(data);42 var xml = GXml.parse(data);
43 var markers = xml.documentElement.getElementsByTagName("participant");43 var markers = xml.documentElement.getElementsByTagName("participant");
@@ -79,9 +79,9 @@
79 * @param {GMap2} map the Google map to add the markers to.79 * @param {GMap2} map the Google map to add the markers to.
80 * @param {limit} optional max number of markers to set.80 * @param {limit} optional max number of markers to set.
81 */81 */
82 mapping.setMarkersInfoWindowForSmallMap = function(data, map, limit) {82 module.setMarkersInfoWindowForSmallMap = function(data, map, limit) {
83 var required_bounds = new GLatLngBounds();83 var required_bounds = new GLatLngBounds();
84 mapping.setMarkersInfoWindow(data, map, required_bounds, limit);84 module.setMarkersInfoWindow(data, map, required_bounds, limit);
85 var zoom_level = map.getBoundsZoomLevel(required_bounds);85 var zoom_level = map.getBoundsZoomLevel(required_bounds);
86 // Some browsers do not display the map when the zoom_level is at the86 // Some browsers do not display the map when the zoom_level is at the
87 // end of the range, reduce the zoom_level by 1.87 // end of the range, reduce the zoom_level by 1.
@@ -100,7 +100,7 @@
100 * @param {String} lat_name the id of the latitude field.100 * @param {String} lat_name the id of the latitude field.
101 * @param {String} lng_name the id of the longitude field.101 * @param {String} lng_name the id of the longitude field.
102 */102 */
103 mapping.setLocation = function(lat, lng, geoname,103 module.setLocation = function(lat, lng, geoname,
104 tz_name, lat_name, lng_name) {104 tz_name, lat_name, lng_name) {
105 Y.one(Y.DOM.byId(lat_name)).set('value', lat);105 Y.one(Y.DOM.byId(lat_name)).set('value', lat);
106 Y.one(Y.DOM.byId(lng_name)).set('value', lng);106 Y.one(Y.DOM.byId(lng_name)).set('value', lng);
@@ -134,13 +134,13 @@
134 * @function toggleShowSmallMaps134 * @function toggleShowSmallMaps
135 * @param {Event} e the event for this callback.135 * @param {Event} e the event for this callback.
136 */136 */
137 mapping.toggleShowSmallMaps = function (checkbox) {137 module.toggleShowSmallMaps = function (checkbox) {
138 var is_shown = checkbox.get('checked');138 var is_shown = checkbox.get('checked');
139 Y.lp.launchpad_views.set('small_maps', is_shown);139 Y.lp.launchpad_views.set('small_maps', is_shown);
140 var display = is_shown ? 'block' : 'none';140 var display = is_shown ? 'block' : 'none';
141 var maps = Y.all('.small-map');141 var maps = Y.all('.small-map');
142 maps.each(function(map) {map.setStyle('display', display);});142 maps.each(function(map) {map.setStyle('display', display);});
143 if (is_shown && !mapping.has_gmaps) {143 if (is_shown && !module.has_gmaps) {
144 // The server must add the Google GMap2 dependencies to the page.144 // The server must add the Google GMap2 dependencies to the page.
145 window.location.reload();145 window.location.reload();
146 }146 }
@@ -152,14 +152,14 @@
152 * @function setupShowSmallMapsControl152 * @function setupShowSmallMapsControl
153 * @param {String} div_id the CSS3 id of the div that controls the map.153 * @param {String} div_id the CSS3 id of the div that controls the map.
154 */154 */
155 mapping.setupShowSmallMapsControl = function (div_id) {155 module.setupShowSmallMapsControl = function (div_id) {
156 var show_small_maps = Y.lp.launchpad_views.get('small_maps');156 var show_small_maps = Y.lp.launchpad_views.get('small_maps');
157 var checkbox = Y.Node.create(157 var checkbox = Y.Node.create(
158 '<input type="checkbox" name="show_small_maps" />');158 '<input type="checkbox" name="show_small_maps" />');
159 checkbox.set(159 checkbox.set(
160 'checked', show_small_maps);160 'checked', show_small_maps);
161 checkbox.on(161 checkbox.on(
162 'click', function(e) {mapping.toggleShowSmallMaps(checkbox);});162 'click', function(e) {module.toggleShowSmallMaps(checkbox);});
163 var label_text = Y.Node.create('Display map');163 var label_text = Y.Node.create('Display map');
164 var label = Y.Node.create('<label></label>');164 var label = Y.Node.create('<label></label>');
165 label.appendChild(checkbox);165 label.appendChild(checkbox);
@@ -167,7 +167,7 @@
167 var action_div = Y.one(div_id);167 var action_div = Y.one(div_id);
168 action_div.appendChild(label);168 action_div.appendChild(label);
169 if (!show_small_maps) {169 if (!show_small_maps) {
170 mapping.toggleShowSmallMaps(checkbox);170 module.toggleShowSmallMaps(checkbox);
171 }171 }
172 };172 };
173173
@@ -180,7 +180,7 @@
180 * @param {Number} center_lng a GLatLng.lng bounded number.180 * @param {Number} center_lng a GLatLng.lng bounded number.
181 * @return {GMap2} the Google map181 * @return {GMap2} the Google map
182 */182 */
183 mapping.getSmallMap = function(div_id, center_lat, center_lng) {183 module.getSmallMap = function(div_id, center_lat, center_lng) {
184 var mapdiv = Y.DOM.byId(div_id);184 var mapdiv = Y.DOM.byId(div_id);
185 mapdiv.style.width = '400px';185 mapdiv.style.width = '400px';
186 var map = new GMap2(mapdiv);186 var map = new GMap2(mapdiv);
@@ -197,12 +197,12 @@
197 * @param {Number} center_lat a GLatLng.lat bounded number.197 * @param {Number} center_lat a GLatLng.lat bounded number.
198 * @param {Number} center_lng a GLatLng.lng bounded number.198 * @param {Number} center_lng a GLatLng.lng bounded number.
199 */199 */
200 mapping.renderPersonMapSmall = function(center_lat, center_lng) {200 module.renderPersonMapSmall = function(center_lat, center_lng) {
201 mapping.setupShowSmallMapsControl('#person_map_actions');201 module.setupShowSmallMapsControl('#person_map_actions');
202 if (!gBrowserIsCompatible()) {202 if (!gBrowserIsCompatible()) {
203 return;203 return;
204 }204 }
205 var map = mapping.getSmallMap(205 var map = module.getSmallMap(
206 'person_map_div', center_lat, center_lng);206 'person_map_div', center_lat, center_lng);
207 map.addControl(new GSmallZoomControl());207 map.addControl(new GSmallZoomControl());
208 var center = new GLatLng(center_lat, center_lng);208 var center = new GLatLng(center_lat, center_lng);
@@ -218,15 +218,15 @@
218 * @param {Number} center_lat a GLatLng.lat bounded number.218 * @param {Number} center_lat a GLatLng.lat bounded number.
219 * @param {Number} center_lng a GLatLng.lng bounded number.219 * @param {Number} center_lng a GLatLng.lng bounded number.
220 */220 */
221 mapping.renderTeamMapSmall = function(center_lat, center_lng) {221 module.renderTeamMapSmall = function(center_lat, center_lng) {
222 mapping.setupShowSmallMapsControl('#team_map_actions');222 module.setupShowSmallMapsControl('#team_map_actions');
223 if (!gBrowserIsCompatible()) {223 if (!gBrowserIsCompatible()) {
224 return;224 return;
225 }225 }
226 var team_map = mapping.getSmallMap(226 var team_map = module.getSmallMap(
227 'team_map_div', center_lat, center_lng);227 'team_map_div', center_lat, center_lng);
228 gDownloadUrl("+mapdataltd", function(data) {228 gDownloadUrl("+mapdataltd", function(data) {
229 mapping.setMarkersInfoWindowForSmallMap(data, team_map);229 module.setMarkersInfoWindowForSmallMap(data, team_map);
230 });230 });
231 };231 };
232232
@@ -237,7 +237,7 @@
237 * @param {String} div_id the id of the map div.237 * @param {String} div_id the id of the map div.
238 * @return {GMap2} The Google map238 * @return {GMap2} The Google map
239 */239 */
240 mapping.getLargeMap = function(div_id) {240 module.getLargeMap = function(div_id) {
241 var mapdiv = Y.DOM.byId(div_id);241 var mapdiv = Y.DOM.byId(div_id);
242 var mapheight = (parseInt(mapdiv.offsetWidth, 10) / 16 * 9);242 var mapheight = (parseInt(mapdiv.offsetWidth, 10) / 16 * 9);
243 mapheight = Math.min(mapheight, Y.DOM.winHeight() - 180);243 mapheight = Math.min(mapheight, Y.DOM.winHeight() - 180);
@@ -276,12 +276,12 @@
276 * @param {Number} center_lat a GLatLng.lat bounded number.276 * @param {Number} center_lat a GLatLng.lat bounded number.
277 * @param {Number} center_lng a GLatLng.lng bounded number.277 * @param {Number} center_lng a GLatLng.lng bounded number.
278 */278 */
279 mapping.renderTeamMap = function(min_lat, max_lat, min_lng, max_lng,279 module.renderTeamMap = function(min_lat, max_lat, min_lng, max_lng,
280 center_lat, center_lng) {280 center_lat, center_lng) {
281 if (!gBrowserIsCompatible()) {281 if (!gBrowserIsCompatible()) {
282 return;282 return;
283 }283 }
284 var team_map = mapping.getLargeMap("team_map_div");284 var team_map = module.getLargeMap("team_map_div");
285 var center = new GLatLng(center_lat, center_lng);285 var center = new GLatLng(center_lat, center_lng);
286 team_map.setCenter(center, 0);286 team_map.setCenter(center, 0);
287 var sw = new GLatLng(min_lat, min_lng);287 var sw = new GLatLng(min_lat, min_lng);
@@ -294,7 +294,7 @@
294 G_HYBRID_MAP.getMaximumResolution(), zoom_level - 1);294 G_HYBRID_MAP.getMaximumResolution(), zoom_level - 1);
295 team_map.setZoom(zoom_level);295 team_map.setZoom(zoom_level);
296 gDownloadUrl("+mapdata", function(data) {296 gDownloadUrl("+mapdata", function(data) {
297 mapping.setMarkersInfoWindow(data, team_map);297 module.setMarkersInfoWindow(data, team_map);
298 });298 });
299 };299 };
300300
@@ -314,13 +314,13 @@
314 * @param {number} zoom the initial zoom-level.314 * @param {number} zoom the initial zoom-level.
315 * @param {Boolean} show_marker Show the marker for the person.315 * @param {Boolean} show_marker Show the marker for the person.
316 */316 */
317 mapping.renderPersonMap = function(center_lat, center_lng, displayname,317 module.renderPersonMap = function(center_lat, center_lng, displayname,
318 name, logo_html, geoname, lat_name,318 name, logo_html, geoname, lat_name,
319 lng_name, tz_name, zoom, show_marker) {319 lng_name, tz_name, zoom, show_marker) {
320 if (!gBrowserIsCompatible()) {320 if (!gBrowserIsCompatible()) {
321 return;321 return;
322 }322 }
323 var map = mapping.getLargeMap('map_div');323 var map = module.getLargeMap('map_div');
324 var center = new GLatLng(center_lat, center_lng);324 var center = new GLatLng(center_lat, center_lng);
325 map.setCenter(center, zoom);325 map.setCenter(center, zoom);
326 var marker = new GMarker(center, {draggable: true});326 var marker = new GMarker(center, {draggable: true});
@@ -333,7 +333,7 @@
333333
334 GEvent.addListener(marker, "dragend", function() {334 GEvent.addListener(marker, "dragend", function() {
335 var point = marker.getLatLng();335 var point = marker.getLatLng();
336 mapping.setLocation(336 module.setLocation(
337 point.lat(), point.lng(), geoname,337 point.lat(), point.lng(), geoname,
338 tz_name, lat_name, lng_name);338 tz_name, lat_name, lng_name);
339 });339 });
@@ -357,7 +357,7 @@
357 marker.show();357 marker.show();
358 map.panTo(point);358 map.panTo(point);
359 }359 }
360 mapping.setLocation(360 module.setLocation(
361 point.lat(), point.lng(), geoname,361 point.lat(), point.lng(), geoname,
362 tz_name, lat_name, lng_name);362 tz_name, lat_name, lng_name);
363 });363 });
364364
=== modified file 'lib/canonical/launchpad/javascript/lp/picker.js'
--- lib/canonical/launchpad/javascript/lp/picker.js 2010-01-29 10:52:58 +0000
+++ lib/canonical/launchpad/javascript/lp/picker.js 2010-02-12 16:34:16 +0000
@@ -2,7 +2,7 @@
22
3Y.log('loading lp.picker');3Y.log('loading lp.picker');
44
5Y.namespace('lp.picker');5var module = Y.namespace('lp.picker');
66
7var BATCH_SIZE = 6;7var BATCH_SIZE = 6;
8var MAX_BATCHES = 20;8var MAX_BATCHES = 20;
@@ -24,7 +24,7 @@
24 * config.step_title overrides the subtitle.24 * config.step_title overrides the subtitle.
25 * description strings.25 * description strings.
26 */26 */
27Y.lp.picker.addPickerPatcher = function (27module.addPickerPatcher = function (
28 vocabulary, resource_uri, attribute_name,28 vocabulary, resource_uri, attribute_name,
29 content_box_id, show_remove_button, show_assign_me_button, config) {29 content_box_id, show_remove_button, show_assign_me_button, config) {
3030
@@ -151,7 +151,7 @@
151 };151 };
152152
153 config.save = save;153 config.save = save;
154 var picker = Y.lp.picker.create(vocabulary, config);154 var picker = module.create(vocabulary, config);
155 picker._resource_uri = resource_uri;155 picker._resource_uri = resource_uri;
156 var extra_buttons = Y.Node.create(156 var extra_buttons = Y.Node.create(
157 '<div style="text-align: center; height: 3em; ' +157 '<div style="text-align: center; height: 3em; ' +
@@ -200,7 +200,7 @@
200 * config.save is a Function (optional) which takes200 * config.save is a Function (optional) which takes
201 * a single string argument.201 * a single string argument.
202 */202 */
203Y.lp.picker.create = function (vocabulary, config) {203module.create = function (vocabulary, config) {
204 if (Y.UA.ie) {204 if (Y.UA.ie) {
205 return;205 return;
206 }206 }
207207
=== modified file 'lib/canonical/launchpad/javascript/registry/milestoneoverlay.js'
--- lib/canonical/launchpad/javascript/registry/milestoneoverlay.js 2009-11-24 09:30:01 +0000
+++ lib/canonical/launchpad/javascript/registry/milestoneoverlay.js 2010-02-12 16:34:16 +0000
@@ -3,12 +3,12 @@
3 *3 *
4 * A milestone form overlay that can create a milestone within any page.4 * A milestone form overlay that can create a milestone within any page.
5 *5 *
6 * @module Y.lp.milestoneoverlay6 * @module Y.registry.milestoneoverlay
7 * @requires dom, node, io-base, lazr.anim, lazr.formoverlay7 * @requires dom, node, io-base, lazr.anim, lazr.formoverlay
8 */8 */
9YUI.add('lp.milestoneoverlay', function(Y) {9YUI.add('registry.milestoneoverlay', function(Y) {
10 Y.log('loading lp.milestoneoverlay');10 Y.log('loading registry.milestoneoverlay');
11 var milestoneoverlay = Y.namespace('lp.milestoneoverlay');11 var module = Y.namespace('registry.milestoneoverlay');
1212
13 var milestone_form;13 var milestone_form;
14 var milestone_form_uri;14 var milestone_form_uri;
@@ -96,7 +96,7 @@
96 * next_step is the function to be called after96 * next_step is the function to be called after
97 * the milestone is created.97 * the milestone is created.
98 */98 */
99 milestoneoverlay.attach_widget = function(config) {99 module.attach_widget = function(config) {
100 if (Y.UA.ie) {100 if (Y.UA.ie) {
101 return;101 return;
102 }102 }
103103
=== renamed file 'lib/canonical/launchpad/javascript/registry/milestone_table.js' => 'lib/canonical/launchpad/javascript/registry/milestonetable.js'
--- lib/canonical/launchpad/javascript/registry/milestone_table.js 2009-11-25 18:16:41 +0000
+++ lib/canonical/launchpad/javascript/registry/milestonetable.js 2010-02-12 16:34:16 +0000
@@ -1,13 +1,21 @@
1YUI.add('lp.milestonetable', function(Y) {1/* Copyright 2010 Canonical Ltd. This software is licensed under the
2 Y.log('loading lp.milestonetable');2 * GNU Affero General Public License version 3 (see the file LICENSE).
3 var self = Y.namespace('lp.milestonetable');3 *
4 * Dynamically add milestones to an HTML table.
5 *
6 * @module Y.registry.milestonetable
7 * @requires node, io-base, substitute, lazr.anim
8 */
9YUI.add('registry.milestonetable', function(Y) {
10 Y.log('loading registry.milestonetable');
11 var module = Y.namespace('registry.milestonetable');
412
5 // get_milestone_row() needs these when it is called. Other methods13 // get_milestone_row() needs these when it is called. Other methods
6 // should get this information passed as an argument.14 // should get this information passed as an argument.
7 self._milestone_row_uri_template = null;15 module._milestone_row_uri_template = null;
8 self._tbody = null;16 module._tbody = null;
917
10 self._prepend_node = function(parent_node, child_node) {18 module._prepend_node = function(parent_node, child_node) {
11 // Add the child_node to the parent_node as the first item.19 // Add the child_node to the parent_node as the first item.
12 var children = parent_node.get('children');20 var children = parent_node.get('children');
13 if (children === null) {21 if (children === null) {
@@ -17,13 +25,13 @@
17 }25 }
18 };26 };
1927
20 self._ensure_table_is_seen = function(tbody) {28 module._ensure_table_is_seen = function(tbody) {
21 // Remove the 'unseen' class from the table to ensure it is visible.29 // Remove the 'unseen' class from the table to ensure it is visible.
22 table = tbody.ancestor();30 table = tbody.ancestor();
23 table.removeClass('unseen');31 table.removeClass('unseen');
24 };32 };
2533
26 self._clear_add_handlers = function(data) {34 module._clear_add_handlers = function(data) {
27 // Detach the callback and errorback functions from the Y.io events.35 // Detach the callback and errorback functions from the Y.io events.
28 // The data has been used. If they are not detached, there will be36 // The data has been used. If they are not detached, there will be
29 // multiple adds for each use of the Create milestone link.37 // multiple adds for each use of the Create milestone link.
@@ -31,36 +39,36 @@
31 data.failure_handle.detach();39 data.failure_handle.detach();
32 };40 };
3341
34 self._on_add_success = function(id, response, data) {42 module._on_add_success = function(id, response, data) {
35 // Add the milestone to the milestone table on Y.io success.43 // Add the milestone to the milestone table on Y.io success.
36 var row = Y.Node.create(Y.Lang.trim(response.responseText));44 var row = Y.Node.create(Y.Lang.trim(response.responseText));
37 self._ensure_table_is_seen(data.tbody);45 module._ensure_table_is_seen(data.tbody);
38 self._prepend_node(data.tbody, row);46 module._prepend_node(data.tbody, row);
39 Y.lazr.anim.green_flash({node: row}).run();47 Y.lazr.anim.green_flash({node: row}).run();
40 self._clear_add_handlers(data);48 module._clear_add_handlers(data);
41 };49 };
4250
43 self._on_add_failure = function(id, response, data) {51 module._on_add_failure = function(id, response, data) {
44 // Add the failure message to the milestone table on Y.io failure.52 // Add the failure message to the milestone table on Y.io failure.
45 var row = Y.Node.create(Y.substitute(53 var row = Y.Node.create(Y.substitute(
46 '<tr><td colspan="0">' +54 '<tr><td colspan="0">' +
47 'Could not retrieve milestone {name}</td></tr>', data));55 'Could not retrieve milestone {name}</td></tr>', data));
48 self._ensure_table_is_seen(data.tbody);56 module._ensure_table_is_seen(data.tbody);
49 self._prepend_node(data.tbody, row);57 module._prepend_node(data.tbody, row);
50 Y.lazr.anim.red_flash({node: row}).run();58 Y.lazr.anim.red_flash({node: row}).run();
51 self._clear_add_handlers(data);59 module._clear_add_handlers(data);
52 };60 };
5361
54 self._setup_milestone_event_data = function(parameters, tbody) {62 module._setup_milestone_event_data = function(parameters, tbody) {
55 // Attach the callback to the Y.io event and return their data63 // Attach the callback to the Y.io event and return their data
56 var data = {64 var data = {
57 name: parameters.name,65 name: parameters.name,
58 tbody: tbody66 tbody: tbody
59 };67 };
60 data.success_handle = Y.on(68 data.success_handle = Y.on(
61 'io:success', self._on_add_success, this, data);69 'io:success', module._on_add_success, this, data);
62 data.failure_handle = Y.on(70 data.failure_handle = Y.on(
63 'io:failure', self._on_add_failure, this, data);71 'io:failure', module._on_add_failure, this, data);
64 return data;72 return data;
65 };73 };
6674
@@ -73,24 +81,24 @@
73 * @param {Object} parameters Object literal of config name/value pairs.81 * @param {Object} parameters Object literal of config name/value pairs.
74 * The form parameters that were submitted to create the milestone.82 * The form parameters that were submitted to create the milestone.
75 */83 */
76 self.get_milestone_row = function(parameters) {84 module.get_milestone_row = function(parameters) {
77 self._setup_milestone_event_data(parameters, self._tbody);85 module._setup_milestone_event_data(parameters, module._tbody);
78 var milestone_row_uri = Y.substitute(86 var milestone_row_uri = Y.substitute(
79 self._milestone_row_uri_template, parameters);87 module._milestone_row_uri_template, parameters);
80 Y.io(milestone_row_uri);88 Y.io(milestone_row_uri);
81 };89 };
8290
83 /**91 /**
84 * Setup the URL to get the milestone and the table it will be added too.92 * Setup the URL to get the milestone and the table it will be added too.
85 *93 *
86 * @method get_milestone_row94 * @method setup
87 * @param {Object} parameters Object literal of config name/value pairs.95 * @param {Object} parameters Object literal of config name/value pairs.
88 * config.milestone_row_uri_template is the Y.substitute template96 * config.milestone_row_uri_template is the Y.substitute template
89 * that is used to create the URL to get the milestone row.97 * that is used to create the URL to get the milestone row.
90 * config.milestone_rows_id is the id the the tbody that the98 * config.milestone_rows_id is the id the the tbody that the
91 * milestone row will be added too.99 * milestone row will be added too.
92 */100 */
93 self.setup = function(config) {101 module.setup = function(config) {
94 if (config === undefined) {102 if (config === undefined) {
95 throw new Error(103 throw new Error(
96 "Missing setup config for milestonetable.");104 "Missing setup config for milestonetable.");
@@ -100,9 +108,9 @@
100 throw new Error(108 throw new Error(
101 "Undefined properties in setup config for milestonetable.");109 "Undefined properties in setup config for milestonetable.");
102 }110 }
103 self._milestone_row_uri_template = config.milestone_row_uri_template;111 module._milestone_row_uri_template = config.milestone_row_uri_template;
104 self._tbody = Y.one(config.milestone_rows_id);112 module._tbody = Y.one(config.milestone_rows_id);
105 if (self._tbody === null) {113 if (module._tbody === null) {
106 throw new Error(114 throw new Error(
107 Y.substitute("'{milestone_rows_id}' not in page.", config));115 Y.substitute("'{milestone_rows_id}' not in page.", config));
108 }116 }
109117
=== modified file 'lib/canonical/launchpad/javascript/registry/tests/milestone_table.html'
--- lib/canonical/launchpad/javascript/registry/tests/milestone_table.html 2009-09-14 15:03:45 +0000
+++ lib/canonical/launchpad/javascript/registry/tests/milestone_table.html 2010-02-12 16:34:16 +0000
@@ -4,15 +4,15 @@
4 <title>Launchpad milestonetable</title>4 <title>Launchpad milestonetable</title>
55
6 <!-- YUI 3.0 Setup -->6 <!-- YUI 3.0 Setup -->
7 <script type="text/javascript" src="../../../icing/yui/current/build/yui/yui.js"></script>7 <script type="text/javascript" src="../../../icing/yui/yui/yui.js"></script>
8 <script type="text/javascript" src="../../../icing/lazr/build/lazr.js"></script>8 <script type="text/javascript" src="../../../icing/lazr/build/lazr.js"></script>
9 <link rel="stylesheet" href="../../../icing/yui/current/build/cssreset/reset.css"/>9 <link rel="stylesheet" href="../../../icing/yui/cssreset/reset.css"/>
10 <link rel="stylesheet" href="../../../icing/yui/current/build/cssfonts/fonts.css"/>10 <link rel="stylesheet" href="../../../icing/yui/cssfonts/fonts.css"/>
11 <link rel="stylesheet" href="../../../icing/yui/current/build/cssbase/base.css"/>11 <link rel="stylesheet" href="../../../icing/yui/cssbase/base.css"/>
12 <link rel="stylesheet" href="../../test.css" />12 <link rel="stylesheet" href="../../test.css" />
1313
14 <!-- The module under test -->14 <!-- The module under test -->
15 <script type="text/javascript" src="../milestone_table.js"></script>15 <script type="text/javascript" src="../milestonetable.js"></script>
1616
17 <!-- The test suite -->17 <!-- The test suite -->
18 <script type="text/javascript" src="test_milestone_table.js"></script>18 <script type="text/javascript" src="test_milestone_table.js"></script>
1919
=== modified file 'lib/canonical/launchpad/javascript/registry/tests/test_milestone_table.js'
--- lib/canonical/launchpad/javascript/registry/tests/test_milestone_table.js 2009-11-25 19:21:59 +0000
+++ lib/canonical/launchpad/javascript/registry/tests/test_milestone_table.js 2010-02-12 16:34:16 +0000
@@ -1,11 +1,11 @@
1/* Copyright (c) 2009, Canonical Ltd. All rights reserved. */1/* Copyright (c) 2009, Canonical Ltd. All rights reserved. */
22
3YUI({3YUI({
4 base: '../../../icing/yui/current/build/',4 base: '../../../icing/yui/',
5 filter: 'raw', combine: false5 filter: 'raw', combine: false
6 }).use('test', 'console', 'lp.milestonetable', function(Y) {6 }).use('test', 'console', 'registry.milestonetable', function(Y) {
77
8 var milestonetable = Y.lp.milestonetable;8 var milestonetable = Y.registry.milestonetable;
9 var suite = new Y.Test.Suite("milestonetable Tests");9 var suite = new Y.Test.Suite("milestonetable Tests");
1010
11 suite.add(new Y.Test.Case({11 suite.add(new Y.Test.Case({
1212
=== modified file 'lib/canonical/launchpad/javascript/registry/tests/timeline-iframe.html'
--- lib/canonical/launchpad/javascript/registry/tests/timeline-iframe.html 2009-10-08 22:52:35 +0000
+++ lib/canonical/launchpad/javascript/registry/tests/timeline-iframe.html 2010-02-12 16:34:16 +0000
@@ -4,10 +4,10 @@
4 <title>Launchpad TimelineGraph Widget</title>4 <title>Launchpad TimelineGraph Widget</title>
55
6 <!-- YUI 3.0 Setup -->6 <!-- YUI 3.0 Setup -->
7 <script type="text/javascript" src="../../../icing/yui/current/build/yui/yui.js"></script>7 <script type="text/javascript" src="../../../icing/yui/yui/yui.js"></script>
8 <link rel="stylesheet" href="../../../icing/yui/current/build/cssreset/reset.css"/>8 <link rel="stylesheet" href="../../../icing/yui/cssreset/reset.css"/>
9 <link rel="stylesheet" href="../../../icing/yui/current/build/cssfonts/fonts.css"/>9 <link rel="stylesheet" href="../../../icing/yui/cssfonts/fonts.css"/>
10 <link rel="stylesheet" href="../../../icing/yui/current/build/cssbase/base.css"/>10 <link rel="stylesheet" href="../../../icing/yui/cssbase/base.css"/>
1111
12 <!-- The module under test -->12 <!-- The module under test -->
13 <script type="text/javascript" src="../timeline.js"></script>13 <script type="text/javascript" src="../timeline.js"></script>
1414
=== modified file 'lib/canonical/launchpad/javascript/registry/tests/timeline.html'
--- lib/canonical/launchpad/javascript/registry/tests/timeline.html 2009-07-01 02:25:33 +0000
+++ lib/canonical/launchpad/javascript/registry/tests/timeline.html 2010-02-12 16:34:16 +0000
@@ -7,6 +7,7 @@
7 name="timeline-iframe"7 name="timeline-iframe"
8 src="timeline-iframe.html"8 src="timeline-iframe.html"
9 height="100%"9 height="100%"
10 width="100%" />10 width="100%">
11</iframe>
11</body>12</body>
12</html>13</html>
1314
=== modified file 'lib/canonical/launchpad/javascript/registry/tests/timeline.js'
--- lib/canonical/launchpad/javascript/registry/tests/timeline.js 2009-11-25 19:21:59 +0000
+++ lib/canonical/launchpad/javascript/registry/tests/timeline.js 2010-02-12 16:34:16 +0000
@@ -1,7 +1,7 @@
1/* Copyright (c) 2009, Canonical Ltd. All rights reserved. */1/* Copyright (c) 2009, Canonical Ltd. All rights reserved. */
22
3YUI({3YUI({
4 base: '../../../icing/yui/current/build/',4 base: '../../../icing/yui/',
5 filter: 'raw',5 filter: 'raw',
6 combine: false6 combine: false
7 }).use('test', 'console', 'registry.timeline', function(Y) {7 }).use('test', 'console', 'registry.timeline', function(Y) {
88
=== modified file 'lib/lp/app/templates/base-layout-macros.pt'
--- lib/lp/app/templates/base-layout-macros.pt 2010-02-08 18:21:24 +0000
+++ lib/lp/app/templates/base-layout-macros.pt 2010-02-12 16:34:16 +0000
@@ -176,6 +176,8 @@
176 <script type="text/javascript"176 <script type="text/javascript"
177 tal:attributes="src string:${lp_js}/registry/milestoneoverlay.js"></script>177 tal:attributes="src string:${lp_js}/registry/milestoneoverlay.js"></script>
178 <script type="text/javascript"178 <script type="text/javascript"
179 tal:attributes="src string:${lp_js}/registry/milestonetable.js"></script>
180 <script type="text/javascript"
179 tal:attributes="src string:${lp_js}/registry/timeline.js"></script>181 tal:attributes="src string:${lp_js}/registry/timeline.js"></script>
180 <script type="text/javascript"182 <script type="text/javascript"
181 tal:attributes="src string:${lp_js}/sorttable/sorttable.js"></script>183 tal:attributes="src string:${lp_js}/sorttable/sorttable.js"></script>
182184
=== modified file 'lib/lp/registry/browser/__init__.py'
--- lib/lp/registry/browser/__init__.py 2009-10-05 16:41:55 +0000
+++ lib/lp/registry/browser/__init__.py 2010-02-12 16:34:16 +0000
@@ -101,7 +101,7 @@
101 }101 }
102 return """102 return """
103 YUI().use(103 YUI().use(
104 'node', 'lp.milestoneoverlay', 'lp.milestonetable',104 'node', 'registry.milestoneoverlay', 'registry.milestonetable',
105 function (Y) {105 function (Y) {
106106
107 var series_uri = '%(series_api_uri)s';107 var series_uri = '%(series_api_uri)s';
@@ -116,15 +116,15 @@
116 var config = {116 var config = {
117 milestone_form_uri: milestone_form_uri,117 milestone_form_uri: milestone_form_uri,
118 series_uri: series_uri,118 series_uri: series_uri,
119 next_step: Y.lp.milestonetable.get_milestone_row,119 next_step: Y.registry.milestonetable.get_milestone_row,
120 activate_node: create_milestone_link120 activate_node: create_milestone_link
121 };121 };
122 Y.lp.milestoneoverlay.attach_widget(config);122 Y.registry.milestoneoverlay.attach_widget(config);
123 var table_config = {123 var table_config = {
124 milestone_row_uri_template: milestone_row_uri,124 milestone_row_uri_template: milestone_row_uri,
125 milestone_rows_id: milestone_rows_id125 milestone_rows_id: milestone_rows_id
126 }126 }
127 Y.lp.milestonetable.setup(table_config);127 Y.registry.milestonetable.setup(table_config);
128 });128 });
129 });129 });
130 """ % uris130 """ % uris
131131
=== modified file 'lib/lp/registry/browser/tests/productrelease-views.txt'
--- lib/lp/registry/browser/tests/productrelease-views.txt 2010-01-22 03:01:19 +0000
+++ lib/lp/registry/browser/tests/productrelease-views.txt 2010-02-12 16:34:16 +0000
@@ -124,7 +124,7 @@
124 >>> script = find_tag_by_id(view.render(), 'milestone-script')124 >>> script = find_tag_by_id(view.render(), 'milestone-script')
125 >>> print script125 >>> print script
126 <script id="milestone-script" type="text/javascript">126 <script id="milestone-script" type="text/javascript">
127 LPS.use(... 'lp.milestoneoverlay'...127 LPS.use(... 'registry.milestoneoverlay'...
128 var milestone_form_uri = '.../app/simple/+addmilestone/++form++';128 var milestone_form_uri = '.../app/simple/+addmilestone/++form++';
129 var series_uri = '/app/simple';129 var series_uri = '/app/simple';
130 ...130 ...
131131
=== modified file 'lib/lp/registry/browser/tests/productseries-views.txt'
--- lib/lp/registry/browser/tests/productseries-views.txt 2010-01-20 15:41:25 +0000
+++ lib/lp/registry/browser/tests/productseries-views.txt 2010-02-12 16:34:16 +0000
@@ -33,7 +33,7 @@
33 >>> script = find_tag_by_id(view.render(), 'milestone-script')33 >>> script = find_tag_by_id(view.render(), 'milestone-script')
34 >>> print script34 >>> print script
35 <script id="milestone-script" type="text/javascript">35 <script id="milestone-script" type="text/javascript">
36 YUI().use(... 'lp.milestoneoverlay', 'lp.milestonetable'...36 YUI().use(... 'registry.milestoneoverlay', 'registry.milestonetable'...
37 var series_uri = '/app/simple';37 var series_uri = '/app/simple';
38 var milestone_form_uri = '.../app/simple/+addmilestone/++form++';38 var milestone_form_uri = '.../app/simple/+addmilestone/++form++';
39 var milestone_row_uri =39 var milestone_row_uri =
@@ -43,8 +43,8 @@
43 var create_milestone_link = Y.get(43 var create_milestone_link = Y.get(
44 '.menu-link-create_milestone');44 '.menu-link-create_milestone');
45 create_milestone_link.addClass('js-action');...45 create_milestone_link.addClass('js-action');...
46 Y.lp.milestoneoverlay.attach_widget(config);...46 Y.registry.milestoneoverlay.attach_widget(config);...
47 Y.lp.milestonetable.setup(table_config);...47 Y.registry.milestonetable.setup(table_config);...
4848
49If the Create milestone link is not enabled, the script is not present.49If the Create milestone link is not enabled, the script is not present.
5050
5151
=== modified file 'lib/lp/registry/templates/distroseries-index.pt'
--- lib/lp/registry/templates/distroseries-index.pt 2009-12-04 00:15:41 +0000
+++ lib/lp/registry/templates/distroseries-index.pt 2010-02-12 16:34:16 +0000
@@ -9,9 +9,6 @@
9 <metal:block fill-slot="head_epilogue">9 <metal:block fill-slot="head_epilogue">
10 <metal:yui-dependencies10 <metal:yui-dependencies
11 use-macro="context/@@launchpad_widget_macros/yui2calendar-dependencies" />11 use-macro="context/@@launchpad_widget_macros/yui2calendar-dependencies" />
12 <script type="text/javascript"
13 tal:define="lp_js string:${icingroot}/build"
14 tal:attributes="src string:${lp_js}/registry/milestone_table.js"></script>
15 <script id="milestone-script" type="text/javascript"12 <script id="milestone-script" type="text/javascript"
16 tal:condition="context/menu:overview/create_milestone/enabled"13 tal:condition="context/menu:overview/create_milestone/enabled"
17 tal:content="view/register_milestone_script"></script>14 tal:content="view/register_milestone_script"></script>
1815
=== modified file 'lib/lp/registry/templates/object-timeline-graph.pt'
--- lib/lp/registry/templates/object-timeline-graph.pt 2009-12-19 18:50:39 +0000
+++ lib/lp/registry/templates/object-timeline-graph.pt 2010-02-12 16:34:16 +0000
@@ -34,7 +34,7 @@
34 include_inactive = false;34 include_inactive = false;
35 }35 }
3636
37 LPS.use('registry.timeline', 'node', function(Y) {37 LPS.use('registry.timeline', 'node', 'lp.dragscroll', function(Y) {
38 Y.on('domready', function(e) {38 Y.on('domready', function(e) {
39 if (Y.UA.ie) {39 if (Y.UA.ie) {
40 return;40 return;
@@ -88,7 +88,8 @@
88 }88 }
89 });89 });
9090
91 var drag_scroll_handler = new DragScrollEventHandler();91 var drag_scroll_handler =
92 new Y.lp.dragscroll.DragScrollEventHandler();
92 drag_scroll_handler.activate();93 drag_scroll_handler.activate();
93 });94 });
94 });95 });
9596
=== modified file 'lib/lp/registry/templates/productrelease-add-from-series.pt'
--- lib/lp/registry/templates/productrelease-add-from-series.pt 2009-12-03 18:33:22 +0000
+++ lib/lp/registry/templates/productrelease-add-from-series.pt 2010-02-12 16:34:16 +0000
@@ -14,7 +14,7 @@
14 <tal:script14 <tal:script
15 replace="structure15 replace="structure
16 string:&lt;script id='milestone-script' type='text/javascript'&gt;" />16 string:&lt;script id='milestone-script' type='text/javascript'&gt;" />
17 LPS.use('node', 'lp.milestoneoverlay', function (Y) {17 LPS.use('node', 'registry.milestoneoverlay', function (Y) {
1818
19 // This is a value for the SELECT OPTION which is passed with19 // This is a value for the SELECT OPTION which is passed with
20 // the SELECT's "change" event. It includes some symbols that are not20 // the SELECT's "change" event. It includes some symbols that are not
@@ -57,7 +57,7 @@
57 activate_node: create_milestone_link57 activate_node: create_milestone_link
58 };58 };
59 if (!Y.UA.ie) {59 if (!Y.UA.ie) {
60 Y.lp.milestoneoverlay.attach_widget(config);60 Y.registry.milestoneoverlay.attach_widget(config);
61 }61 }
62 });62 });
63 });63 });
6464
=== modified file 'lib/lp/registry/templates/productseries-index.pt'
--- lib/lp/registry/templates/productseries-index.pt 2009-11-25 18:04:43 +0000
+++ lib/lp/registry/templates/productseries-index.pt 2010-02-12 16:34:16 +0000
@@ -11,9 +11,6 @@
11 <metal:block fill-slot="head_epilogue">11 <metal:block fill-slot="head_epilogue">
12 <metal:yui-dependencies12 <metal:yui-dependencies
13 use-macro="context/@@launchpad_widget_macros/yui2calendar-dependencies" />13 use-macro="context/@@launchpad_widget_macros/yui2calendar-dependencies" />
14 <script type="text/javascript"
15 tal:define="lp_js string:${icingroot}/build"
16 tal:attributes="src string:${lp_js}/registry/milestone_table.js"></script>
17 <script id="milestone-script" type="text/javascript"14 <script id="milestone-script" type="text/javascript"
18 tal:condition="context/menu:overview/create_milestone/enabled"15 tal:condition="context/menu:overview/create_milestone/enabled"
19 tal:content="view/register_milestone_script"></script>16 tal:content="view/register_milestone_script"></script>