Merge lp:~stephen-stewart/ubuntu-webcatalog/unfubar-js into lp:ubuntu-webcatalog

Proposed by Stephen Stewart
Status: Merged
Approved by: Stephen Stewart
Approved revision: 189
Merged at revision: 189
Proposed branch: lp:~stephen-stewart/ubuntu-webcatalog/unfubar-js
Merge into: lp:ubuntu-webcatalog
Diff against target: 133 lines (+43/-39)
6 files modified
src/webcatalog/templates/webcatalog/application_detail.html (+5/-0)
src/webcatalog/templates/webcatalog/exhibits_widget.html (+0/-12)
src/webcatalog/templates/webcatalog/featured_apps_widget.html (+0/-12)
src/webcatalog/templates/webcatalog/index.html (+38/-0)
src/webcatalog/templates/webcatalog/screenshot_widget.html (+0/-3)
src/webcatalog/templates/webcatalog/top_rated_apps_widget.html (+0/-12)
To merge this branch: bzr merge lp:~stephen-stewart/ubuntu-webcatalog/unfubar-js
Reviewer Review Type Date Requested Status
Jonas G. Drange (community) Approve
Michael Nelson (community) Approve
Review via email: mp+183653@code.launchpad.net

Commit message

move js to end of document

Description of the change

move js to end of page, fixing errors with carousels being called before yui was loaded (caused by global nav change)

To post a comment you must log in.
Revision history for this message
Michael Nelson (michael.nelson) wrote :

+1 LGTM. I think Jonas is bootstrapping to run it too.

review: Approve
Revision history for this message
Jonas G. Drange (jonas-drange) wrote :

