/pkg-bazaar/loggerhead/unstable

To get this branch, use:
bzr branch http://bzr.debian.org/pkg-bazaar/loggerhead/unstable
284 by Roland Mas
Start porting to YUI 3.5 so as to use the packaged one
1
Index: unstable/loggerhead/templates/macros.pt
2
===================================================================
3
--- unstable.orig/loggerhead/templates/macros.pt
4
+++ unstable/loggerhead/templates/macros.pt
285 by Roland Mas
Updated patch to port to YUI 3.5, with much help from Rick Harding
5
@@ -23,22 +23,6 @@
6
     <script type="text/javascript"
7
             tal:attributes="src python:branch.yui_url('yui/yui-min.js')"></script>
8
     <script type="text/javascript"
9
-            tal:attributes="src python:branch.yui_url('oop/oop-min.js')"></script>
10
-    <script type="text/javascript"
284 by Roland Mas
Start porting to YUI 3.5 so as to use the packaged one
11
-            tal:attributes="src python:branch.yui_url('event/event-min.js')"></script>
285 by Roland Mas
Updated patch to port to YUI 3.5, with much help from Rick Harding
12
-    <script type="text/javascript"
284 by Roland Mas
Start porting to YUI 3.5 so as to use the packaged one
13
-            tal:attributes="src python:branch.yui_url('attribute/attribute-min.js')"></script>
285 by Roland Mas
Updated patch to port to YUI 3.5, with much help from Rick Harding
14
-    <script type="text/javascript"
284 by Roland Mas
Start porting to YUI 3.5 so as to use the packaged one
15
-            tal:attributes="src python:branch.yui_url('base/base-min.js')"></script>
285 by Roland Mas
Updated patch to port to YUI 3.5, with much help from Rick Harding
16
-    <script type="text/javascript"
284 by Roland Mas
Start porting to YUI 3.5 so as to use the packaged one
17
-            tal:attributes="src python:branch.yui_url('dom/dom-min.js')"></script>
285 by Roland Mas
Updated patch to port to YUI 3.5, with much help from Rick Harding
18
-    <script type="text/javascript"
284 by Roland Mas
Start porting to YUI 3.5 so as to use the packaged one
19
-            tal:attributes="src python:branch.yui_url('node/node-min.js')"></script>
285 by Roland Mas
Updated patch to port to YUI 3.5, with much help from Rick Harding
20
-    <script type="text/javascript"
284 by Roland Mas
Start porting to YUI 3.5 so as to use the packaged one
21
-            tal:attributes="src python:branch.yui_url('anim/anim-min.js')"></script>
285 by Roland Mas
Updated patch to port to YUI 3.5, with much help from Rick Harding
22
-    <script type="text/javascript"
284 by Roland Mas
Start porting to YUI 3.5 so as to use the packaged one
23
-            tal:attributes="src python:branch.yui_url('io/io-base-min.js')"></script>
285 by Roland Mas
Updated patch to port to YUI 3.5, with much help from Rick Harding
24
-    <script type="text/javascript"
284 by Roland Mas
Start porting to YUI 3.5 so as to use the packaged one
25
             tal:attributes="src python:branch.static_url('/static/javascript/custom.js')"></script>
26
     <metal:block metal:define-slot="header_extras" />
285 by Roland Mas
Updated patch to port to YUI 3.5, with much help from Rick Harding
27
   </head>
284 by Roland Mas
Start porting to YUI 3.5 so as to use the packaged one
28
Index: unstable/loggerhead/static/javascript/custom.js
29
===================================================================
30
--- unstable.orig/loggerhead/static/javascript/custom.js
31
+++ unstable/loggerhead/static/javascript/custom.js
285 by Roland Mas
Updated patch to port to YUI 3.5, with much help from Rick Harding
32
@@ -1,13 +1,14 @@
284 by Roland Mas
Start porting to YUI 3.5 so as to use the packaged one
33
-Y = YUI().use("base", "node", "io-base", "anim");
34
-
35
 var global_timeout_id = null;
36
 var global_search_request = null;
37
 
