Merge branch 'saas' into saas-speedy
This commit is contained in:
commit
8449194ca1
51 changed files with 4395 additions and 640 deletions
3014
airtime_mvc/public/js/airtime/player/mrp.js
Normal file
3014
airtime_mvc/public/js/airtime/player/mrp.js
Normal file
File diff suppressed because it is too large
Load diff
BIN
airtime_mvc/public/js/airtime/player/muses.swf
Normal file
BIN
airtime_mvc/public/js/airtime/player/muses.swf
Normal file
Binary file not shown.
94
airtime_mvc/public/js/airtime/player/player.js
Normal file
94
airtime_mvc/public/js/airtime/player/player.js
Normal file
|
@ -0,0 +1,94 @@
|
|||
function updateEmbedSrcParams()
|
||||
{
|
||||
var $embedCodeParams = "?";
|
||||
var $streamMode = getStreamMode();
|
||||
if ($streamMode == "manual") {
|
||||
var $stream = $("input[name=player_stream_url]:radio:checked").val();
|
||||
$embedCodeParams += "stream="+$stream;
|
||||
} else if ($streamMode == "auto") {
|
||||
$embedCodeParams += "stream=auto";
|
||||
}
|
||||
|
||||
$embedCodeParams += "&title="+getPlayerTitle();
|
||||
|
||||
$embedCodeParams += "\"";
|
||||
|
||||
$("textarea[name=player_embed_src]").val(function(index, value) {
|
||||
return value.replace(/\?.*?"/, $embedCodeParams);
|
||||
});
|
||||
|
||||
updatePlayerIframeSrc($("textarea[name=player_embed_src]").val());
|
||||
}
|
||||
|
||||
function updatePlayerIframeSrc(iframe_text) {
|
||||
var $player_iframe = $("#player_form iframe");
|
||||
var player_iframe_src = iframe_text.match(/http.*?"/)[0].slice(0, -1);
|
||||
$player_iframe.attr('src', player_iframe_src);
|
||||
}
|
||||
|
||||
function getStreamMode() {
|
||||
return $("input[name=player_stream_mode]:radio:checked").val();
|
||||
}
|
||||
|
||||
function getPlayerTitle() {
|
||||
return $("input[name=player_title]").val();
|
||||
}
|
||||
|
||||
$(document).ready(function() {
|
||||
|
||||
$("#player_stream_url-element").hide();
|
||||
|
||||
// stream mode change event
|
||||
$("#player_stream_mode-element").change(function() {
|
||||
var $streamMode = getStreamMode();
|
||||
|
||||
if ($streamMode == "auto") {
|
||||
$("#player_stream_url-element").hide();
|
||||
|
||||
} else if ($streamMode == "manual") {
|
||||
$("#player_stream_url-element").show();
|
||||
|
||||
$("input[name=player_stream_url]").each(function(i, obj) {
|
||||
if ($(this).parent().text().toLowerCase().indexOf("opus") >= 0) {
|
||||
$(this).attr("disabled", "disabled");
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
updateEmbedSrcParams();
|
||||
});
|
||||
|
||||
// stream url change event
|
||||
$("#player_stream_url-element").change(function() {
|
||||
updateEmbedSrcParams();
|
||||
});
|
||||
|
||||
// display title checkbox change event
|
||||
$("#player_display_title").change(function() {
|
||||
if ($(this).prop("checked")) {
|
||||
$("#player_title-label").show();
|
||||
$("#player_title-element").show();
|
||||
} else {
|
||||
$("#player_title-label").hide();
|
||||
$("#player_title-element").hide();
|
||||
}
|
||||
updateEmbedSrcParams();
|
||||
});
|
||||
|
||||
// title textbox change event
|
||||
// setup before functions
|
||||
var typingTimer;
|
||||
var doneTypingInterval = 3000;
|
||||
|
||||
// on keyup, start the countdown
|
||||
$("input[name=player_title]").keyup(function(){
|
||||
clearTimeout(typingTimer);
|
||||
typingTimer = setTimeout(updateEmbedSrcParams, doneTypingInterval);
|
||||
});
|
||||
|
||||
// on keydown, clear the countdown
|
||||
$("input[name=player_title]").keydown(function(){
|
||||
clearTimeout(typingTimer);
|
||||
});
|
||||
});
|
||||
|
|
@ -443,7 +443,7 @@ function setSliderForReplayGain(){
|
|||
$( "#replayGainModifier" ).val( $( "#slider-range-max" ).slider( "value" ) );
|
||||
}
|
||||
|
||||
function setPseudoAdminPassword(s1, s2, s3) {
|
||||
function setPseudoAdminPassword(s1, s2, s3, s4) {
|
||||
if (s1) {
|
||||
$('#s1_data-admin_pass').val('xxxxxx');
|
||||
}
|
||||
|
@ -453,11 +453,14 @@ function setPseudoAdminPassword(s1, s2, s3) {
|
|||
if (s3) {
|
||||
$('#s3_data-admin_pass').val('xxxxxx');
|
||||
}
|
||||
if (s4) {
|
||||
$('#s4_data-admin_pass').val('xxxxxx');
|
||||
}
|
||||
}
|
||||
|
||||
function getAdminPasswordStatus() {
|
||||
$.ajax({ url: baseUrl+'Preference/get-admin-password-status/format/json', dataType:"json", success:function(data){
|
||||
setPseudoAdminPassword(data.s1, data.s2, data.s3);
|
||||
setPseudoAdminPassword(data.s1, data.s2, data.s3, data.s4);
|
||||
}});
|
||||
}
|
||||
|
||||
|
@ -476,7 +479,7 @@ $(document).ready(function() {
|
|||
$('#content').empty().append(json.html);
|
||||
setupEventListeners();
|
||||
setSliderForReplayGain();
|
||||
setPseudoAdminPassword(json.s1_set_admin_pass, json.s2_set_admin_pass, json.s3_set_admin_pass);
|
||||
setPseudoAdminPassword(json.s1_set_admin_pass, json.s2_set_admin_pass, json.s3_set_admin_pass, json.s4_set_admin_pass);
|
||||
});
|
||||
}
|
||||
});
|
||||
|
|
|
@ -479,9 +479,11 @@ var AIRTIME = (function(AIRTIME){
|
|||
|
||||
/*
|
||||
a = oData.ColReorder;
|
||||
for (i = 0, length = a.length; i < length; i++) {
|
||||
if (typeof(a[i]) === "string") {
|
||||
a[i] = parseInt(a[i], 10);
|
||||
if (a) {
|
||||
for (i = 0, length = a.length; i < length; i++) {
|
||||
if (typeof(a[i]) === "string") {
|
||||
a[i] = parseInt(a[i], 10);
|
||||
}
|
||||
}
|
||||
}*/
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue