Merge lp:~rharding/launchpad/fix_cal2 into lp:launchpad

Proposed by Richard Harding on 2012-03-08
Status: Merged
Approved by: Richard Harding on 2012-03-08
Approved revision: no longer in the source branch.
Merged at revision: 14979
Proposed branch: lp:~rharding/launchpad/fix_cal2
Merge into: lp:launchpad
Diff against target: 165 lines (+48/-31)
6 files modified
lib/lp/app/javascript/calendar.js (+6/-2)
lib/lp/app/templates/base-layout-macros.pt (+5/-1)
lib/lp/app/templates/launchpad-widget-macros.pt (+5/-26)
lib/lp/registry/javascript/tests/test_milestone_creation_failures.html (+22/-1)
lib/lp/soyuz/stories/ppa/xx-private-ppa-subscriptions.txt (+0/-1)
lib/lp/testing/yuixhr.py (+10/-0)
To merge this branch: bzr merge lp:~rharding/launchpad/fix_cal2
Reviewer Review Type Date Requested Status
j.c.sackett (community) 2012-03-08 Approve on 2012-03-08
Review via email: mp+96584@code.launchpad.net

Commit Message

[r=jcsackett][bug=949856] Update the way the yui2 calendar bits are included so as to work with the way it's included in launchpad.js.

Description of the Change

= Summary =
The YUI2 calendar is getting pulled from the Yahoo CDN because it's listed as
a YUI.use() section of the calendar bootstrap code.

== Proposed fix ==
- Move the dependencies over to the actual lp.app.calendar module where they
belong.

- Add the list of yui2 modules to the YUIConfig as ignored since they're auto
built into launchpad.js now

- Remove the old links to the calendar files since we don't need them,
calendar bits are in launchpad.js

== Demo and Q/A ==
Make sure that you do not get any external yahoo cdn calls when visiting:
https://launchpad.net/projects/+review-licenses

Make sure that the calendar widgets at the bottom of the page still function
when you click "Choose"

To post a comment you must log in.
j.c.sackett (jcsackett) wrote :

