← Back to team overview

launchpad-reviewers team mailing list archive

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

 

Richard Harding has proposed merging lp:~rharding/launchpad/fix_cal2 into lp:launchpad.

Requested reviews:
  Launchpad code reviewers (launchpad-reviewers)

For more details, see:
https://code.launchpad.net/~rharding/launchpad/fix_cal2/+merge/96584

= 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"
-- 
https://code.launchpad.net/~rharding/launchpad/fix_cal2/+merge/96584
Your team Launchpad code reviewers is requested to review the proposed merge of lp:~rharding/launchpad/fix_cal2 into lp:launchpad.
=== modified file 'lib/lp/app/javascript/calendar.js'
--- lib/lp/app/javascript/calendar.js	2011-04-19 18:03:50 +0000
+++ lib/lp/app/javascript/calendar.js	2012-03-08 14:51:26 +0000
@@ -245,5 +245,9 @@
     Y.on("domready", namespace.add_calendar_widgets);
 };
 
-}, "0.1", {"requires": ["node"]});
-
+}, "0.1", {
+    'requires': [
+        'node', 'yui2-yahoo', 'yui2-event', 'yui2-dom', 'yui2-calendar',
+        'yui2-dom-event'
+    ]
+});

=== modified file 'lib/lp/app/templates/base-layout-macros.pt'
--- lib/lp/app/templates/base-layout-macros.pt	2012-03-06 10:11:53 +0000
+++ lib/lp/app/templates/base-layout-macros.pt	2012-03-08 14:51:26 +0000
@@ -69,7 +69,11 @@
        YUI.GlobalConfig = {
            debug: ${yui_console_debug},
            fetchCSS: false,
-           timeout: 50
+           timeout: 50,
+           ignore: [
+               'yui2-yahoo', 'yui2-event', 'yui2-dom',
+               'yui2-calendar','yui2-dom-event'
+           ]
         }
        ">
     </script>

=== modified file 'lib/lp/app/templates/launchpad-widget-macros.pt'
--- lib/lp/app/templates/launchpad-widget-macros.pt	2012-02-01 15:31:32 +0000
+++ lib/lp/app/templates/launchpad-widget-macros.pt	2012-03-08 14:51:26 +0000
@@ -2,7 +2,7 @@
   xmlns:tal="http://xml.zope.org/namespaces/tal";
   xmlns:metal="http://xml.zope.org/namespaces/metal";
   xmlns:i18n="http://xml.zope.org/namespaces/i18n";
-  omit-tag=""> 
+  omit-tag="">
   <tal:comment condition="nothing">
     This is a customised version of lib/zope/form/browser/widget_macros.pt
     for Launchpad use.
@@ -93,35 +93,15 @@
 
       <script type="text/javascript">
           LPJS.use(
-              'lang', 'node', 'lp.app.calendar', 'yui2-yahoo',
-              'yui2-event', 'yui2-dom', 'yui2-calendar', 'yui2-dom-event',
-              function(Y) {
+              'lang', 'node', 'lp.app.calendar', function(Y) {
                   Y.lp.app.calendar.setup_calendar_widgets();
               }
           );
       </script>
 
-      <tal:js-legacy condition="not: features/js.combo_loader.enabled">
-        <tal:devmode condition="devmode">
-        <script type="text/javascript"
-                tal:attributes="src string:${yui2}/yahoo/yahoo.js"></script>
-        <script type="text/javascript"
-                tal:attributes="src string:${yui2}/event/event.js"></script>
-        <script type="text/javascript"
-                tal:attributes="src string:${yui2}/dom/dom.js"></script>
-        <script type="text/javascript"
-                tal:attributes="src string:${yui2}/calendar/calendar.js"></script>
-        </tal:devmode>
-        <tal:nondevmode condition="not: devmode">
-        <script type="text/javascript"
-                tal:attributes="src string:${yui2}/yahoo-dom-event/yahoo-dom-event.js"></script>
-        <script type="text/javascript"
-                tal:attributes="src string:${yui2}/calendar/calendar-min.js"></script>
-        </tal:nondevmode>
-      </tal:js-legacy>
-        <link rel="stylesheet" type="text/css"
-            tal:attributes="href
-            string:${yui2}/calendar/assets/skins/sam/calendar.css" />
+      <link rel="stylesheet" type="text/css"
+          tal:attributes="href
+          string:${yui2}/calendar/assets/skins/sam/calendar.css" />
     </tal:yui2resources>
 
 </metal:yui2calendar-dependencies>