Merge branch 'master' into develop

This commit is contained in:
woutervanwijk 2014-09-23 13:09:11 +02:00
commit e21be89403
11 changed files with 83 additions and 31 deletions

4
.gitignore vendored
View File

@ -15,7 +15,5 @@ mopidy.log*
node_modules/
nosetests.xml
.project
*.pbxproj
Mopidy Webclient/Mopidy Webclient.xcodeproj/project.pbxproj
*.egg-info

View File

@ -2,6 +2,7 @@ Webclient
- Wouter van Wijk
- Flat Interface: Ulrich Lichtenegger
- Kingosticks
- Szymon Nowak
Mopidy:
https://github.com/mopidy/mopidy/blob/develop/AUTHORS

View File

@ -4,5 +4,4 @@ include MANIFEST.in
include README.rst
include mopidy_musicbox_webclient/ext.conf
recursive-include screenshots *
recursive-include mopidy_musicbox_webclient/static *

View File

@ -54,7 +54,19 @@ Project resources
Changelog
=========
v1.0.0
v1.0.2 Dev
-------------------
- Search: select service to search in
- Youtube icons
- Fixed single quote bug #39
v1.0.1 (20-9-2014)
-------------------
- Small fixes for Pypi distro
v1.0.0 (20-9-2014)
-------------------
- Compatible with Mopidy v0.19

View File

@ -5,7 +5,7 @@ import os
from mopidy import config, ext
__version__ = '1.0.0'
__version__ = '1.0.2'
class MusicBoxExtension(ext.Extension):

View File

@ -283,6 +283,9 @@
<div data-role="content" class="pane" id="searchpane">
<div class="">
<form>
<select id="selectSearchService" data-native-menu="false"> <!-- multiple="multiple" data-native-menu="false">
<option data-placeholder="true">Choose services</option> -->
</select>
<input id="searchinput" class="span2" data-clear-btn="true"
onkeypress="return searchPressed(event.keyCode);" id="appendedInputButton" type="text"/>
<button class="btn" type="button" onclick="return initSearch(event.value);">

View File

@ -312,9 +312,9 @@ function setRepeat(nwrepeat) {
return
}
if (!nwrepeat) {
$("#repeatbt").attr('src', 'images/icons/reload_alt_18x21.png');
$("#repeatbt").attr('style', 'color:#7cc4e7');
} else {
$("#repeatbt").attr('src', 'images/icons/reload_18x21.png');
$("#repeatbt").attr('style', 'color:#66FF33');
}
repeat = nwrepeat;
}
@ -324,9 +324,9 @@ function setRandom(nwrandom) {
return
}
if (!nwrandom) {
$("#randombt").attr('src', 'images/icons/loop_alt2_24x21.png');
$("#randombt").attr('style', 'color:#7cc4e7');
} else {
$("#randombt").attr('src', 'images/icons/loop_24x24.png');
$("#randombt").attr('style', 'color:#66FF33');
}
random = nwrandom;
}
@ -612,13 +612,13 @@ function saveRadioStations() {
}
function haltSystem() {
$.post("/haltSystem");
$.post("/settings/shutdown");
toast('Stopping system...', 10000);
setTimeout(function(){window.history.back();}, 10000);
}
function rebootSystem() {
$.post("/rebootSystem");
$.post("/settings/reboot");
toast('Rebooting...', 10000);
setTimeout(function(){window.history.back();}, 10000);
}

View File

