Merge lp:~robru/unity-webapps-deezer/packaging-fixups into lp:unity-webapps-deezer

Proposed by Robert Bruce Park
Status: Merged
Approved by: Robert Bruce Park
Approved revision: 5
Merged at revision: 5
Proposed branch: lp:~robru/unity-webapps-deezer/packaging-fixups
Merge into: lp:unity-webapps-deezer
Diff against target: 251 lines (+52/-60)
3 files modified
Deezer.user.js (+45/-52)
debian/control (+7/-3)
debian/copyright (+0/-5)
To merge this branch: bzr merge lp:~robru/unity-webapps-deezer/packaging-fixups
Reviewer Review Type Date Requested Status
PS Jenkins bot (community) continuous-integration Approve
WebApps Pending
Review via email: mp+169875@code.launchpad.net

Commit message

Minor packaging fixes.

To post a comment you must log in.
Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Needs Fixing (continuous-integration)
4. By Robert Bruce Park

Replace const with var.

Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Needs Fixing (continuous-integration)
5. By Robert Bruce Park

Appease jslint.

Revision history for this message
PS Jenkins bot (ps-jenkins) :
review: Approve (continuous-integration)

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'Deezer.user.js'
2--- Deezer.user.js 2013-05-16 19:02:04 +0000
3+++ Deezer.user.js 2013-06-18 00:14:26 +0000
4@@ -4,7 +4,7 @@
5 // ==/UserScript==
6
7 // This placeholder gets munged with real data at build time.
8-const WebappsGettextDict = JSON.parse(unescape(
9+var WebappsGettextDict = JSON.parse(unescape(
10 "%7B%22GETTEXT%22%3A%22PLACEHOLDER%22%7D"
11 ));
12
13@@ -12,25 +12,25 @@
14 window.Unity = Unity;
15 var trackInfo;
16
17-if ( typeof unsafeWindow === "undefined") {
18- unsafeWindow = evalInPageContext( function () {
19+if (typeof unsafeWindow === "undefined") {
20+ unsafeWindow = evalInPageContext(function () {
21 return window;
22 });
23 }
24 unsafeWindow.Unity = window.Unity;
25
26 function log(txt) {
27- if(typeof(console) !== 'undefined' && typeof(console.log) != 'undefined') {
28+ if (typeof (console) !== 'undefined' && typeof (console.log) !== 'undefined') {
29 console.log(txt);
30 }
31 }
32
33 function isCorrectPage() {
34 var i, ids = ['h_previous', 'h_next', 'h_play'];
35- if(!unsafeWindow.dzPlayer) {
36- log("deezer not valid. unsafeWindow");
37+ if (!unsafeWindow.dzPlayer) {
38+ log("deezer not valid. unsafeWindow");
39
40- return false;
41+ return false;
42 }
43 for (i = 0; i < ids.length; i++) {
44 if (!document.getElementById(ids[i])) {
45@@ -52,7 +52,7 @@
46 artist = unsafeWindow.dzPlayer.artistName;
47 title = unsafeWindow.dzPlayer.songTitle;
48 album = unsafeWindow.dzPlayer.albumTitle;
49- artLocation = unsafeWindow.SETTING_DOMAIN_IMG + '/cover/' + ((typeof (unsafeWindow.dzPlayer) == 'undefined') ? '' : unsafeWindow.dzPlayer.cover) + '/315x315-000000-80-0-0.jpg';
50+ artLocation = unsafeWindow.SETTING_DOMAIN_IMG + '/cover/' + ((typeof (unsafeWindow.dzPlayer) === 'undefined') ? '' : unsafeWindow.dzPlayer.cover) + '/315x315-000000-80-0-0.jpg';
51 } catch (x) {
52 log(x);
53 }
54@@ -67,16 +67,16 @@
55
56 }
57
58-function refreshInfos () {
59+function refreshInfos() {
60
61 //track info
62 var oldTrackInfo;
63- if(trackInfo) {
64+ if (trackInfo) {
65 oldTrackInfo = trackInfo;
66 }
67 trackInfo = getTrackInfo();
68- if(oldTrackInfo) {
69- if (oldTrackInfo.artist != trackInfo.artist || oldTrackInfo.title != trackInfo.title) {
70+ if (oldTrackInfo) {
71+ if (oldTrackInfo.artist !== trackInfo.artist || oldTrackInfo.title !== trackInfo.title) {
72 Unity.Notification.showNotification(trackInfo.title, trackInfo.artist, trackInfo.artLocation);
73 }
74 }
75@@ -97,8 +97,7 @@
76 Unity.Launcher.setCount(unsafeWindow.dzPlayer.getNbSongs() - unsafeWindow.dzPlayer.getNumSong());
77 if (unsafeWindow.dzPlayer.isPlaying()) {
78 Unity.Launcher.setProgress(unsafeWindow.dzPlayer.getPosition() / unsafeWindow.dzPlayer.getDuration());
79- }
80- else {
81+ } else {
82 Unity.Launcher.clearProgress();
83 }
84
85@@ -118,26 +117,27 @@
86 // }
87
88 function playAlbumCallback(id) {
89- return wrapCallback(function() {
90+ return wrapCallback(function () {
91 unsafeWindow.dzPlayer.playAlbum(id);
92 });
93 }
94
95 function playPlaylistCallback(id) {
96- return wrapCallback(function() {
97+ return wrapCallback(function () {
98 unsafeWindow.dzPlayer.playPlaylist(id);
99 });
100 }
101
102 function populateUserInfos() {
103-
104- log("populating user infos");
105-
106 //put favorite album in the HUD
107 var datas = unsafeWindow.userData.data.FAVORITES_ALBUMS.data;
108-
109- for (var i = datas.length - 1; i >= 0; i--) {
110- var current = datas[i];
111+ var current;
112+ var i;
113+
114+ log("populating user infos");
115+
116+ for (i = datas.length - 1; i >= 0; i--) {
117+ current = datas[i];
118 Unity.addAction("/Album/Play/" + current.ALB_TITLE + " - " + current.ART_NAME,
119 playAlbumCallback(current.ALB_ID));
120 log("added");
121@@ -147,39 +147,31 @@
122
123 //playlist favorite (not actual user playlist)
124 datas = unsafeWindow.userData.data.FAVORITES_PLAYLISTS.data;
125- for (var i = datas.length - 1; i >= 0; i--) {
126- var current = datas[i];
127+ for (i = datas.length - 1; i >= 0; i--) {
128+ current = datas[i];
129 Unity.addAction("/Playlist/Play/" + current.TITLE,
130 playPlaylistCallback(current.PLAYLIST_ID));
131 }
132-
133- //view
134 }
135
136 function selfTest() {
137-
138- if(!unsafeWindow.dzPlayer) {
139- reportTestState('FAILED: dzPlayer is null');
140- }
141- if(!unsafeWindow.userData) {
142- reportTestState('FAILED: userData is null');
143- }
144-
145- reportTestState('PASS SELF TEST');
146-
147+ if (!unsafeWindow.dzPlayer) {
148+ reportTestState('FAILED: dzPlayer is null');
149+ }
150+ if (!unsafeWindow.userData) {
151+ reportTestState('FAILED: userData is null');
152+ }
153+
154+ reportTestState('PASS SELF TEST');
155 }
156
157 function musicPlayerSetup() {
158-
159 log("start init deezer");
160
161-
162 Unity.MediaPlayer.init("Deezer");
163
164-
165 if (!isCorrectPage()) {
166-
167- return;
168+ return;
169 }
170
171 setInterval(wrapCallback(function retry() {
172@@ -191,13 +183,12 @@
173 }), 1000);
174
175
176- Unity.MediaPlayer.onPlayPause(wrapCallback(function() {
177+ Unity.MediaPlayer.onPlayPause(wrapCallback(function () {
178 if (!unsafeWindow.dzPlayer.isPlaying()) {
179- unsafeWindow.playercontrol.doAction('play');
180- //I don't like the little delay before the button updates.
181- Unity.MediaPlayer.setPlaybackState(Unity.MediaPlayer.PlaybackState.PLAYING);
182- }
183- else {
184+ unsafeWindow.playercontrol.doAction('play');
185+ //I don't like the little delay before the button updates.
186+ Unity.MediaPlayer.setPlaybackState(Unity.MediaPlayer.PlaybackState.PLAYING);
187+ } else {
188 unsafeWindow.playercontrol.doAction('pause');
189 Unity.MediaPlayer.setPlaybackState(Unity.MediaPlayer.PlaybackState.PAUSED);
190 }
191@@ -220,8 +211,10 @@
192
193 }
194
195-Unity.init({ name: "Deezer",
196- domain: 'deezer.com',
197- homepage: 'http://deezer.com',
198- iconUrl: "icon://unity-webapps-deezer",
199- onInit: musicPlayerSetup });
200+Unity.init({
201+ name: "Deezer",
202+ domain: 'deezer.com',
203+ homepage: 'http://deezer.com',
204+ iconUrl: "icon://unity-webapps-deezer",
205+ onInit: musicPlayerSetup
206+});
207
208=== modified file 'debian/control'
209--- debian/control 2013-05-16 19:02:04 +0000
210+++ debian/control 2013-06-18 00:14:26 +0000
211@@ -1,17 +1,21 @@
212 Source: unity-webapps-deezer
213 Section: web
214-Priority: extra
215+Priority: optional
216 Standards-Version: 3.9.4
217 Maintainer: Ubuntu Developers <ubuntu-devel-discuss@lists.ubuntu.com>
218 Build-Depends: debhelper (>=9),
219 unity-webapps-dev (>=2.4.16),
220 Homepage: https://deezer.com/
221+# If you aren't a member of ~webapps but need to upload packaging changes,
222+# just go ahead. ~webapps will notice and sync up the code again.
223+Vcs-Bzr: https://code.launchpad.net/~webapps/unity-webapps-deezer/trunk
224
225 Package: unity-webapps-deezer
226 Architecture: all
227 Section: web
228-Priority: extra
229-Depends: unity-webapps-common, xdg-utils, ${misc:Depends}
230+Depends: unity-webapps-common,
231+ xdg-utils,
232+ ${misc:Depends},
233 XB-Ubuntu-Webapps-Includes: https://*.deezer.com/*
234 XB-Ubuntu-Webapps-Name: Deezer
235 XB-Ubuntu-Webapps-Domain: deezer.com
236
237=== modified file 'debian/copyright'
238--- debian/copyright 2013-05-16 19:02:04 +0000
239+++ debian/copyright 2013-06-18 00:14:26 +0000
240@@ -22,11 +22,6 @@
241 The full text of the can be found in the file
242 '/usr/share/common-licenses/GPL-3'.
243
244-Files: debian/*
245-Copyright: 2012 The friendly pkgme.net robot
246-License: public-domain
247- This automatically generated code which is free from copyright restrictions.
248-
249
250 Files: */*.png */*.svg
251 Copyright: various

Subscribers

People subscribed via source and target branches

to all changes: