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
Summary
-------
Fixed conflicts between YUI module names, namespaces, and filenames.
Implementation details ------- ------- -
-------
The DragScrollEvent Handler was declared as a global instead of canonical/ launchpad/ javascript/ lp/dragscroll. js
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/
The milestonetable.js file was being loaded by the productseries- index.pt ex.pt files directly instead of the base layout. This lp/app/ templates/ base-layout- macros. pt lp/registry/ templates/ distroseries- index.pt lp/registry/ templates/ productseries- index.pt
and distroseriesind
is bad since it prevents the js files from being combined.
lib/
lib/
lib/
Just renaming modules, namespaces, or files. The yui directory was current/ build to icing/yui a while ago, and canonical/ launchpad/ javascript/ lp/mapping. js canonical/ launchpad/ javascript/ lp/picker. js canonical/ launchpad/ javascript/ registry/ milestoneoverla y.js canonical/ launchpad/ javascript/ registry/ milestonetable. js canonical/ launchpad/ javascript/ registry/ tests/milestone _table. html canonical/ launchpad/ javascript/ registry/ tests/test_ milestone_ table.js canonical/ launchpad/ javascript/ registry/ tests/timeline- iframe. html canonical/ launchpad/ javascript/ registry/ tests/timeline. html canonical/ launchpad/ javascript/ registry/ tests/timeline. js lp/registry/ browser/ __init_ _.py lp/registry/ browser/ tests/productre lease-views. txt lp/registry/ browser/ tests/productse ries-views. txt lp/registry/ templates/ object- timeline- graph.pt lp/registry/ templates/ productrelease- add-from- series. pt
also moved from icing/yui/
these tests had not been run since then, so I fixed that also.
lib/
lib/
lib/
lib/
lib/
lib/
lib/
lib/
lib/
lib/
lib/
lib/
lib/
lib/
Tests
-----
./bin/test -vv --layer RegistryWindmil lLayer /./lib/ canonical/ launchpad/ javascript/ registry/ tests/milestone _table. html /./lib/ canonical/ launchpad/ javascript/ registry/ tests/timeline. html
file://
file://
Demo and Q/A
------------
* Open https:/ /launchpad. dev/firefox /launchpad. dev/firefox/ trunk /launchpad. dev/ubuntu/ warty /launchpad. dev/people/ +me/+editlocati on /bugs.launchpad .dev/bugs/ 3
* Ensure that timeline graph still shows up and that it can be
dragged if you zoom in until it doesn't fit.
* Open https:/
* 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:/
* Same test as for the firefox/trunk product series.
* Open https:/
* The map should appear and it should be possible to edit the
location.
* Open https:/
* The "Subscribe someone else" link should bring up a working picker.
Dragscroll diff without whitespace ------- ------- ------- ------
-------
=== modified file 'lib/canonical/ launchpad/ javascript/ lp/dragscroll. js' launchpad/ javascript/ lp/dragscroll. js 2009-10-08 17:13:13 +0000 launchpad/ javascript/ lp/dragscroll. js 2010-02-11 20:11:36 +0000 people. opera.com/ nicolasm/ userjs/ dragscroll Handler tHandler = function() { 'lp.dragscroll' , function(Y) { 'lp.dragscroll' ); DragScrollEvent Handler = function() { last_position = null; event_listeners = [];
--- lib/canonical/
+++ lib/canonical/
@@ -1,4 +1,10 @@
-/*
+/* Copyright 2009 Canonical Ltd. This software is licensed under the
+ * GNU Affero General Public License version 3 (see the file LICENSE).
+ *
+ * A milestone form overlay that can create a milestone within any page.
+ *
+ * @module Y.lp.dragscroll
+ *
* Based on dragscroll script by Nicolas Mendoza <email address hidden>.
* http://
*/
@@ -9,13 +15,16 @@
* @class DragScrollEvent
* @constructor
*/
-DragScrollEven
+YUI.add(
+ var module = Y.namespace(
+
+ module.
this.dragging = false;
this.
this.
-}
+ };
-DragScrollEven tHandler. prototype = { DragScrollEvent Handler. prototype = { tHandler` object.
this. event_listeners .push(event_ args); Scroll: function(e) {
this. dragging = true;
this. last_position = e;
this. _setGrabbingCur sor();
e. stopPropagation ();
+ module.
/**
* Add the event handlers and change the cursor to indicate
* that drag scrolling is active.
@@ -48,7 +57,7 @@
// `this` to be the `DragScrollEven
var self = this;
var event_listener = function(e) {
- action.call(self, e)
+ action.call(self, e);
};
var event_args = [event_type, event_listener, false];
@@ -90,7 +99,7 @@
* @method _startDragScroll
*/
_startDrag
- if (e.button == 0) {
+ if (e.button === 0) {
@@ -131,4 +140,5 @@
}
}
-};
+ };
+}, "0.1", {"requires": []});