diff --git a/images/address.png b/images/address.png new file mode 100644 index 0000000..05b7a52 Binary files /dev/null and b/images/address.png differ diff --git a/images/bitcoin.png b/images/bitcoin.png new file mode 100644 index 0000000..00aedd3 Binary files /dev/null and b/images/bitcoin.png differ diff --git a/js/background_scripts/background.js b/js/background_scripts/background.js index e9b4255..7b499cf 100644 --- a/js/background_scripts/background.js +++ b/js/background_scripts/background.js @@ -1,6 +1,16 @@ chrome.extension.onMessage.addListener( function (request, sender, sendResponse) { switch (request.action) { + case 'isAvailable': + getXbmcJsonVersion(function (version) { + if (version == null) { + sendResponse({response: "NOT_DETECTED"}); + } else { + sendResponse({response: "OK"}); + } + }); + break; + case 'playNow': playCurrentUrl(function () { sendResponse({response: "OK"}); diff --git a/js/background_scripts/context-menu.js b/js/background_scripts/context-menu.js index 35154c5..cd3b487 100644 --- a/js/background_scripts/context-menu.js +++ b/js/background_scripts/context-menu.js @@ -81,29 +81,48 @@ function removeContextMenus(tabId) { // chrome.contextMenus onclick handlers: var clickHandlers = { 'musicPlayNow': function(info, tab) { - doAction(actions.Stop, function () { - clearPlaylist(function () { - var url = info.linkUrl; - addItemsToPlaylist([{"contentType": 'audio', "pluginPath": url}], function(){}); - }) + getXbmcJsonVersion(function (version) { + if (version) { + doAction(actions.Stop, function () { + clearPlaylist(function () { + var url = info.linkUrl; + addItemsToPlaylist([ + {"contentType": 'audio', "pluginPath": url} + ], function () { + }); + }) + }) + } }); }, 'musicQueue': function(info, tab) { - var url = info.linkUrl; - if (url.match(googleRedirectRegex)) { - url = parseGoogleRedirectUrl(url); - } - addItemsToPlaylist([{"contentType": 'audio', "pluginPath": url}], function(){}); - }, - 'musicPlayNext': function(info, tab) { - getCurrentUrl(function (tabUrl) { - getPlaylistPosition(function (position) { + getXbmcJsonVersion(function (version) { + if (version) { var url = info.linkUrl; if (url.match(googleRedirectRegex)) { url = parseGoogleRedirectUrl(url); } - insertItemToPlaylist('audio', url, position+1, function() {}); - }); + addItemsToPlaylist([ + {"contentType": 'audio', "pluginPath": url} + ], function () { + }); + } + }); + }, + 'musicPlayNext': function(info, tab) { + getXbmcJsonVersion(function (version) { + if (version) { + getCurrentUrl(function (tabUrl) { + getPlaylistPosition(function (position) { + var url = info.linkUrl; + if (url.match(googleRedirectRegex)) { + url = parseGoogleRedirectUrl(url); + } + insertItemToPlaylist('audio', url, position + 1, function () { + }); + }); + }); + } }); } }; diff --git a/js/content_scripts/context-menu-content-scripts.js b/js/content_scripts/context-menu-content-scripts.js index 655d53b..5ee490b 100644 --- a/js/content_scripts/context-menu-content-scripts.js +++ b/js/content_scripts/context-menu-content-scripts.js @@ -60,19 +60,32 @@ function concatMusicExtensions() { return concatSelector; } -addContextMenuTo(concatMusicExtensions(), - [{ - title: "Play now", - contexts: ["link"], - onclick: 'musicPlayNow' - },{ - title: "Queue", - contexts: ["link"], - onclick: 'musicPlayNow' - },{ - title: "Play this Next", - contexts: ["link"], - onclick: 'musicPlayNow' - }] -); -//addContextM \ No newline at end of file +//function checkConnectivity(callback) { +// chrome.extension.sendMessage({action: 'isAvailable'}, function (response) { +// if (response.response == 'OK') { +// callback(true); +// } else { +// callback(false); +// } +// }); +//} +// +//checkConnectivity(function(isAvailable) { +// if (isAvailable) { +// addContextMenuTo(concatMusicExtensions(), +// [{ +// title: "Play now", +// contexts: ["link"], +// onclick: 'musicPlayNow' +// },{ +// title: "Queue", +// contexts: ["link"], +// onclick: 'musicPlayNow' +// },{ +// title: "Play this Next", +// contexts: ["link"], +// onclick: 'musicPlayNow' +// }] +// ); +// } +//}); \ No newline at end of file diff --git a/js/content_scripts/soundcloud-content-scripts.js b/js/content_scripts/soundcloud-content-scripts.js index f49b723..73e7f7d 100644 --- a/js/content_scripts/soundcloud-content-scripts.js +++ b/js/content_scripts/soundcloud-content-scripts.js @@ -53,27 +53,7 @@ function getSoundcloudSetTrackIds(setId, callback) { callback(trackIds); } -// $.each(result.tracks, function (i, item) { -// trackIds.push(item.id); -// }); }); - -// jQuery.ajax({ -// type: 'POST', -// url: apiUrl, -// success: function (result) { -// if (result && result.tracks) { -// var tracksJson = result.tracks; -// for (var i in tracksJson) { -// if (tracksJson.hasOwnProperty(i)) { -// trackIds.push(tracksJson[i].id); -// } -// } -// -// callback(trackIds); -// } -// } -// }); } var trackIds = []; \ No newline at end of file diff --git a/options.html b/options.html index 9cd69ac..52851d2 100644 --- a/options.html +++ b/options.html @@ -22,6 +22,7 @@
  • XBMC Host(s)
  • Others
  • Changelist
  • +
  • Donate
  • @@ -86,6 +87,15 @@
    +

    + Update 1.5.0.0: +

      +
    • Added context menus to show images on XBMC (Beta). This feature on XBMC is a little unstable and images like Gif is not supported.
    • +
    • Added context menus to play and queue direct links to music files. Supported extensions are: 'mp3', 'ogg', 'midi', 'wav', 'aiff', 'aac', 'flac', 'ape' and 'wma'.
    • +
    • Added support for MyCloudPlayers.com (Many thanks to cuckoo for the code work).
    • +
    • Added a donation page to the option tabs. If you like my work, consider buying me a coffee so I could spend more hours awake working on Play to XBMC.
    • +
    +

    Update 1.4.3.0:

      @@ -190,6 +200,12 @@

    +