Skip to content

Commit

Permalink
-Bump version number to prepare for new release
Browse files Browse the repository at this point in the history
-Some code clean up
  • Loading branch information
khloke committed Oct 24, 2013
1 parent f4db706 commit 9c176fb
Show file tree
Hide file tree
Showing 6 changed files with 40 additions and 26 deletions.
9 changes: 8 additions & 1 deletion js/content_scripts/khanacademy-content-scripts.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,14 @@ init();

chrome.extension.onMessage.addListener(
function(request, sender, sendResponse) {
if (request.action == "getYoutubeId") {
if (request.action == "isValid") {
if (youtubeid) {
sendResponse({valid: JSON.stringify(true)});
} else {
sendResponse({valid: JSON.stringify(false)})
}

} else if (request.action == "getYoutubeId") {
if (youtubeid) {
sendResponse({youtubeId: JSON.stringify(youtubeid)});
}
Expand Down
27 changes: 12 additions & 15 deletions js/remote.js
Original file line number Diff line number Diff line change
Expand Up @@ -251,7 +251,7 @@ function initJsonVersion() {
});
}

function activateVideoButton() {
function enableVideoButtons() {
$(".disabled-btn").each(function () {
$(this).removeAttr('disabled')
});
Expand All @@ -260,25 +260,22 @@ function activateVideoButton() {
});
}

function enablePlaylistButtons() {
var queueListButton = $('#queueListButton');
queueListButton.attr('disabled', false);
queueListButton.parent().removeClass('disabled');
}
function initVideoButton() {
chrome.tabs.getSelected(null, function (tab) {
var url = tab.url;
var valid = validUrl(url);
var validPlaylist = validPlaylistUrl(url);
// if valid, enable buttons
if (valid) {
activateVideoButton();
}

if (validPlaylist) {
var queueListButton = $('#queueListButton');
queueListButton.attr('disabled', false);
queueListButton.parent().removeClass('disabled');
}

validPage(function() {
activateVideoButton();
validVideoPage(url, function() {
enableVideoButtons();
});

if (validPlaylistUrl(url)) {
enablePlaylistButtons();
}
});
}

Expand Down
2 changes: 1 addition & 1 deletion js/shared.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
var currentVersion = 1422;
var currentVersion = 1430;

var storageKeys = {
"showRepeat": "showRepeat",
Expand Down
18 changes: 11 additions & 7 deletions js/xbmc-helper.js
Original file line number Diff line number Diff line change
Expand Up @@ -265,14 +265,18 @@ function validPlaylistUrl(url) {
return false;
}

function validPage(callback) {
chrome.tabs.getSelected(null, function (tab) {
chrome.tabs.sendMessage(tab.id, {action: 'getYoutubeId'}, function (response) {
if (response) {
callback();
}
function validVideoPage(url, callback) {
if (validUrl(url)) {
callback();
} else {
chrome.tabs.getSelected(null, function (tab) {
chrome.tabs.sendMessage(tab.id, {action: 'isValid'}, function (response) {
if (response) {
callback();
}
});
});
});
}
}

function clearPlaylist(callback) {
Expand Down
4 changes: 2 additions & 2 deletions manifest.json
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
{
"manifest_version": 2,
"version": "1.4.2.2",
"version": "1.4.3.0",
"name": "Play to XBMC",
"description": "Play YouTube, Vimeo, DailyMotion, CollegeHumor, eBaumsWorld, LiveLeak, Twitch.tv, Khan Academy, Hulu and more on XBMC.",
"description": "Play, queue and control your favourite Internet media on XBMC.",
"options_page": "options.html",
"permissions": [ "tabs", "http://*/*", "contextMenus" ],
"browser_action": {
Expand Down
6 changes: 6 additions & 0 deletions options.html
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,12 @@
</div>
<div class="tab-pane" id="changelist">
<div style="margin: 0 25px">
<p>
<strong>Update 1.4.3.0:</strong>
<ul>
<li>Added support for XBMCtorrent. You can now use the context menus to play magnet links. For more information on XBMCtorrent, click <a target="_blank" href="http://www.xbmchub.com/forums/general-video-addon-discussion/13153-%5Balpha%5D-xbmctorrent-torrent-streaming-xbmc.html">HERE</a>.</li>
</ul>
</p>
<p>
<strong>Update 1.4.2.1:</strong>
<ul>
Expand Down

0 comments on commit 9c176fb

Please sign in to comment.