Permalink
Browse files

Merge branch 'develop'

Conflicts:
	src/manifest.json
  • Loading branch information...
2 parents 90b182a + af73d31 commit 15a26df6edfa0c5916cd8c067abff39a1ca88928 @jason2506 committed Oct 12, 2012
Showing with 33 additions and 56 deletions.
  1. +1 −8 src/background.html
  2. +5 −2 src/manifest.json
  3. +0 −9 src/popup.html
  4. +6 −0 src/scripts/background.js
  5. +20 −4 src/scripts/popup.js
  6. +0 −32 src/scripts/underscore.js
  7. +1 −1 updates.xml
View
@@ -4,13 +4,6 @@
<audio id="player" src=""></audio>
<script src="scripts/jquery.js"></script>
<script src="scripts/player.js"></script>
- <script>
- chrome.extension.onRequest.addListener(function(request, sender, callback) {
- if (request.title != undefined)
- player.add(request.id, request.title);
- else if (player.contains(request.id))
- callback();
- });
- </script>
+ <script src="scripts/background.js"></script>
</body>
</html>
View
@@ -1,14 +1,17 @@
{
"name": "MusicTube",
- "version": "1.1.2",
+ "version": "1.1.3",
+ "manifest_version": 2,
"description": "Plays YouTube music in your web browser.",
"update_url": "https://raw.github.com/jason2506/MusicTube/master/updates.xml",
"icons": {
"128": "icons/icon_128.png",
"48": "icons/icon_48.png",
"16": "icons/icon_16.png"
},
- "background_page": "background.html",
+ "background": {
+ "page": "background.html"
+ },
"browser_action": {
"default_icon": "icons/icon_48.png",
"default_popup": "popup.html"
View
@@ -18,17 +18,8 @@
</div>
</div>
<ol id="playlist"></ol>
- <script id="playlist-tmpl" type="text/template">
- <% for (var index = 0; index < playlist.length; index++) { %>
- <li index="<%= index + 1 %>">
- <span class="title"><%= playlist[index].title %></span>
- <img src="icons/remove.png" class="remove" />
- </li>
- <% } %>
- </script>
<script src="scripts/jquery.js"></script>
<script src="scripts/jquery-ui-custom.js"></script>
- <script src="scripts/underscore.js"></script>
<script src="scripts/popup.js"></script>
</body>
</html>
@@ -0,0 +1,6 @@
+chrome.extension.onRequest.addListener(function(request, sender, callback) {
+ if (request.title != undefined)
+ player.add(request.id, request.title);
+ else if (player.contains(request.id))
+ callback();
+});
View
@@ -7,17 +7,19 @@
volume: $('#volume-range'),
time: $('#time'),
toggle: $('#toggle'),
- playlist: $('#playlist'),
- template: $('#playlist-tmpl')
+ playlist: $('#playlist')
};
displayPlaylist();
startListenEvent();
startUpdate();
function displayPlaylist () {
- var template = _.template(components.template.html());
- components.playlist.html(template({ playlist: player.playlist }));
+ var playlist = player.playlist;
+ for (var index = 0; index < playlist.length; index++) {
+ appendPlaylistItem(index + 1, playlist[index].title);
+ }
+
components.playlist.sortable({
stop: function(event, ui) {
var from = $(ui.item).attr('index') - 1;
@@ -35,6 +37,20 @@
});
}
+ function appendPlaylistItem(index, title) {
+ var item = $('<li>').attr('index', index);
+
+ var itemTitle = $('<span>').text(title)
+ .addClass('title');
+ item.append(itemTitle);
+
+ var removeButton = $('<img>').attr('src', 'icons/remove.png')
+ .addClass('remove');
+ item.append(removeButton);
+
+ components.playlist.append(item);
+ }
+
function removePlaylistItem(index) {
var items = components.playlist.children();
$(items[index]).remove();
View

Some generated files are not rendered by default. Learn more.

Oops, something went wrong.
View
@@ -1,6 +1,6 @@
<?xml version='1.0' encoding='utf-8'?>
<gupdate xmlns='http://www.google.com/update2/response' protocol='2.0'>
<app appid='dkpajgdindimkhbgiobapbhejcabcfdd'>
- <updatecheck codebase='https://github.com/downloads/jason2506/MusicTube/MusicTube.crx' version='1.1.2' />
+ <updatecheck codebase='https://github.com/downloads/jason2506/MusicTube/MusicTube.crx' version='1.1.3' />
</app>
</gupdate>

0 comments on commit 15a26df

Please sign in to comment.