Looks good to me.

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'lib/lp/app/javascript/calendar.js'
2--- lib/lp/app/javascript/calendar.js 2011-04-19 18:03:50 +0000
3+++ lib/lp/app/javascript/calendar.js 2012-03-19 17:56:39 +0000
4@@ -245,5 +245,9 @@
5 Y.on("domready", namespace.add_calendar_widgets);
6 };
7
8-}, "0.1", {"requires": ["node"]});
9-
10+}, "0.1", {
11+ 'requires': [
12+ 'node', 'yui2-yahoo', 'yui2-event', 'yui2-dom', 'yui2-calendar',
13+ 'yui2-dom-event'
14+ ]
15+});
16
17=== modified file 'lib/lp/app/templates/base-layout-macros.pt'
18--- lib/lp/app/templates/base-layout-macros.pt 2012-03-06 10:11:53 +0000
19+++ lib/lp/app/templates/base-layout-macros.pt 2012-03-19 17:56:39 +0000
20@@ -69,7 +69,11 @@
21 YUI.GlobalConfig = {
22 debug: ${yui_console_debug},
23 fetchCSS: false,
24- timeout: 50
25+ timeout: 50,
26+ ignore: [
27+ 'yui2-yahoo', 'yui2-event', 'yui2-dom',
28+ 'yui2-calendar','yui2-dom-event'
29+ ]
30 }
31 ">
32 </script>
33
34=== modified file 'lib/lp/app/templates/launchpad-widget-macros.pt'
35--- lib/lp/app/templates/launchpad-widget-macros.pt 2012-02-01 15:31:32 +0000
36+++ lib/lp/app/templates/launchpad-widget-macros.pt 2012-03-19 17:56:39 +0000
37@@ -2,7 +2,7 @@
38 xmlns:tal="http://xml.zope.org/namespaces/tal"
39 xmlns:metal="http://xml.zope.org/namespaces/metal"
40 xmlns:i18n="http://xml.zope.org/namespaces/i18n"
41- omit-tag="">
42+ omit-tag="">
43 <tal:comment condition="nothing">
44 This is a customised version of lib/zope/form/browser/widget_macros.pt
45 for Launchpad use.
46@@ -92,36 +92,15 @@
47 tal:define="yui2 string:${icingroot}/yui_2.7.0b/build;">
48
49 <script type="text/javascript">
50- LPJS.use(
51- 'lang', 'node', 'lp.app.calendar', 'yui2-yahoo',
52- 'yui2-event', 'yui2-dom', 'yui2-calendar', 'yui2-dom-event',
53- function(Y) {
54+ LPJS.use('lang', 'node', 'lp.app.calendar', function(Y) {
55 Y.lp.app.calendar.setup_calendar_widgets();
56 }
57 );
58 </script>
59
60- <tal:js-legacy condition="not: features/js.combo_loader.enabled">
61- <tal:devmode condition="devmode">
62- <script type="text/javascript"
63- tal:attributes="src string:${yui2}/yahoo/yahoo.js"></script>
64- <script type="text/javascript"
65- tal:attributes="src string:${yui2}/event/event.js"></script>
66- <script type="text/javascript"
67- tal:attributes="src string:${yui2}/dom/dom.js"></script>
68- <script type="text/javascript"
69- tal:attributes="src string:${yui2}/calendar/calendar.js"></script>
70- </tal:devmode>
71- <tal:nondevmode condition="not: devmode">
72- <script type="text/javascript"
73- tal:attributes="src string:${yui2}/yahoo-dom-event/yahoo-dom-event.js"></script>
74- <script type="text/javascript"
75- tal:attributes="src string:${yui2}/calendar/calendar-min.js"></script>
76- </tal:nondevmode>
77- </tal:js-legacy>
78- <link rel="stylesheet" type="text/css"
79- tal:attributes="href
80- string:${yui2}/calendar/assets/skins/sam/calendar.css" />
81+ <link rel="stylesheet" type="text/css"
82+ tal:attributes="href
83+ string:${yui2}/calendar/assets/skins/sam/calendar.css" />
84 </tal:yui2resources>
85
86 </metal:yui2calendar-dependencies>
87
88=== modified file 'lib/lp/registry/javascript/tests/test_milestone_creation_failures.html'
89--- lib/lp/registry/javascript/tests/test_milestone_creation_failures.html 2012-02-13 15:43:25 +0000
90+++ lib/lp/registry/javascript/tests/test_milestone_creation_failures.html 2012-03-19 17:56:39 +0000
91@@ -13,6 +13,16 @@
92 <script type="text/javascript"
93 src="../../../../../build/js/yui/yui/yui.js">
94 </script>
95+ <script type="text/javascript">
96+ YUI.GlobalConfig = {
97+ fetchCSS: false,
98+ timeout: 50,
99+ ignore: [
100+ 'yui2-yahoo', 'yui2-event', 'yui2-dom',
101+ 'yui2-calendar','yui2-dom-event'
102+ ]
103+ }
104+ </script>
105 <link rel="stylesheet"
106 href="../../../../../build/js/yui/console/assets/console-core.css" />
107 <link rel="stylesheet"
108@@ -21,12 +31,23 @@
109 href="../../../../../build/js/yui/test/assets/skins/sam/test.css" />
110
111 <script type="text/javascript"
112- src="../../../../../build/js/lp/app/testing/testrunner.js"></script>
113+ src="../../../../../build/js/lp/app/testing/testrunner.js"></script>
114
115 <link rel="stylesheet" href="../../../app/javascript/testing/test.css" />
116
117 <!-- Dependencies -->
118 <script type="text/javascript"
119+ src="../../../../../build/js/yui2/yahoo/yahoo.js"></script>
120+ <script type="text/javascript"
121+ src="../../../../../build/js/yui2/event/event.js"></script>
122+ <script type="text/javascript"
123+ src="../../../../../build/js/yui2/calendar/calendar.js"></script>
124+ <script type="text/javascript"
125+ src="../../../../../build/js/yui2/yahoo-dom-event/yahoo-dom-event.js"></script>
126+ <script type="text/javascript"
127+ src="../../../../../build/js/yui2/dom/dom.js"></script>
128+
129+ <script type="text/javascript"
130 src="../../../../../build/js/lp/app/calendar.js"></script>
131 <script type="text/javascript"
132 src="../../../../../build/js/lp/app/client.js"></script>
133
134=== modified file 'lib/lp/soyuz/stories/ppa/xx-private-ppa-subscriptions.txt'
135--- lib/lp/soyuz/stories/ppa/xx-private-ppa-subscriptions.txt 2012-01-25 04:56:50 +0000
136+++ lib/lp/soyuz/stories/ppa/xx-private-ppa-subscriptions.txt 2012-03-19 17:56:39 +0000
137@@ -54,7 +54,6 @@
138 >>> print extract_all_script_and_style_links(cprov_browser.contents)
139 /...
140 ...
141- http://launchpad.dev/+icing/.../build/calendar/calendar.js
142 http://launchpad.dev/+icing/.../yui_2.7.0b/build/calendar/assets/skins/sam/calendar.css
143
144 Initially there are no subscriptions for a newly privatized PPA (although,
145
146=== modified file 'lib/lp/testing/yuixhr.py'
147--- lib/lp/testing/yuixhr.py 2012-01-15 12:22:55 +0000
148+++ lib/lp/testing/yuixhr.py 2012-03-19 17:56:39 +0000
149@@ -171,6 +171,16 @@
150 <title>Test</title>
151 <script type="text/javascript"
152 src="/+icing/rev%(revno)s/build/launchpad.js"></script>
153+ <script type="text/javascript">
154+ YUI.GlobalConfig = {
155+ fetchCSS: false,
156+ timeout: 50,
157+ ignore: [
158+ 'yui2-yahoo', 'yui2-event', 'yui2-dom',
159+ 'yui2-calendar','yui2-dom-event'
160+ ]
161+ }
162+ </script>
163 <link rel="stylesheet"
164 href="/+icing/yui/assets/skins/sam/skin.css"/>
165 <link rel="stylesheet" href="/+icing/rev%(revno)s/combo.css"/>