Merge branch 'master' into dev

This commit is contained in:
calzoneman 2013-07-01 17:44:27 -04:00
commit 0611a6b0a6
6 changed files with 37 additions and 6 deletions

View File

@ -30,7 +30,12 @@ function getJSON(options, callback) {
catch(e) { catch(e) {
Logger.errlog.log("JSON fail: " + options.path); Logger.errlog.log("JSON fail: " + options.path);
var m = buffer.match(/<internalReason>([^<]+)<\/internalReason>/); var m = buffer.match(/<internalReason>([^<]+)<\/internalReason>/);
callback(m[1] || true, res.statusCode, null); if(m) {
callback(m[1], res.statusCode, null);
}
else {
callback(true, res.statusCode, null);
}
return; return;
} }
callback(false, res.statusCode, data); callback(false, res.statusCode, data);
@ -55,7 +60,12 @@ function getJSONHTTPS(options, callback) {
catch(e) { catch(e) {
Logger.errlog.log("JSON fail: " + options.path); Logger.errlog.log("JSON fail: " + options.path);
var m = buffer.match(/<internalReason>([^<]+)<\/internalReason>/); var m = buffer.match(/<internalReason>([^<]+)<\/internalReason>/);
callback(m[1] || true, res.statusCode, null); if(m) {
callback(m[1], res.statusCode, null);
}
else {
callback(true, res.statusCode, null);
}
return; return;
} }
callback(false, res.statusCode, data); callback(false, res.statusCode, data);

View File

@ -77,6 +77,7 @@
<input type="text" id="channame" placeholder="Channel Name"> <input type="text" id="channame" placeholder="Channel Name">
<button class="btn" id="chanlog">Channel log</button> <button class="btn" id="chanlog">Channel log</button>
</div> </div>
<button class="btn" id="log_reverse">Reverse Log</button>
</form> </form>
<pre id="log"></pre> <pre id="log"></pre>
</div> </div>

View File

@ -123,6 +123,12 @@ $("#actionlog_time").click(function() {
tableResort($("#actionlog table"), "time"); tableResort($("#actionlog table"), "time");
}); });
function reverseLog() {
$("#log").text($("#log").text().split("\n").reverse().join("\n"));
}
$("#log_reverse").click(reverseLog);
function getSyslog() { function getSyslog() {
$.ajax(WEB_URL+"/api/plain/readlog?type=sys&"+AUTH).done(function(data) { $.ajax(WEB_URL+"/api/plain/readlog?type=sys&"+AUTH).done(function(data) {
$("#log").text(data); $("#log").text(data);

View File

@ -58,6 +58,7 @@ var Player = function(data) {
this.nullPlayer(); this.nullPlayer();
break; break;
} }
this.load(data);
} }
Player.prototype.nullPlayer = function() { Player.prototype.nullPlayer = function() {
@ -114,19 +115,23 @@ Player.prototype.initYouTube = function() {
} }
this.pause = function() { this.pause = function() {
this.player.pauseVideo(); if(this.player.pauseVideo)
this.player.pauseVideo();
} }
this.play = function() { this.play = function() {
this.player.playVideo(); if(this.player.playVideo)
this.player.playVideo();
} }
this.getTime = function(callback) { this.getTime = function(callback) {
callback(this.player.getCurrentTime()); if(this.player.getCurrentTime)
callback(this.player.getCurrentTime());
} }
this.seek = function(time) { this.seek = function(time) {
this.player.seekTo(time, true); if(this.player.seekTo)
this.player.seekTo(time, true);
} }
} }

View File

@ -190,6 +190,8 @@ $("#userpl_save").click(function() {
var caret = btn.find(".caret").detach(); var caret = btn.find(".caret").detach();
btn.text($(select).text()); btn.text($(select).text());
caret.appendTo(btn); caret.appendTo(btn);
if(PLAYER.type == "yt" && PLAYER.player.setPlaybackQuality)
PLAYER.player.setPlaybackQuality(VIDEOQUALITY);
}); });
} }
qualHandler("#quality_240p", "small"); qualHandler("#quality_240p", "small");
@ -199,6 +201,12 @@ $("#userpl_save").click(function() {
qualHandler("#quality_1080p", "hd1080"); qualHandler("#quality_1080p", "hd1080");
})(); })();
$("#mediarefresh").click(function() {
PLAYER.type = "";
PLAYER.id = "";
socket.emit("playerReady");
});
/* playlist controls */ /* playlist controls */
$("#queue").sortable({ $("#queue").sortable({

View File

@ -156,6 +156,7 @@
<li><a id="quality_1080p" href="javascript:void(0)">1080p</a></li> <li><a id="quality_1080p" href="javascript:void(0)">1080p</a></li>
</ul> </ul>
</div> </div>
<button class="btn btn-small" id="mediarefresh">Refresh Media</button>
</div> </div>
<!-- electric boogaloo --> <!-- electric boogaloo -->
<div class="span12" id="queue_align2"></div> <div class="span12" id="queue_align2"></div>