Merge branch '2.1.x' of dev.sourcefabric.org:airtime into 2.1.x
This commit is contained in:
commit
bcf3f0014f
|
@ -131,9 +131,11 @@ class Application_Form_LiveStreamingPreferences extends Zend_Form_SubForm
|
|||
|
||||
$isSaas = Application_Model_Preference::GetPlanLevel() == 'disabled'?false:true;
|
||||
$isDemo = isset($CC_CONFIG['demo']) && $CC_CONFIG['demo'] == 1;
|
||||
$master_dj_connection_url = Application_Model_StreamSetting::GetConnectionUrls('master');
|
||||
$live_dj_connection_url = Application_Model_StreamSetting::GetConnectionUrls('show');
|
||||
|
||||
$this->setDecorators(array(
|
||||
array('ViewScript', array('viewScript' => 'form/preferences_livestream.phtml', 'isSaas' => $isSaas, 'isDemo' => $isDemo))
|
||||
array('ViewScript', array('viewScript' => 'form/preferences_livestream.phtml', 'master_dj_connection_url'=>$master_dj_connection_url, 'live_dj_connection_url'=>$live_dj_connection_url, 'isSaas' => $isSaas, 'isDemo' => $isDemo))
|
||||
));
|
||||
}
|
||||
|
||||
|
|
|
@ -94,13 +94,15 @@
|
|||
</label>
|
||||
</dt>
|
||||
<dd id="master_dj_connection_url-element">
|
||||
<span id="stream_url" class="static_text"><?php echo $this->element->getElement('master_dj_connection_url') ?></span>
|
||||
<span id="stream_url"><?php echo $this->element->getElement('master_dj_connection_url')->setValue($this->master_dj_connection_url) ?></span>
|
||||
<?php if( !$this->isSaas && !$this->isDemo){?>
|
||||
<a href=# id="connection_url_override" style="font-size: 12px;">override</a>
|
||||
<a href=# id="connection_url_override" style="font-size: 12px;">Override</a>
|
||||
<span class="override_help_icon">
|
||||
</span><br>
|
||||
<?php } ?>
|
||||
<div id="master_dj_connection_url_tb" style="display:none"><input type="text"><a href=# id="ok" style="font-size: 12px;">OK</a> <a href=# id="reset" style="font-size: 12px;">RESET</a></div>
|
||||
<div id="master_dj_connection_url_actions" style="display:none">
|
||||
<a href=# id="ok" style="font-size: 12px;">OK</a> <a href=# id="reset" style="font-size: 12px;">RESET</a>
|
||||
</div>
|
||||
</dd>
|
||||
<?php if( !$this->isSaas ){?>
|
||||
<dt id="dj_harbor_input_port-label">
|
||||
|
@ -137,13 +139,15 @@
|
|||
</label>
|
||||
</dt>
|
||||
<dd id="live_dj_connection_url-element">
|
||||
<span id="stream_url" class="static_text"><?php echo $this->element->getElement('live_dj_connection_url') ?></span>
|
||||
<span id="stream_url"><?php echo $this->element->getElement('live_dj_connection_url')->setValue($this->live_dj_connection_url) ?></span>
|
||||
<?php if( !$this->isSaas && !$this->isDemo ){?>
|
||||
<a href=# id="connection_url_override" style="font-size: 12px;">override</a>
|
||||
<a href=# id="connection_url_override" style="font-size: 12px;">Override</a>
|
||||
<span class="override_help_icon">
|
||||
</span><br>
|
||||
<?php } ?>
|
||||
<div id="live_dj_connection_url_tb" style="display:none"><input type="text"><a href=# id="ok" style="font-size: 12px;">OK</a> <a href=# id="reset" style="font-size: 12px;">RESET</a></div>
|
||||
<div id="live_dj_connection_url_actions" style="display:none">
|
||||
<a href=# id="ok" style="font-size: 12px;">OK</a> <a href=# id="reset" style="font-size: 12px;">RESET</a>
|
||||
</div>
|
||||
</dd>
|
||||
</dl>
|
||||
</fieldset>
|
||||
|
|
|
@ -386,6 +386,10 @@ fieldset.plain {
|
|||
box-shadow: 0 2px 2px rgba(0, 0, 0, 0.2) inset;
|
||||
}
|
||||
|
||||
input[readonly]{
|
||||
background-color:#b1b1b1
|
||||
}
|
||||
|
||||
input[type="text"]:focus, input[type="password"]:focus, textarea:focus, .input_text_area:focus {
|
||||
border: 1px solid #0088f1;
|
||||
}
|
||||
|
|
|
@ -108,52 +108,57 @@ function checkLiquidsoapStatus(){
|
|||
|
||||
function setLiveSourceConnectionOverrideListener(){
|
||||
$("[id=connection_url_override]").click(function(event){
|
||||
var div_ele = $(this).parent().find("div[id$='_dj_connection_url_tb']")
|
||||
div_ele.find(":input").val("")
|
||||
div_ele.show()
|
||||
var url_input = $(this).parent().find("#stream_url").children()
|
||||
url_input.removeAttr("readonly")
|
||||
|
||||
$(this).parent().find("div[id$='_dj_connection_url_actions']").show()
|
||||
event.preventDefault()
|
||||
})
|
||||
|
||||
// set action for "OK" and "X"
|
||||
var live_dj_input = $("#live_dj_connection_url_tb")
|
||||
var live_dj_label = live_dj_input.parent().find("#stream_url")
|
||||
var master_dj_input = $("#master_dj_connection_url_tb")
|
||||
var master_dj_label = master_dj_input.parent().find("#stream_url")
|
||||
var live_dj_actions = $("#live_dj_connection_url_actions")
|
||||
var live_dj_input = live_dj_actions.parent().find("#stream_url").children()
|
||||
var master_dj_actions = $("#master_dj_connection_url_actions")
|
||||
var master_dj_input = master_dj_actions.parent().find("#stream_url").children()
|
||||
|
||||
live_dj_input.find("#ok").click(function(event){
|
||||
live_dj_actions.find("#ok").click(function(event){
|
||||
event.preventDefault()
|
||||
var url = $(this).parent().find(":input").val()
|
||||
live_dj_label.html(url)
|
||||
live_dj_input.hide()
|
||||
var url = live_dj_input.val()
|
||||
live_dj_input.val(url)
|
||||
live_dj_input.attr("readonly", "readonly")
|
||||
live_dj_actions.hide()
|
||||
$.get("/Preference/set-source-connection-url/", {format: "json", type: "livedj", url:encodeURIComponent(url)});
|
||||
event.preventDefault()
|
||||
})
|
||||
|
||||
live_dj_input.find("#reset").click(function(event){
|
||||
live_dj_actions.find("#reset").click(function(event){
|
||||
event.preventDefault()
|
||||
var port = $("#dj_harbor_input_port").val()
|
||||
var mount = $("#dj_harbor_input_mount_point").val()
|
||||
var url = "http://"+location.hostname+":"+port+"/"+mount
|
||||
live_dj_label.html(url)
|
||||
live_dj_input.hide()
|
||||
live_dj_input.val(url)
|
||||
live_dj_input.attr("readonly", "readonly")
|
||||
live_dj_actions.hide()
|
||||
$.get("/Preference/set-source-connection-url", {format: "json", type: "livedj", url:encodeURIComponent(url)});
|
||||
event.preventDefault()
|
||||
})
|
||||
|
||||
master_dj_input.find("#ok").click(function(event){
|
||||
var url = $(this).parent().find(":input").val()
|
||||
master_dj_label.html(url)
|
||||
master_dj_input.hide()
|
||||
master_dj_actions.find("#ok").click(function(event){
|
||||
var url = master_dj_input.val()
|
||||
master_dj_input.val(url)
|
||||
master_dj_input.attr("readonly", "readonly")
|
||||
master_dj_actions.hide()
|
||||
$.get("/Preference/set-source-connection-url", {format: "json", type: "masterdj", url:encodeURIComponent(url)})
|
||||
event.preventDefault()
|
||||
})
|
||||
|
||||
master_dj_input.find("#reset").click(function(event){
|
||||
master_dj_actions.find("#reset").click(function(event){
|
||||
var port = $("#master_harbor_input_port").val()
|
||||
var mount = $("#master_harbor_input_mount_point").val()
|
||||
var url = "http://"+location.hostname+":"+port+"/"+mount
|
||||
master_dj_label.html(url)
|
||||
master_dj_input.hide()
|
||||
master_dj_input.val(url)
|
||||
master_dj_input.attr("readonly", "readonly")
|
||||
master_dj_actions.hide()
|
||||
$.get("/Preference/set-source-connection-url", {format: "json", type: "masterdj", url:encodeURIComponent(url)})
|
||||
event.preventDefault()
|
||||
})
|
||||
|
|
Loading…
Reference in New Issue