Skip to content

Commit

Permalink
Fixed channel input and placeholder
Browse files Browse the repository at this point in the history
  • Loading branch information
Wassup789 committed Jul 12, 2014
1 parent 5558d62 commit 42f4b84
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 6 deletions.
22 changes: 19 additions & 3 deletions background.js
Original file line number Diff line number Diff line change
Expand Up @@ -125,9 +125,8 @@ $(document).ready(function(){
localStorage.setItem("serverStatus", true);
var channelsa = JSON.parse(localStorage.getItem("channels"));
for(var i = 0; i < Object.keys(channelsa).length; i++){
if(channelsa[i] != null){
if(channelsa[i] != null)
checkYoutube(i, channelsa[i]);
}
}
if(check == 1){
chrome.extension.sendMessage({browsing: "refreshPage"}, function(callback){});
Expand All @@ -151,7 +150,22 @@ $(document).ready(function(){
var channelsa = JSON.parse(localStorage.getItem("channels"));
cname = channelsa[cnum];
}
var channelStatus = false;

if(cname.indexOf(".com/") > -1){
if(cname.split(".com/")[1].split("/").length < 1){
setVariable("ytStatus", cnum, false);
wyn.log(1, "Channel: \"" + cname + "\" does not exist or connection cannot be made");
return;
}else{
cname = cname.split(".com/")[1];
if(cname.indexOf("channel/") > -1)
cname = cname.split("channel/")[1].split("/")[0];
else if(cname.indexOf("user/") > -1)
cname = cname.split("user/")[1].split("/")[0];
setVariable("channels", cnum, cname);
}
}

var channel = "http://gdata.youtube.com/feeds/api/users/" + cname + "/uploads?v=2";
var channel2 = "http://gdata.youtube.com/feeds/api/users/" + cname + "?v=2";

Expand All @@ -176,6 +190,8 @@ $(document).ready(function(){
return time;
}

var channelStatus;

$.ajax({
async: false,
type: "GET",
Expand Down
6 changes: 3 additions & 3 deletions settings.js
Original file line number Diff line number Diff line change
Expand Up @@ -181,7 +181,7 @@ $(document).ready(function(){
<img src="" style="background-color:#FFF" width="50px" height="50px">\
<span class="utitle uts1">' + channels + '</span>\
</a>\
<input type="text" placeholder="Channel ID" value="' + encodeHTML(channels) + '" class="uinput">\
<input type="text" placeholder="Channel ID or URL" value="' + encodeHTML(channels) + '" class="uinput">\
<button class="bbutton cnumber brad1" setting="' + i + '">\
<span class="bbutton_n">Save</span>\
</button>\
Expand All @@ -198,7 +198,7 @@ $(document).ready(function(){
<img src="' + logos + '" width="50px" height="50px">\
<span class="utitle uts1">' + names + '</span>\
</a>\
<input type="text" placeholder="Channel ID" value="' + encodeHTML(channels) + '" class="uinput">\
<input type="text" placeholder="Channel ID or URL" value="' + encodeHTML(channels) + '" class="uinput">\
<button class="bbutton cnumber brad1" setting="' + i + '">\
<span class="bbutton_n">Save</span>\
</button>\
Expand Down Expand Up @@ -276,7 +276,7 @@ $(document).ready(function(){
<li class="channeld newchann" style="display: none;">\
<div class="content">\
<span class="utitle">New Channel</span>\
<input type="text" placeholder="Channel ID" class="uinput">\
<input type="text" placeholder="Channel ID or URL" class="uinput">\
<button class="bbutton cnumber cbtn nchanb" setting="' + number + '">\
<span class="bbutton_n">Save</span>\
</button>\
Expand Down

0 comments on commit 42f4b84

Please sign in to comment.