@ -77,11 +77,14 @@ TRACK_TIMER = 1000;
//check status timer, every 5 or 10 sec
STATUS_TIMER = 10000;
//var uriHumanList = [ ['spotify', 'Spotify'], ['local', 'Local Files'], ['podcast', 'Podcasts'], ['dirble', 'Dirble'],
// ['tunein', 'TuneIn'], ['soundcloud', 'SoundCloud'], ['sc', 'SoundCloud'], ['gmusic', 'Google Music'], ['internetarchive', 'Internet Archive'], ['somafm', 'Soma FM'], ['yt', 'YouTube'], ['youtube', 'YouTube'], ['subsonic', 'Subsonic'] ];
var uriClassList = [ ['spotify', 'fa-spotify'], ['local', 'fa-file-sound-o'], ['podcast', 'fa-rss-square'], ['dirble', 'fa-microphone'],
['tunein', 'fa-headphones'], ['soundcloud', 'fa-soundcloud'], ['gmusic', 'fa-google'], ['internetarchive', 'fa-university'], ['somafm', 'fa-flask'], ['subsonic', 'fa-folder-open'] ];
['tunein', 'fa-headphones'], ['soundcloud', 'fa-soundcloud'], ['sc', 'fa-soundcloud'], ['gmusic', 'fa-google'], ['internetarchive', 'fa-university'], ['somafm', 'fa-flask'], ['youtube', 'fa-youtube'], ['yt', 'fa-youtube'], ['subsonic', 'fa-folder-open'] ];
var uriHumanList = [ ['spotify', 'Spotify'], ['local', 'Local Files'], ['podcast', 'Podcasts'], ['dirble', 'Dirble'],
['tunein', 'TuneIn'], ['soundcloud', 'SoundCloud'], ['gmusic', 'Google Music'], ['internetarchive', 'Internet Archive'], ['somafm', 'Soma FM'], ['subsonic', 'Subsonic'] ];
['tunein', 'TuneIn'], ['soundcloud', 'SoundCloud'], ['gmusic', 'Google Music'], ['internetarchive', 'Internet Archive'], ['somafm', 'Soma FM'], ['youtube', 'YouTube'], ['subsonic', 'Subsonic'] ];
function scrollToTop() {
var divtop = 0;
@ -166,7 +169,6 @@ function renderSongLi(song, liID, uri, playlistType){
}
function resultsToTables(results, target, uri) {
//console.log(results, target, uri);
if (!results) { return }
if (target == '#currenttable') {
playlistType = 'playTrackQueueByUri';
@ -279,7 +281,6 @@ function resultsToTables(results, target, uri) {
} //albums name
}
}
// console.log(html);
tableid = "#" + tableid;
$(target).html(html);
$(target).attr('data', uri);
@ -414,7 +415,6 @@ $.event.special.swipe = $.extend($.event.special.swipe, {
origin: $( event.target ),
offset: $('body').scrollTop()
};
// console.log('start');
},
stop: function( event ) {

View File

@ -120,8 +120,8 @@ function setSongInfo(data) {
getCover(artiststext, data.album.name, '#infocover, #controlspopupimage', 'extralarge');
} else {
$("#modalalbum").html('');
$("#infocover").attr('src', '../images/default_cover.png');
$("#controlspopupimage").attr('src', '../images/default_cover.png');
$("#infocover").attr('src', 'images/default_cover.png');
$("#controlspopupimage").attr('src', 'images/default_cover.png');
}
$("#modalartist").html(arttmp);

View File

@ -15,10 +15,11 @@ function searchPressed(key) {
//init search
function initSearch() {
var value = $('#searchinput').val();
var searchService = $('#selectSearchService').val();
if ((value.length < 100) && (value.length > 0)) {
showLoading(true);
//hide ios/android keyboard
//hide ios/android keyboard
document.activeElement.blur();
$("input").blur();
@ -27,10 +28,29 @@ function initSearch() {
delete customTracklists['albumresultscache'];
delete customTracklists['trackresultscache'];
$("#searchresults").hide();
mopidy.library.search({
any: [value]
}).then(processSearchResults, console.error);
// console.log('search sent', value);
if (searchService != 'all') {
mopidy.library.search({any:[value]}, [searchService + ':']).then(processSearchResults, console.error);
} else {
mopidy.getUriSchemes().then(function (schemes) {
var query = {},
uris = [];
var regexp = $.map(schemes, function (scheme) {
return '^' + scheme + ':';
}).join('|');
var match = value.match(regexp);
if (match) {
var scheme = match[0];
query = {uri: [value]};
uris = [scheme];
} else {
query = {any: [value]};
}
mopidy.library.search(query, uris).then(processSearchResults, console.error);
});
}
}
}
@ -38,7 +58,6 @@ function initSearch() {
* process results of a search
*********************************************************/
function processSearchResults(resultArr) {
// console.log('srch', resultArr);
$(SEARCH_TRACK_TABLE).empty();
$(SEARCH_ARTIST_TABLE).empty();
$(SEARCH_ALBUM_TABLE).empty();
@ -106,7 +125,7 @@ function processSearchResults(resultArr) {
child = '';
pattern = '<li><a href="#" onclick="return showAlbum(this.id)" id="{albumId}">';
pattern += '<h5 data-role="heading"><i class="{class}"></i> {albumName}</h5>';
pattern += '<p data-role="desc">{artistName} ({albumYear})</p>';
pattern += '<p data-role="desc">{artistName}</p>';
pattern += '</a></li>';
for (var i = 0; i < results.albums.length; i++) {
@ -117,13 +136,16 @@ function processSearchResults(resultArr) {
'albumYear': results.albums[i].date,
'class': getMediaClass(results.albums[i].uri)
};
//console.log(i, results.albums[i].artists.length);
if (results.albums[i].artists) {
for (var j = 0; j < results.albums[i].artists.length; j++) {
tokens.artistName += results.albums[i].artists[j].name + ' ';
if (results.albums[i].artists[j].name) {
tokens.artistName += results.albums[i].artists[j].name + ' ';
}
}
}
if (tokens.albumYear) {
tokens.artistName += '(' + tokens.albumYear + ')';
}
// Add 'Show all' item after a certain number of hits.
if (i == 4 && results.albums.length > 5) {
child += theme(showMorePattern, {'count': results.albums.length - i});
@ -133,7 +155,6 @@ function processSearchResults(resultArr) {
child += theme(pattern, tokens);
}
// Inject list items, refresh listview and hide superfluous items.
// console.log(child, results.albums.length);
$(SEARCH_ALBUM_TABLE).html(child).listview('refresh').find('.overflow').hide();
$('#expandsearch').show();
@ -259,3 +280,21 @@ function showAlbum(uri) {
setSongInfo();
return false;
}
function getSearchSchemes() {
mopidy.getUriSchemes().then(
function(schemesArray) {
var humanIndex;
$("#selectSearchService").children().remove().end();
$("#selectSearchService").append(new Option('All services', 'all'));
for (var i = 0; i < schemesArray.length; i++) {
for (var j = 0; j < uriHumanList.length; j++) {
if (uriHumanList[j][0] == schemesArray[i].toLowerCase() ) {
$("#selectSearchService").append(new Option(uriHumanList[j][1], schemesArray[i]));
}
}
}
$("#selectSearchService").selectmenu( "refresh", true );
}, console.error
);
}

View File

@ -29,7 +29,7 @@ setup(
],
entry_points={
'mopidy.ext': [
'musicbox = mopidy_musicbox_webclient:MusicBoxExtension',
'musicbox_webclient = mopidy_musicbox_webclient:MusicBoxExtension',
],
},
classifiers=[