285 by Roland Mas
Updated patch to port to YUI 3.5, with much help from Rick Harding
38
+LH = new YUI();
39
+LH.use("base", "event", "node", "io-base", "anim", function (Y) {
40
+
284 by Roland Mas
Start porting to YUI 3.5 so as to use the packaged one
41
 Y.on(
42
   'domready',
43
   function()
44
   {
45
-    var search_box = Y.get('#q');
46
+    var search_box = Y.one('#q');
47
     if (!Y.Lang.isNull(search_box))
48
     {
49
       function get_suggestions() {
285 by Roland Mas
Updated patch to port to YUI 3.5, with much help from Rick Harding
50
@@ -29,11 +30,11 @@
284 by Roland Mas
Start porting to YUI 3.5 so as to use the packaged one
51
         var region = search_box.get('region');
52
         var current_query = search_box.get('value');
53
 
54
-        Y.get('#search_terms').setStyle('display', 'block');
55
-        Y.get('#search_terms').setStyle('position', 'absolute');
56
-        Y.get('#search_terms').setStyle('left', region.left);
57
-        Y.get('#search_terms').setStyle('top', region.bottom);
58
-        Y.get('#search_terms').set('innerHTML','Loading...');
59
+        Y.one('#search_terms').setStyle('display', 'block');
60
+        Y.one('#search_terms').setStyle('position', 'absolute');
61
+        Y.one('#search_terms').setStyle('left', region.left);
62
+        Y.one('#search_terms').setStyle('top', region.bottom);
63
+        Y.one('#search_terms').set('innerHTML','Loading...');
64
       }
65
       search_box.on(
66
         "keyup",
285 by Roland Mas
Updated patch to port to YUI 3.5, with much help from Rick Harding
67
@@ -41,7 +42,7 @@
284 by Roland Mas
Start porting to YUI 3.5 so as to use the packaged one
68
         {
69
           if(search_box.get('value') == '')
70
           {
71
-            Y.get('#search_terms').setStyle('display', 'none');
72
+            Y.one('#search_terms').setStyle('display', 'none');
73
           }
74
           else
75
           {
285 by Roland Mas
Updated patch to port to YUI 3.5, with much help from Rick Harding
76
@@ -53,29 +54,30 @@
284 by Roland Mas
Start porting to YUI 3.5 so as to use the packaged one
77
           }
78
         });
79
     }
80
-  });
81
+  }
82
+);
83
 
84
 function cool_search(tid, response, query)
85
 {
86
-  var q = Y.get('#q');
87
+  var q = Y.one('#q');
88
   var region = q.get('region');
89
   var current_query = q.get('value');
90
   if (current_query == query)
91
   {
92
-    Y.get('#search_terms').set('innerHTML', response.responseText);
93
-    Y.get('#search_terms').setStyle('display', 'block');
94
-    Y.get('#search_terms').setStyle('position', 'absolute');
95
-    Y.get('#search_terms').setStyle('left', region.left);
96
-    Y.get('#search_terms').setStyle('top', region.bottom);
97
+    Y.one('#search_terms').set('innerHTML', response.responseText);
98
+    Y.one('#search_terms').setStyle('display', 'block');
99
+    Y.one('#search_terms').setStyle('position', 'absolute');
100
+    Y.one('#search_terms').setStyle('left', region.left);
101
+    Y.one('#search_terms').setStyle('top', region.bottom);
102
   }
103
 }
104
 
105
 function hide_search()
106
 {
107
-  setTimeout("Y.get('#search_terms').setStyle('display','none')", 300);
108
+  setTimeout("Y.one('#search_terms').setStyle('display','none')", 300);
285 by Roland Mas
Updated patch to port to YUI 3.5, with much help from Rick Harding
109
 }
110
 
111
-function Collapsable(config)
112
+LH.Collapsable = function(config)
113
 {
114
   this.is_open = config.is_open;
115
   this.open_node = config.open_node;
116
@@ -100,7 +102,7 @@
117
   return height;
118
 }
119
 
120
-Collapsable.prototype._animate = function (callback)
121
+LH.Collapsable.prototype._animate = function (callback)
284 by Roland Mas
Start porting to YUI 3.5 so as to use the packaged one
122
 {
123
   if (this.anim) this.anim.stop();
124
 
285 by Roland Mas
Updated patch to port to YUI 3.5, with much help from Rick Harding
125
@@ -120,7 +122,7 @@
284 by Roland Mas
Start porting to YUI 3.5 so as to use the packaged one
126
   this.anim.on('end', this.animComplete, this, callback);
127
 }
128
 