LGTM

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'src/webcatalog/templates/webcatalog/application_detail.html'
--- src/webcatalog/templates/webcatalog/application_detail.html 2013-06-20 15:48:43 +0000
+++ src/webcatalog/templates/webcatalog/application_detail.html 2013-09-03 12:55:42 +0000
@@ -45,6 +45,11 @@
45});45});
46</script>46</script>
47{% endblock %}47{% endblock %}
48{% block js-extra %}
49<script type="text/javascript" charset="utf-8">
50 setup_screenshots({{ application.screenshots|length }}, '{{ application.package_name }}', '{% url 'wc-combo' %}?', '{% url 'wc-package-screenshots' application.package_name %}');
51</script>
52{% endblock %}
48{% block body_extra %}class="yui3-skin-sam"{% endblock %}53{% block body_extra %}class="yui3-skin-sam"{% endblock %}
49{% block content %}54{% block content %}
50 {% if messages %}55 {% if messages %}
5156
=== modified file 'src/webcatalog/templates/webcatalog/exhibits_widget.html'
--- src/webcatalog/templates/webcatalog/exhibits_widget.html 2013-04-09 13:47:13 +0000
+++ src/webcatalog/templates/webcatalog/exhibits_widget.html 2013-09-03 12:55:42 +0000
@@ -19,15 +19,3 @@
19 </ol>19 </ol>
20 </div>20 </div>
21</div>21</div>
22<script type="text/javascript">
23YUI({combine: true, comboBase: '{% url 'wc-combo' %}?', root: 'yui/3.4.0/build/'}).use('uwc-carousel', function(Y) {
24 var caro = new Y.uwc.Carousel({
25 nodeContainer: "#exhibits-carousel",
26 controlsContainer: "#exhibits-carousel",
27 containerHeight: 200,
28 containerWidth: 912,
29 autoPlay: true
30 });
31 Y.all('.slide').removeClass('disabled');
32});
33</script>
3422
=== modified file 'src/webcatalog/templates/webcatalog/featured_apps_widget.html'
--- src/webcatalog/templates/webcatalog/featured_apps_widget.html 2013-04-09 13:47:13 +0000
+++ src/webcatalog/templates/webcatalog/featured_apps_widget.html 2013-09-03 12:55:42 +0000
@@ -5,15 +5,3 @@
5{% include "webcatalog/app_carousel_widget.html" %}5{% include "webcatalog/app_carousel_widget.html" %}
6{% endwith %}6{% endwith %}
7</div>7</div>
8<script type="text/javascript">
9YUI({combine: true, comboBase: '{% url 'wc-combo' %}?', root: 'yui/3.4.0/build/'}).use('uwc-carousel', function(Y) {
10 var caro = new Y.uwc.Carousel({
11 nodeContainer: "#featured-carousel .carousel",
12 controlsContainer: "#featured-carousel .carousel-controls",
13 containerHeight: 200,
14 containerWidth: 912,
15 autoPlay: false
16 });
17 Y.all('.slide').removeClass('disabled');
18});
19</script>
208
=== modified file 'src/webcatalog/templates/webcatalog/index.html'
--- src/webcatalog/templates/webcatalog/index.html 2013-06-20 15:48:43 +0000
+++ src/webcatalog/templates/webcatalog/index.html 2013-09-03 12:55:42 +0000
@@ -59,4 +59,42 @@
59 </div>59 </div>
60{% endif %}60{% endif %}
6161
62{% endblock content %}
63
64{% block js-extra %}
65<script>
66YUI().use('uwc-carousel', function(Y) {
67 var height = 200,
68 width = 912;
69
70{% if exhibits %}
71 new Y.uwc.Carousel({
72 nodeContainer: "#exhibits-carousel",
73 controlsContainer: "#exhibits-carousel",
74 containerHeight: height,
75 containerWidth: width,
76 autoPlay: true
77 });
78{% endif %}
79{% if featured_apps %}
80 new Y.uwc.Carousel({
81 nodeContainer: "#featured-carousel .carousel",
82 controlsContainer: "#featured-carousel .carousel-controls",
83 containerHeight: height,
84 containerWidth: width,
85 autoPlay: false
86 });
87{% endif %}
88{% if top_rated_apps %}
89 new Y.uwc.Carousel({
90 nodeContainer: "#top-rated-carousel .carousel",
91 controlsContainer: "#top-rated-carousel .carousel-controls",
92 containerHeight: height,
93 containerWidth: width,
94 autoPlay: false
95 });
96{% endif %}
97 Y.all('.slide').removeClass('disabled');
98});
99</script>
62{% endblock %}100{% endblock %}
63101
=== modified file 'src/webcatalog/templates/webcatalog/screenshot_widget.html'
--- src/webcatalog/templates/webcatalog/screenshot_widget.html 2013-02-22 20:50:08 +0000
+++ src/webcatalog/templates/webcatalog/screenshot_widget.html 2013-09-03 12:55:42 +0000
@@ -13,6 +13,3 @@
13 </div>13 </div>
14{% endif %}14{% endif %}
15</div>15</div>
16<script type="text/javascript" charset="utf-8">
17 setup_screenshots({{ application.screenshots|length }}, '{{ application.package_name }}', '{% url 'wc-combo' %}?', '{% url 'wc-package-screenshots' application.package_name %}');
18</script>
1916
=== modified file 'src/webcatalog/templates/webcatalog/top_rated_apps_widget.html'
--- src/webcatalog/templates/webcatalog/top_rated_apps_widget.html 2013-04-09 13:47:13 +0000
+++ src/webcatalog/templates/webcatalog/top_rated_apps_widget.html 2013-09-03 12:55:42 +0000
@@ -5,15 +5,3 @@
5{% include "webcatalog/app_carousel_widget.html" %}5{% include "webcatalog/app_carousel_widget.html" %}
6{% endwith %}6{% endwith %}
7</div>7</div>
8<script type="text/javascript">
9YUI({combine: true, comboBase: '{% url 'wc-combo' %}?', root: 'yui/3.4.0/build/'}).use('uwc-carousel', function(Y) {
10 var caro = new Y.uwc.Carousel({
11 nodeContainer: "#top-rated-carousel .carousel",
12 controlsContainer: "#top-rated-carousel .carousel-controls",
13 containerHeight: 200,
14 containerWidth: 912,
15 autoPlay: false
16 });
17 Y.all('.slide').removeClass('disabled');
18});
19</script>

Subscribers

People subscribed via source and target branches