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
1=== modified file 'src/webcatalog/templates/webcatalog/application_detail.html'
2--- src/webcatalog/templates/webcatalog/application_detail.html 2013-06-20 15:48:43 +0000
3+++ src/webcatalog/templates/webcatalog/application_detail.html 2013-09-03 12:55:42 +0000
4@@ -45,6 +45,11 @@
5 });
6 </script>
7 {% endblock %}
8+{% block js-extra %}
9+<script type="text/javascript" charset="utf-8">
10+ setup_screenshots({{ application.screenshots|length }}, '{{ application.package_name }}', '{% url 'wc-combo' %}?', '{% url 'wc-package-screenshots' application.package_name %}');
11+</script>
12+{% endblock %}
13 {% block body_extra %}class="yui3-skin-sam"{% endblock %}
14 {% block content %}
15 {% if messages %}
16
17=== modified file 'src/webcatalog/templates/webcatalog/exhibits_widget.html'
18--- src/webcatalog/templates/webcatalog/exhibits_widget.html 2013-04-09 13:47:13 +0000
19+++ src/webcatalog/templates/webcatalog/exhibits_widget.html 2013-09-03 12:55:42 +0000
20@@ -19,15 +19,3 @@
21 </ol>
22 </div>
23 </div>
24-<script type="text/javascript">
25-YUI({combine: true, comboBase: '{% url 'wc-combo' %}?', root: 'yui/3.4.0/build/'}).use('uwc-carousel', function(Y) {
26- var caro = new Y.uwc.Carousel({
27- nodeContainer: "#exhibits-carousel",
28- controlsContainer: "#exhibits-carousel",
29- containerHeight: 200,
30- containerWidth: 912,
31- autoPlay: true
32- });
33- Y.all('.slide').removeClass('disabled');
34-});
35-</script>
36
37=== modified file 'src/webcatalog/templates/webcatalog/featured_apps_widget.html'
38--- src/webcatalog/templates/webcatalog/featured_apps_widget.html 2013-04-09 13:47:13 +0000
39+++ src/webcatalog/templates/webcatalog/featured_apps_widget.html 2013-09-03 12:55:42 +0000
40@@ -5,15 +5,3 @@
41 {% include "webcatalog/app_carousel_widget.html" %}
42 {% endwith %}
43 </div>
44-<script type="text/javascript">
45-YUI({combine: true, comboBase: '{% url 'wc-combo' %}?', root: 'yui/3.4.0/build/'}).use('uwc-carousel', function(Y) {
46- var caro = new Y.uwc.Carousel({
47- nodeContainer: "#featured-carousel .carousel",
48- controlsContainer: "#featured-carousel .carousel-controls",
49- containerHeight: 200,
50- containerWidth: 912,
51- autoPlay: false
52- });
53- Y.all('.slide').removeClass('disabled');
54-});
55-</script>
56
57=== modified file 'src/webcatalog/templates/webcatalog/index.html'
58--- src/webcatalog/templates/webcatalog/index.html 2013-06-20 15:48:43 +0000
59+++ src/webcatalog/templates/webcatalog/index.html 2013-09-03 12:55:42 +0000
60@@ -59,4 +59,42 @@
61 </div>
62 {% endif %}
63
64+{% endblock content %}
65+
66+{% block js-extra %}
67+<script>
68+YUI().use('uwc-carousel', function(Y) {
69+ var height = 200,
70+ width = 912;
71+
72+{% if exhibits %}
73+ new Y.uwc.Carousel({
74+ nodeContainer: "#exhibits-carousel",
75+ controlsContainer: "#exhibits-carousel",
76+ containerHeight: height,
77+ containerWidth: width,
78+ autoPlay: true
79+ });
80+{% endif %}
81+{% if featured_apps %}
82+ new Y.uwc.Carousel({
83+ nodeContainer: "#featured-carousel .carousel",
84+ controlsContainer: "#featured-carousel .carousel-controls",
85+ containerHeight: height,
86+ containerWidth: width,
87+ autoPlay: false
88+ });
89+{% endif %}
90+{% if top_rated_apps %}
91+ new Y.uwc.Carousel({
92+ nodeContainer: "#top-rated-carousel .carousel",
93+ controlsContainer: "#top-rated-carousel .carousel-controls",
94+ containerHeight: height,
95+ containerWidth: width,
96+ autoPlay: false
97+ });
98+{% endif %}
99+ Y.all('.slide').removeClass('disabled');
100+});
101+</script>
102 {% endblock %}
103
104=== modified file 'src/webcatalog/templates/webcatalog/screenshot_widget.html'
105--- src/webcatalog/templates/webcatalog/screenshot_widget.html 2013-02-22 20:50:08 +0000
106+++ src/webcatalog/templates/webcatalog/screenshot_widget.html 2013-09-03 12:55:42 +0000
107@@ -13,6 +13,3 @@
108 </div>
109 {% endif %}
110 </div>
111-<script type="text/javascript" charset="utf-8">
112- setup_screenshots({{ application.screenshots|length }}, '{{ application.package_name }}', '{% url 'wc-combo' %}?', '{% url 'wc-package-screenshots' application.package_name %}');
113-</script>
114
115=== modified file 'src/webcatalog/templates/webcatalog/top_rated_apps_widget.html'
116--- src/webcatalog/templates/webcatalog/top_rated_apps_widget.html 2013-04-09 13:47:13 +0000
117+++ src/webcatalog/templates/webcatalog/top_rated_apps_widget.html 2013-09-03 12:55:42 +0000
118@@ -5,15 +5,3 @@
119 {% include "webcatalog/app_carousel_widget.html" %}
120 {% endwith %}
121 </div>
122-<script type="text/javascript">
123-YUI({combine: true, comboBase: '{% url 'wc-combo' %}?', root: 'yui/3.4.0/build/'}).use('uwc-carousel', function(Y) {
124- var caro = new Y.uwc.Carousel({
125- nodeContainer: "#top-rated-carousel .carousel",
126- controlsContainer: "#top-rated-carousel .carousel-controls",
127- containerHeight: 200,
128- containerWidth: 912,
129- autoPlay: false
130- });
131- Y.all('.slide').removeClass('disabled');
132-});
133-</script>

Subscribers

People subscribed via source and target branches