CC-3503 : Preserve the state of "Now Playing" screen - whether Library section is open or not
This commit is contained in:
parent
03c5daa9e7
commit
fe21abf16d
|
@ -6,12 +6,31 @@ class UsersettingsController extends Zend_Controller_Action
|
|||
{
|
||||
/* Initialize action controller here */
|
||||
$ajaxContext = $this->_helper->getHelper('AjaxContext');
|
||||
$ajaxContext->addActionContext('get-library-datatable', 'json')
|
||||
$ajaxContext->addActionContext('get-now-playing-screen-settings', 'json')
|
||||
->addActionContext('set-now-playing-screen-settings', 'json')
|
||||
->addActionContext('get-library-datatable', 'json')
|
||||
->addActionContext('set-library-datatable', 'json')
|
||||
->addActionContext('get-timeline-datatable', 'json')
|
||||
->addActionContext('set-timeline-datatable', 'json')
|
||||
->initContext();
|
||||
}
|
||||
|
||||
public function setNowPlayingScreenSettingsAction() {
|
||||
|
||||
$request = $this->getRequest();
|
||||
$settings = $request->getParam("settings");
|
||||
|
||||
$data = serialize($settings);
|
||||
Application_Model_Preference::SetValue("nowplaying_screen", $data, true);
|
||||
}
|
||||
|
||||
public function getNowPlayingScreenSettingsAction() {
|
||||
|
||||
$data = Application_Model_Preference::GetValue("nowplaying_screen", true);
|
||||
if ($data != "") {
|
||||
$this->view->settings = unserialize($data);
|
||||
}
|
||||
}
|
||||
|
||||
public function setLibraryDatatableAction() {
|
||||
|
||||
|
|
|
@ -56,6 +56,30 @@ $(document).ready(function(){
|
|||
AIRTIME.showbuilder.fnServerData.start = oRange.start;
|
||||
AIRTIME.showbuilder.fnServerData.end = oRange.end;
|
||||
|
||||
$.ajax({
|
||||
url: "/usersettings/get-now-playing-screen-settings",
|
||||
type: "GET",
|
||||
data: {format: "json"},
|
||||
dataType: "json",
|
||||
success: function(json){
|
||||
var o = json.settings;
|
||||
|
||||
if (o === undefined) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (o.library === "true") {
|
||||
$lib.show()
|
||||
.width(Math.floor(screenWidth * 0.5));
|
||||
|
||||
$builder.width(Math.floor(screenWidth * 0.5))
|
||||
.find("#sb_edit")
|
||||
.remove()
|
||||
.end();
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
AIRTIME.library.libraryInit();
|
||||
AIRTIME.showbuilder.builderDataTable();
|
||||
|
||||
|
@ -91,8 +115,8 @@ $(document).ready(function(){
|
|||
|
||||
oTable.fnDraw();
|
||||
});
|
||||
|
||||
$builder.on("click","#sb_edit", function(ev){
|
||||
|
||||
$builder.on("click","#sb_edit", function () {
|
||||
var schedTable = $("#show_builder_table").dataTable();
|
||||
|
||||
//reset timestamp to redraw the cursors.
|
||||
|
@ -106,10 +130,18 @@ $(document).ready(function(){
|
|||
.remove()
|
||||
.end();
|
||||
|
||||
schedTable.fnDraw();
|
||||
schedTable.fnDraw();
|
||||
|
||||
$.ajax({
|
||||
url: "/usersettings/set-now-playing-screen-settings",
|
||||
type: "POST",
|
||||
data: {settings : {library : true}, format: "json"},
|
||||
dataType: "json",
|
||||
success: function(){}
|
||||
});
|
||||
});
|
||||
|
||||
$lib.on("click", "#sb_lib_close", function(ev) {
|
||||
$lib.on("click", "#sb_lib_close", function() {
|
||||
var schedTable = $("#show_builder_table").dataTable();
|
||||
|
||||
$lib.hide();
|
||||
|
@ -119,6 +151,14 @@ $(document).ready(function(){
|
|||
.end();
|
||||
|
||||
schedTable.fnDraw();
|
||||
|
||||
$.ajax({
|
||||
url: "/usersettings/set-now-playing-screen-settings",
|
||||
type: "POST",
|
||||
data: {settings : {library : false}, format: "json"},
|
||||
dataType: "json",
|
||||
success: function(){}
|
||||
});
|
||||
});
|
||||
|
||||
$builder.find('legend').click(function(ev, item){
|
||||
|
|
Loading…
Reference in New Issue