285 by Roland Mas
Updated patch to port to YUI 3.5, with much help from Rick Harding
129
-Collapsable.prototype._load_finished = function(tid, res, args)
130
+LH.Collapsable.prototype._load_finished = function(tid, res, args)
284 by Roland Mas
Start porting to YUI 3.5 so as to use the packaged one
131
 {
132
   var l = res.responseText.split('\n');
133
   l.splice(0, 1);
285 by Roland Mas
Updated patch to port to YUI 3.5, with much help from Rick Harding
134
@@ -137,7 +139,7 @@
284 by Roland Mas
Start porting to YUI 3.5 so as to use the packaged one
135
   this._animate(args[0]);
136
 };
137
 
285 by Roland Mas
Updated patch to port to YUI 3.5, with much help from Rick Harding
138
-Collapsable.prototype._ensure_container = function(callback)
139
+LH.Collapsable.prototype._ensure_container = function(callback)
284 by Roland Mas
Start porting to YUI 3.5 so as to use the packaged one
140
 {
141
   if (this.container == null) {
142
     this.container = Y.Node.create('<div></div>');
285 by Roland Mas
Updated patch to port to YUI 3.5, with much help from Rick Harding
143
@@ -184,7 +186,7 @@
144
  * 8. Start a new animation to show the rest of the new content.
145
  */
146
 
147
-Collapsable.prototype.open = function(callback)
148
+LH.Collapsable.prototype.open = function(callback)
149
 {
150
   this.expand_icon.set('src', expanded_icon_path);
151
 
152
@@ -221,7 +223,7 @@
153
 
154
 };
155
 
156
-Collapsable.prototype.animComplete = function(evt, callback)
157
+LH.Collapsable.prototype.animComplete = function(evt, callback)
158
 {
159
   this.anim = null;
160
   if (this._loading) return;
161
@@ -229,7 +231,7 @@
162
   this.is_open = true;
163
 };
164
 
165
-Collapsable.prototype.close = function()
166
+LH.Collapsable.prototype.close = function()
167
 {
168
   this._ensure_container();
169
 
170
@@ -258,7 +260,7 @@
171
   anim.run();
172
 };
173
 
174
-Collapsable.prototype.closeComplete = function () {
175
+LH.Collapsable.prototype.closeComplete = function () {
176
   this.open_node.setStyle('display', 'none');
177
   if (this.close_node) {
178
     this.close_node.setStyle('display', 'block');
179
@@ -268,7 +270,7 @@
180
   this.is_open = false;
181
 };
182
 
183
-Collapsable.prototype.toggle = function()
184
+LH.Collapsable.prototype.toggle = function()
185
 {
186
   if (this.is_open)
187
   {
188
@@ -305,7 +307,7 @@
284 by Roland Mas
Start porting to YUI 3.5 so as to use the packaged one
189
         }
190
     }
191
     var id_selector = "#" + target_id;
192
-    var main = Y.get(id_selector);
193
+    var main = Y.one(id_selector);
194
     notification_node = Y.Node.create('<div></div>')
195
         .addClass('global-notification');
196
     if (hidden) {
285 by Roland Mas
Updated patch to port to YUI 3.5, with much help from Rick Harding
197
@@ -324,13 +326,13 @@
284 by Roland Mas
Start porting to YUI 3.5 so as to use the packaged one
198
      this is because we have no way to use feature flags in
199
      css directly. This should be removed if the feature
200
      is accepted. */
201
-    var body = Y.get('body');
202
+    var body = Y.one('body');
203
     body.addClass('feature-flag-bugs-private-notification-enabled');
204
     // Set the visible flag so that the content moves down.
205
     body.addClass('global-notification-visible');
206
 
207
     setup_privacy_notification();
208
-    var global_notification = Y.get('.global-notification');
209
+    var global_notification = Y.one('.global-notification');
210
     if (global_notification.hasClass('hidden')) {
211
         global_notification.addClass('transparent');
212
         global_notification.removeClass('hidden');
285 by Roland Mas
Updated patch to port to YUI 3.5, with much help from Rick Harding
213
@@ -360,9 +362,10 @@
284 by Roland Mas
Start porting to YUI 3.5 so as to use the packaged one
214
 };
215
 
216
 Y.on('domready', function() {
217
-    var body = Y.get('body');
218
+    var body = Y.one('body');
219
     if (body.hasClass('private')) {
220
         setup_privacy_notification();
221
         display_privacy_notification();
222
     }
223
 });
224
+});
225
Index: unstable/loggerhead/static/javascript/diff.js
226
===================================================================
227
--- unstable.orig/loggerhead/static/javascript/diff.js
228
+++ unstable/loggerhead/static/javascript/diff.js
285 by Roland Mas
Updated patch to port to YUI 3.5, with much help from Rick Harding
229
@@ -1,5 +1,7 @@
230
 var unified = true;
284 by Roland Mas
Start porting to YUI 3.5 so as to use the packaged one
231
 
285 by Roland Mas
Updated patch to port to YUI 3.5, with much help from Rick Harding
232
+LH.use("event", function(Y) {
233
+
234
 function make_unified(chunk) {
235
   var pending_added = [];
236
   function flush_adds(before) {
237
@@ -91,12 +93,12 @@
284 by Roland Mas
Start porting to YUI 3.5 so as to use the packaged one
238
   if (unified) {
239
     pts && pts.each(make_sbs);
285 by Roland Mas
Updated patch to port to YUI 3.5, with much help from Rick Harding
240
     unified = false;
241
-    Y.get("#toggle_unified_sbs").set('innerHTML', "Show unified diffs");
242
+    Y.one("#toggle_unified_sbs").set('innerHTML', "Show unified diffs");
243
   }
244
   else {
245
     pts && pts.each(make_unified);
284 by Roland Mas
Start porting to YUI 3.5 so as to use the packaged one
246
     unified = true;
285 by Roland Mas
Updated patch to port to YUI 3.5, with much help from Rick Harding
247
-    Y.get("#toggle_unified_sbs").set('innerHTML', "Show diffs side-by-side");
248
+    Y.one("#toggle_unified_sbs").set('innerHTML', "Show diffs side-by-side");
284 by Roland Mas
Start porting to YUI 3.5 so as to use the packaged one
249
   }
250
 }
251
 
285 by Roland Mas
Updated patch to port to YUI 3.5, with much help from Rick Harding
252
@@ -112,14 +114,14 @@
253
       var collapsable = item.collapsable;
254
       if(action == 'close')
255
       {
256
-        Y.get('#expand_all').setStyle('display','block');
257
-        Y.get('#collapse_all').setStyle('display','none');
258
+        Y.one('#expand_all').setStyle('display','block');
259
+        Y.one('#collapse_all').setStyle('display','none');
260
         collapsable.close();
261
       }
262
       else if(action == 'open')
263
       {
264
-        Y.get('#expand_all').setStyle('display','none');
265
-        Y.get('#collapse_all').setStyle('display','block');
266
+        Y.one('#expand_all').setStyle('display','none');
267
+        Y.one('#collapse_all').setStyle('display','block');
284 by Roland Mas
Start porting to YUI 3.5 so as to use the packaged one
268
         collapsable.open();
269
       }
270
     });
285 by Roland Mas
Updated patch to port to YUI 3.5, with much help from Rick Harding
271
@@ -150,7 +152,7 @@
272
 }
273
 
274
 function zoom_to_diff (path) {
275
-  var collapsable = Y.get('#' + path_to_id[path]).collapsable;
276
+  var collapsable = Y.one('#' + path_to_id[path]).collapsable;
277
   if (!collapsable.is_open) {
278
     collapsable.open(
279
       function () {
280
@@ -180,21 +182,22 @@
284 by Roland Mas
Start porting to YUI 3.5 so as to use the packaged one
281
         var source_url = null;
282
         if (!specific_path)
285 by Roland Mas
Updated patch to port to YUI 3.5, with much help from Rick Harding
283
           source_url = global_path + '+filediff/' + link_data[item.get('id')];
284 by Roland Mas
Start porting to YUI 3.5 so as to use the packaged one
284
-        item.query('.the-link').on(
285
+        item.one('.the-link').on(
286
           'click',
287
           function(e) {
288
             e.preventDefault();
285 by Roland Mas
Updated patch to port to YUI 3.5, with much help from Rick Harding
289
             collapsable.toggle();
284 by Roland Mas
Start porting to YUI 3.5 so as to use the packaged one
290
           });
285 by Roland Mas
Updated patch to port to YUI 3.5, with much help from Rick Harding
291
-        var collapsable = new Collapsable(
292
+        var collapsable = new LH.Collapsable(
284 by Roland Mas
Start porting to YUI 3.5 so as to use the packaged one
293
           {
294
-            expand_icon: item.query('.expand_diff'),
295
-            open_node: item.query('.diffinfo'),
296
+            expand_icon: item.one('.expand_diff'),
297
+            open_node: item.one('.diffinfo'),
298
             close_node: null,
299
             source: source_url,
300
             is_open: specific_path != null,
301
-            loading: item.query('.loading'),
302
-            node_process: node_process
303
+            loading: item.one('.loading'),
304
+            node_process: node_process,
305
+	    Y: Y
306
           });
307
        item.collapsable=collapsable;
308
        });
285 by Roland Mas
Updated patch to port to YUI 3.5, with much help from Rick Harding
309
@@ -202,3 +205,4 @@
284 by Roland Mas
Start porting to YUI 3.5 so as to use the packaged one
310
       zoom_to_diff(window.location.hash.substring(1));
311
     }
312
   });
313
+});
314
Index: unstable/loggerhead/static/javascript/changelog.js
315
===================================================================
316
--- unstable.orig/loggerhead/static/javascript/changelog.js
317
+++ unstable/loggerhead/static/javascript/changelog.js
285 by Roland Mas
Updated patch to port to YUI 3.5, with much help from Rick Harding
318
@@ -1,3 +1,4 @@
319
+LH.use('node', 'event', function (Y) {
284 by Roland Mas
Start porting to YUI 3.5 so as to use the packaged one
320
 function toggle_expand_all(action)
321
 {
322
   var revlogs = Y.all('.revision_log');
285 by Roland Mas
Updated patch to port to YUI 3.5, with much help from Rick Harding
323
@@ -8,14 +9,14 @@
324
       var collapsable = item.collapsable;
325
       if(action == 'close')
326
       {
327
-        Y.get('#expand_all').setStyle('display','block');
328
-        Y.get('#collapse_all').setStyle('display','none');
329
+        Y.one('#expand_all').setStyle('display','block');
330
+        Y.one('#collapse_all').setStyle('display','none');
331
         collapsable.close();
332
       }
333
       else if(action == 'open')
334
       {
335
-        Y.get('#expand_all').setStyle('display','none');
336
-        Y.get('#collapse_all').setStyle('display','block');
337
+        Y.one('#expand_all').setStyle('display','none');
338
+        Y.one('#collapse_all').setStyle('display','block');
284 by Roland Mas
Start porting to YUI 3.5 so as to use the packaged one
339
         collapsable.open();
340
       }
341
     });
285 by Roland Mas
Updated patch to port to YUI 3.5, with much help from Rick Harding
342
@@ -54,17 +55,17 @@
343
       function(item, i)
344
       {
345
         var revid = revids[item.get('id').replace('log-', '')];
346
-        var collapsable = new Collapsable(
347
+        var collapsable = new LH.Collapsable(
348
           {
349
-            expand_icon: item.query('.expand_icon'),
350
-            open_node: item.query('.long_description'),
351
-            close_node: item.query('.short_description'),
352
+            expand_icon: item.one('.expand_icon'),
353
+            open_node: item.one('.long_description'),
354
+            close_node: item.one('.short_description'),
284 by Roland Mas
Start porting to YUI 3.5 so as to use the packaged one
355
             source: global_path + '+revlog/' + revid,
285 by Roland Mas
Updated patch to port to YUI 3.5, with much help from Rick Harding
356
-            loading: item.query('.loading'),
357
+            loading: item.one('.loading'),
358
             is_open: false
284 by Roland Mas
Start porting to YUI 3.5 so as to use the packaged one
359
           });
360
 
285 by Roland Mas
Updated patch to port to YUI 3.5, with much help from Rick Harding
361
-        item.query('.expand_revisioninfo a').on(
362
+        item.one('.expand_revisioninfo a').on(
363
           'click',
364
           function(e) {
365
             e.preventDefault();
366
@@ -74,3 +75,4 @@
284 by Roland Mas
Start porting to YUI 3.5 so as to use the packaged one
367
       });
368
 
369
   });
370
+});
371
Index: unstable/loggerhead/apps/branch.py
372
===================================================================
373
--- unstable.orig/loggerhead/apps/branch.py
374
+++ unstable/loggerhead/apps/branch.py
375
@@ -121,7 +121,7 @@
376
 
377
     def yui_url(self, path):
378
         if self.use_cdn:
379
-            base = 'http://yui.yahooapis.com/3.0.0pr2/build/'
380
+            base = 'http://yui.yahooapis.com/3.5.1/build/'
381
         else:
382
             base = self.static_url('/static/javascript/yui/build/')
383
         return base + path