SAAS-948 - Frontend tweaks and fixes

This commit is contained in:
Duncan Sommerville 2015-07-29 13:35:01 -04:00
parent fcbc37977f
commit 661a87dfbc
13 changed files with 806 additions and 711 deletions

View File

@ -29,25 +29,25 @@ class ShowBuilderController extends Zend_Controller_Action {
$this->view->headLink()->appendStylesheet($baseUrl.'css/jquery.contextMenu.css?'.$CC_CONFIG['airtime_version']);
$this->view->headLink()->appendStylesheet($baseUrl.'css/datatables/css/ColVis.css?'.$CC_CONFIG['airtime_version']);
$this->view->headLink()->appendStylesheet($baseUrl.'css/datatables/css/ColReorder.css?'.$CC_CONFIG['airtime_version']);
$this->view->headScript()->appendFile($baseUrl.'js/airtime/library/library-test.js?'.$CC_CONFIG['airtime_version'],'text/javascript');
$this->view->headScript()->appendFile($baseUrl.'js/airtime/library/events/library_showbuilder_test.js?'.$CC_CONFIG['airtime_version'],'text/javascript');
$this->view->headScript()->appendFile($baseUrl.'js/airtime/library/_library.js?'.$CC_CONFIG['airtime_version'],'text/javascript');
$this->view->headScript()->appendFile($baseUrl.'js/airtime/library/events/_library_showbuilder.js?'.$CC_CONFIG['airtime_version'],'text/javascript');
// PLUPLOAD
$this->view->headScript()->appendFile($baseUrl.'js/libs/dropzone.min.js?'.$CC_CONFIG['airtime_version'],'text/javascript');
$this->view->headLink()->appendStylesheet($baseUrl.'css/dropzone/dropzone.min.css?'.$CC_CONFIG['airtime_version']);
$this->view->headScript()->appendFile($baseUrl.'js/timepicker/jquery.ui.timepicker.js?'.$CC_CONFIG['airtime_version'],'text/javascript');
$this->view->headScript()->appendFile($baseUrl.'js/airtime/showbuilder/builder_test.js?'.$CC_CONFIG['airtime_version'],'text/javascript');
$this->view->headScript()->appendFile($baseUrl.'js/airtime/showbuilder/main_builder_test.js?'.$CC_CONFIG['airtime_version'],'text/javascript');
$this->view->headScript()->appendFile($baseUrl.'js/airtime/showbuilder/_builder.js?'.$CC_CONFIG['airtime_version'],'text/javascript');
$this->view->headScript()->appendFile($baseUrl.'js/airtime/showbuilder/_main_builder.js?'.$CC_CONFIG['airtime_version'],'text/javascript');
// MEDIA BUILDER
$this->view->headScript()->appendFile($baseUrl.'js/airtime/library/spl-test.js?'.$CC_CONFIG['airtime_version'], 'text/javascript');
$this->view->headScript()->appendFile($baseUrl.'js/airtime/library/_spl.js?'.$CC_CONFIG['airtime_version'], 'text/javascript');
$this->view->headScript()->appendFile($baseUrl.'js/airtime/playlist/smart_blockbuilder.js?'.$CC_CONFIG['airtime_version'], 'text/javascript');
$this->view->headLink()->appendStylesheet($baseUrl.'css/playlist_builder.css?'.$CC_CONFIG['airtime_version']);
$this->view->headLink()->appendStylesheet($baseUrl.'css/jquery.ui.timepicker.css?'.$CC_CONFIG['airtime_version']);
$this->view->headLink()->appendStylesheet($baseUrl.'css/showbuilder.css?'.$CC_CONFIG['airtime_version']);
$this->view->headLink()->appendStylesheet($baseUrl.'css/showbuilder-test.css?'.$CC_CONFIG['airtime_version']);
$this->view->headLink()->appendStylesheet($baseUrl.'css/_showbuilder.css?'.$CC_CONFIG['airtime_version']);
$csrf_namespace = new Zend_Session_Namespace('csrf_namespace');
$csrf_element = new Zend_Form_Element_Hidden('csrf');
@ -68,7 +68,7 @@ class ShowBuilderController extends Zend_Controller_Action {
$end = DateTime::createFromFormat("U", $to, $utcTimezone);
$end->setTimezone($displayTimeZone);
$form = new Application_Form_ShowBuilderTest();
$form = new Application_Form_ShowBuilderNew();
$form->populate(array(
'sb_date_start' => $start->format("Y-m-d"),
'sb_time_start' => $start->format("H:i"),

View File

@ -1,6 +1,6 @@
<?php
class Application_Form_ShowBuilderTest extends Zend_Form_SubForm
class Application_Form_ShowBuilderNew extends Zend_Form_SubForm
{
public function init()
@ -69,7 +69,7 @@ class Application_Form_ShowBuilderTest extends Zend_Form_SubForm
// add a select to choose a show.
$showSelect = new Zend_Form_Element_Select("sb_show_filter");
$showSelect->setLabel(_("Show:"));
$showSelect->setLabel(_("Filter by Show"));
$showSelect->setMultiOptions($this->getShowNames());
$showSelect->setValue(null);
$showSelect->setDecorators(array('ViewHelper'));
@ -85,7 +85,7 @@ class Application_Form_ShowBuilderTest extends Zend_Form_SubForm
private function getShowNames()
{
$showNames = array("0" => "-------------------------");
$showNames = array("0" => "Filter by Show");
$shows = CcShowQuery::create()
->setFormatter(ModelCriteria::FORMAT_ON_DEMAND)

View File

@ -1,8 +1,16 @@
<?php echo $this->element->getElement('sb_date_start'); ?>
<?php echo $this->element->getElement('sb_time_start'); ?>
<?php echo $this->element->getElement('sb_date_end'); ?>
<?php echo $this->element->getElement('sb_time_end'); ?>
<div class="sb-options-form">
<?php echo $this->element->getElement('sb_date_start'); ?>
<?php echo $this->element->getElement('sb_time_start'); ?>
<?php echo $this->element->getElement('sb_date_end'); ?>
<?php echo $this->element->getElement('sb_time_end'); ?>
<a id="sb_submit" class="btn btn-small" href="#" title="Display shows in the specified date and time range">
<i class="icon-white icon-search"></i><?php echo " "._("Find Shows") ?>
</a>
<a id="sb_submit" class="btn btn-small" href="#" title="Display shows in the specified date and time range">
<i class="icon-white icon-search"></i><?php echo " "._("Find Shows") ?>
</a>
<?php echo $this->element->getElement('sb_show_filter') ?>
<?php if ($this->element->getElement('sb_my_shows')):?>
<label><?php echo $this->element->getElement('sb_my_shows')->getLabel(); ?></label>
<?php echo $this->element->getElement('sb_my_shows'); ?>
<?php endif;?>
</div>

View File

@ -10,11 +10,14 @@
.wrapper {
position: absolute;
background: #242424;
top: 138px;
left: 0;
right: 0;
/*padding: 0;*/
padding: 2em;
padding: 0 12em;
height: calc(100% - 141px); /* Height of top panel + border */
}
.usability_hint {
margin-top: 1em;
}
</style>
<form action="/rest/media" method="post" id="upload_form" class="dropzone dz-clickable" <?php if ($this->quotaLimitReached) { ?> class="hidden" <?php } ?>>

View File

@ -21,7 +21,7 @@
<?php endif; ?>
</div>
<?php if (isset($this->obj)) : ?>
<?php if (isset($this->obj)) : ?>\
<input id="obj_id" type="hidden" value="<?php echo $this->obj->getId(); ?>"/>
<input id="obj_lastMod" type="hidden" value="<?php echo "1";//$this->obj->getLastModified('U'); ?>"/>
<input id="obj_type" type="hidden" value="webstream"/>

View File

@ -1,7 +1,8 @@
/* Show Builder*/
@media screen and (max-width: 1175px) {
@media screen and (max-width: 1475px) {
.lib-test, .sb-test, .media-builder-test, #media_type_nav {
height: auto !important;
width: 100% !important;
}
.media-builder-test {
@ -28,6 +29,20 @@
width: calc(100% - 1em) !important;
margin: 0 .5em .5em 0;
}
.wrapper {
padding: 1em !important;
}
}
@media screen and (max-width: 555px) {
#sb_show_filter {
float: none !important;
margin-top: 4px;
}
}
.btn {
color: #efefef;
}
.lib-test .dataTables_filter {
@ -36,7 +51,7 @@
.lib-test .dataTables_filter input[type="text"], .lib-test .dataTables_filter select {
margin-top: .5em;
width: 30%;
width: 20%;
float: right;
height: 26px;
}
@ -63,26 +78,56 @@
overflow: hidden !important;
}
.lib-test .dataTables_scrolling {
/* Subtract Advanced search (32) + header (38) + footer (38) */
height: calc(100% - 108px);
}
#library_display_wrapper, #show_builder_table_wrapper {
background-color: #474747;
}
.lib-test, .sb-test, .media-builder-test {
height: 70%;
/* 1em for the middle margin, 6 for half the width of the left pane */
width: calc(50% - 8em);
min-width: 470px;
}
#library_display_wrapper, #show_builder_table_wrapper {
height: 100%;
}
/* Timeline */
.sb-test {
margin-top: 1.5em;
margin-top: 2em;
}
#sb_submit {
text-decoration: none;
padding: .35em;
color: #efefef;
float: none;
}
.sb-timerange {
margin-bottom: 5px;
.sb-options-form {
width: 100%;
float: left;
padding-bottom: 5px;
}
.sb-options-form label {
color: #efefef;
line-height: 26px;
}
#sb_show_filter {
float: right;
}
#show_builder_table_wrapper {
clear: both;
}
/* Media builder */
@ -102,7 +147,7 @@
#media_type_nav {
float: left;
margin: 2em 0 0 0;
margin: 5.2em 0 0 0;
width: 12em;
@ -159,4 +204,6 @@
font-size: 20px;
font-weight: 300;
line-height: 1.4rem;
margin-top: 1em;
}

View File

@ -166,7 +166,7 @@ td.library_bitrate {
}
.lib-content fieldset.closed {
border-width: 1px 0 0;
margin-bottom: -6px;
margin-bottom: 0;
margin-left: 1px;
}
.dataTables_filter input[type="text"], .dataTables_filter select {

View File

@ -550,7 +550,7 @@ input[type="text"]:focus, input[type="password"]:focus, textarea:focus, .input_t
border: 1px solid #5b5b5b;
font-family: Arial,Helvetica,sans-serif;
font-size: 12px;
height: 25px;
height: 26px;
margin: 0;
padding: 2px 2px 2px 0;
vertical-align: top;

View File

@ -112,17 +112,17 @@ var AIRTIME = (function(AIRTIME) {
$button.text(btnText);
};
mod.createToolbarButtons = function() {
mod.createToolbarButtons = function () {
$menu = $("<div class='btn-toolbar' />");
$menu
.append("<div class='btn-group'>" +
"<button class='btn btn-small dropdown-toggle' data-toggle='dropdown'>" +
$.i18n._("Select")+" <span class='caret'></span>" +
$.i18n._("Select") + " <span class='caret'></span>" +
"</button>" +
"<ul class='dropdown-menu'>" +
"<li id='sb-select-page'><a href='#'>"+$.i18n._("Select this page")+"</a></li>" +
"<li id='sb-dselect-page'><a href='#'>"+$.i18n._("Deselect this page")+"</a></li>" +
"<li id='sb-dselect-all'><a href='#'>"+$.i18n._("Deselect all")+"</a></li>" +
"<li id='sb-select-page'><a href='#'>" + $.i18n._("Select this page") + "</a></li>" +
"<li id='sb-dselect-page'><a href='#'>" + $.i18n._("Deselect this page") + "</a></li>" +
"<li id='sb-dselect-all'><a href='#'>" + $.i18n._("Deselect all") + "</a></li>" +
"</ul>" +
"</div>")
.append("<div class='btn-group'>" +
@ -334,6 +334,7 @@ var AIRTIME = (function(AIRTIME) {
mod.selectNone = function() {
var $trs = $libTable.find("tr");
$trs.removeClass(LIB_SELECTED_CLASS);
$previouslySelected = undefined;
chosenItems = {};
@ -376,7 +377,7 @@ var AIRTIME = (function(AIRTIME) {
if (temp !== null && temp.hasOwnProperty('id') ) {
aMedia.push({"id": temp.id, "type": temp.ftype});
if ( (temp.id == currentObjId && temp.ftype === currentObjType) ||
temp.id == currentObjId && temp.ftype === "stream" && currentObjType === "webstream") {
temp.id == currentObjId && temp.ftype === "stream" && currentObjType === "webstream") {
closeObj = true;
}
}
@ -424,7 +425,7 @@ var AIRTIME = (function(AIRTIME) {
$libTable = $libContent.find("table");
function getTableHeight() {
return $libContent.height() - 175;
return $libContent.height() - 175;
}
function setColumnFilter(oTable){
@ -448,14 +449,14 @@ var AIRTIME = (function(AIRTIME) {
if (ele.bVisible) {
advanceSearchDiv.append(
"<div id='advanced_search_col_"+currentColId+"' class='control-group'>" +
"<label class='control-label'"+labelStyle+">"+ele.sTitle+" : </label>" +
"<div id='"+ele.mDataProp+"' class='controls "+inputClass+"'></div>" +
"<label class='control-label'"+labelStyle+">"+ele.sTitle+" : </label>" +
"<div id='"+ele.mDataProp+"' class='controls "+inputClass+"'></div>" +
"</div>");
} else {
advanceSearchDiv.append(
"<div id='advanced_search_col_"+currentColId+"' class='control-group' style='display:none;'>" +
"<label class='control-label'"+labelStyle+">"+ele.sTitle+"</label>" +
"<div id='"+ele.mDataProp+"' class='controls "+inputClass+"'></div>" +
"<label class='control-label'"+labelStyle+">"+ele.sTitle+"</label>" +
"<div id='"+ele.mDataProp+"' class='controls "+inputClass+"'></div>" +
"</div>");
}
@ -471,9 +472,9 @@ var AIRTIME = (function(AIRTIME) {
});
oTable.columnFilter({
aoColumns: colsForAdvancedSearch,
bUseColVis: true,
sPlaceHolder: "head:before"
aoColumns: colsForAdvancedSearch,
bUseColVis: true,
sPlaceHolder: "head:before"
}
);
}
@ -491,8 +492,8 @@ var AIRTIME = (function(AIRTIME) {
//resize to prevent double scroll bars.
var $fs = $el.parents("fieldset"),
tableHeight = getTableHeight(),
searchHeight = $fs.height();
tableHeight = getTableHeight(),
searchHeight = $fs.height();
$libContent.find(".dataTables_scrolling").css("max-height", tableHeight - searchHeight);
}
@ -505,43 +506,43 @@ var AIRTIME = (function(AIRTIME) {
//IMPORTANT: WHEN ADDING A NEW COLUMN PLEASE CONSULT WITH THE WIKI
// https://wiki.sourcefabric.org/display/CC/Adding+a+new+library+datatable+column
"aoColumns": [
/* ftype */ { "sTitle" : "" , "mDataProp" : "ftype" , "bSearchable" : false , "bVisible" : false } ,
/* Type */ { "sTitle" : "" , "mDataProp" : "image" , "bSearchable" : false , "sWidth" : "16px" , "sClass" : "library_type" , "iDataSort" : 0 } ,
///* Is Scheduled */ { "sTitle" : $.i18n._("Scheduled") , "mDataProp" : "is_scheduled" , "bVisible" : false , "bSearchable" : false , "sWidth" : "90px" , "sClass" : "library_is_scheduled"} ,
/* Is Playlist */ { "sTitle" : $.i18n._("Playlist / Block") , "mDataProp" : "is_playlist" , "bSearchable" : false , "sWidth" : "110px" , "sClass" : "library_is_playlist"} ,
/* Title */ { "sTitle" : $.i18n._("Title") , "mDataProp" : "track_title" , "sClass" : "library_title" , "sWidth" : "170px" } ,
/* Creator */ { "sTitle" : $.i18n._("Creator") , "mDataProp" : "artist_name" , "sClass" : "library_creator" , "sWidth" : "160px" } ,
/* Album */ { "sTitle" : $.i18n._("Album") , "mDataProp" : "album_title" , "sClass" : "library_album" , "sWidth" : "150px" } ,
/* Bit Rate */ { "sTitle" : $.i18n._("Bit Rate") , "mDataProp" : "bit_rate" , "bVisible" : false , "sClass" : "library_bitrate" , "sWidth" : "80px" },
/* BPM */ { "sTitle" : $.i18n._("BPM") , "mDataProp" : "bpm" , "bVisible" : false , "sClass" : "library_bpm" , "sWidth" : "50px" },
/* Composer */ { "sTitle" : $.i18n._("Composer") , "mDataProp" : "composer" , "bVisible" : false , "sClass" : "library_composer" , "sWidth" : "150px" },
/* Conductor */ { "sTitle" : $.i18n._("Conductor") , "mDataProp" : "conductor" , "bVisible" : false , "sClass" : "library_conductor" , "sWidth" : "125px" },
/* Copyright */ { "sTitle" : $.i18n._("Copyright") , "mDataProp" : "copyright" , "bVisible" : false , "sClass" : "library_copyright" , "sWidth" : "125px" },
/* Cue In */ { "sTitle" : $.i18n._("Cue In") , "mDataProp" : "cuein" , "bVisible" : false , "sClass" : "library_length" , "sWidth" : "80px" },
/* Cue Out */ { "sTitle" : $.i18n._("Cue Out") , "mDataProp" : "cueout" , "bVisible" : false , "sClass" : "library_length" , "sWidth" : "80px" },
/* Encoded */ { "sTitle" : $.i18n._("Encoded By") , "mDataProp" : "encoded_by" , "bVisible" : false , "sClass" : "library_encoded" , "sWidth" : "150px" },
/* Genre */ { "sTitle" : $.i18n._("Genre") , "mDataProp" : "genre" , "bVisible" : false , "sClass" : "library_genre" , "sWidth" : "100px" },
/* ISRC Number */ { "sTitle" : $.i18n._("ISRC") , "mDataProp" : "isrc_number" , "bVisible" : false , "sClass" : "library_isrc" , "sWidth" : "150px" },
/* Label */ { "sTitle" : $.i18n._("Label") , "mDataProp" : "label" , "bVisible" : false , "sClass" : "library_label" , "sWidth" : "125px" },
/* Language */ { "sTitle" : $.i18n._("Language") , "mDataProp" : "language" , "bVisible" : false , "sClass" : "library_language" , "sWidth" : "125px" },
/* Last Modified */ { "sTitle" : $.i18n._("Last Modified") , "mDataProp" : "mtime" , "bVisible" : false , "sClass" : "library_modified_time" , "sWidth" : "125px" },
/* Last Played */ { "sTitle" : $.i18n._("Last Played") , "mDataProp" : "lptime" , "bVisible" : false , "sClass" : "library_modified_time" , "sWidth" : "125px" },
/* Length */ { "sTitle" : $.i18n._("Length") , "mDataProp" : "length" , "sClass" : "library_length" , "sWidth" : "80px" } ,
/* Mime */ { "sTitle" : $.i18n._("Mime") , "mDataProp" : "mime" , "bVisible" : false , "sClass" : "library_mime" , "sWidth" : "80px" },
/* Mood */ { "sTitle" : $.i18n._("Mood") , "mDataProp" : "mood" , "bVisible" : false , "sClass" : "library_mood" , "sWidth" : "70px" },
/* Owner */ { "sTitle" : $.i18n._("Owner") , "mDataProp" : "owner_id" , "bVisible" : false , "sClass" : "library_language" , "sWidth" : "125px" },
/* Replay Gain */ { "sTitle" : $.i18n._("Replay Gain") , "mDataProp" : "replay_gain" , "bVisible" : false , "sClass" : "library_replay_gain" , "sWidth" : "80px" },
/* Sample Rate */ { "sTitle" : $.i18n._("Sample Rate") , "mDataProp" : "sample_rate" , "bVisible" : false , "sClass" : "library_sr" , "sWidth" : "80px" },
/* Track Number */ { "sTitle" : $.i18n._("Track Number") , "mDataProp" : "track_number" , "bVisible" : false , "sClass" : "library_track" , "sWidth" : "65px" },
/* Upload Time */ { "sTitle" : $.i18n._("Uploaded") , "mDataProp" : "utime" , "bVisible" : false , "sClass" : "library_upload_time" , "sWidth" : "125px" } ,
/* Website */ { "sTitle" : $.i18n._("Website") , "mDataProp" : "info_url" , "bVisible" : false , "sClass" : "library_url" , "sWidth" : "150px" },
/* Year */ { "sTitle" : $.i18n._("Year") , "mDataProp" : "year" , "bVisible" : false , "sClass" : "library_year" , "sWidth" : "60px" }
],
/* ftype */ { "sTitle" : "" , "mDataProp" : "ftype" , "bSearchable" : false , "bVisible" : false } ,
/* Type */ { "sTitle" : "" , "mDataProp" : "image" , "bSearchable" : false , "sWidth" : "16px" , "sClass" : "library_type" , "iDataSort" : 0 } ,
///* Is Scheduled */ { "sTitle" : $.i18n._("Scheduled") , "mDataProp" : "is_scheduled" , "bVisible" : false , "bSearchable" : false , "sWidth" : "90px" , "sClass" : "library_is_scheduled"} ,
/* Is Playlist */ { "sTitle" : $.i18n._("Playlist / Block") , "mDataProp" : "is_playlist" , "bSearchable" : false , "sWidth" : "110px" , "sClass" : "library_is_playlist"} ,
/* Title */ { "sTitle" : $.i18n._("Title") , "mDataProp" : "track_title" , "sClass" : "library_title" , "sWidth" : "170px" } ,
/* Creator */ { "sTitle" : $.i18n._("Creator") , "mDataProp" : "artist_name" , "sClass" : "library_creator" , "sWidth" : "160px" } ,
/* Album */ { "sTitle" : $.i18n._("Album") , "mDataProp" : "album_title" , "sClass" : "library_album" , "sWidth" : "150px" } ,
/* Bit Rate */ { "sTitle" : $.i18n._("Bit Rate") , "mDataProp" : "bit_rate" , "bVisible" : false , "sClass" : "library_bitrate" , "sWidth" : "80px" },
/* BPM */ { "sTitle" : $.i18n._("BPM") , "mDataProp" : "bpm" , "bVisible" : false , "sClass" : "library_bpm" , "sWidth" : "50px" },
/* Composer */ { "sTitle" : $.i18n._("Composer") , "mDataProp" : "composer" , "bVisible" : false , "sClass" : "library_composer" , "sWidth" : "150px" },
/* Conductor */ { "sTitle" : $.i18n._("Conductor") , "mDataProp" : "conductor" , "bVisible" : false , "sClass" : "library_conductor" , "sWidth" : "125px" },
/* Copyright */ { "sTitle" : $.i18n._("Copyright") , "mDataProp" : "copyright" , "bVisible" : false , "sClass" : "library_copyright" , "sWidth" : "125px" },
/* Cue In */ { "sTitle" : $.i18n._("Cue In") , "mDataProp" : "cuein" , "bVisible" : false , "sClass" : "library_length" , "sWidth" : "80px" },
/* Cue Out */ { "sTitle" : $.i18n._("Cue Out") , "mDataProp" : "cueout" , "bVisible" : false , "sClass" : "library_length" , "sWidth" : "80px" },
/* Encoded */ { "sTitle" : $.i18n._("Encoded By") , "mDataProp" : "encoded_by" , "bVisible" : false , "sClass" : "library_encoded" , "sWidth" : "150px" },
/* Genre */ { "sTitle" : $.i18n._("Genre") , "mDataProp" : "genre" , "bVisible" : false , "sClass" : "library_genre" , "sWidth" : "100px" },
/* ISRC Number */ { "sTitle" : $.i18n._("ISRC") , "mDataProp" : "isrc_number" , "bVisible" : false , "sClass" : "library_isrc" , "sWidth" : "150px" },
/* Label */ { "sTitle" : $.i18n._("Label") , "mDataProp" : "label" , "bVisible" : false , "sClass" : "library_label" , "sWidth" : "125px" },
/* Language */ { "sTitle" : $.i18n._("Language") , "mDataProp" : "language" , "bVisible" : false , "sClass" : "library_language" , "sWidth" : "125px" },
/* Last Modified */ { "sTitle" : $.i18n._("Last Modified") , "mDataProp" : "mtime" , "bVisible" : false , "sClass" : "library_modified_time" , "sWidth" : "125px" },
/* Last Played */ { "sTitle" : $.i18n._("Last Played") , "mDataProp" : "lptime" , "bVisible" : false , "sClass" : "library_modified_time" , "sWidth" : "125px" },
/* Length */ { "sTitle" : $.i18n._("Length") , "mDataProp" : "length" , "sClass" : "library_length" , "sWidth" : "80px" } ,
/* Mime */ { "sTitle" : $.i18n._("Mime") , "mDataProp" : "mime" , "bVisible" : false , "sClass" : "library_mime" , "sWidth" : "80px" },
/* Mood */ { "sTitle" : $.i18n._("Mood") , "mDataProp" : "mood" , "bVisible" : false , "sClass" : "library_mood" , "sWidth" : "70px" },
/* Owner */ { "sTitle" : $.i18n._("Owner") , "mDataProp" : "owner_id" , "bVisible" : false , "sClass" : "library_language" , "sWidth" : "125px" },
/* Replay Gain */ { "sTitle" : $.i18n._("Replay Gain") , "mDataProp" : "replay_gain" , "bVisible" : false , "sClass" : "library_replay_gain" , "sWidth" : "80px" },
/* Sample Rate */ { "sTitle" : $.i18n._("Sample Rate") , "mDataProp" : "sample_rate" , "bVisible" : false , "sClass" : "library_sr" , "sWidth" : "80px" },
/* Track Number */ { "sTitle" : $.i18n._("Track Number") , "mDataProp" : "track_number" , "bVisible" : false , "sClass" : "library_track" , "sWidth" : "65px" },
/* Upload Time */ { "sTitle" : $.i18n._("Uploaded") , "mDataProp" : "utime" , "bVisible" : false , "sClass" : "library_upload_time" , "sWidth" : "125px" } ,
/* Website */ { "sTitle" : $.i18n._("Website") , "mDataProp" : "info_url" , "bVisible" : false , "sClass" : "library_url" , "sWidth" : "150px" },
/* Year */ { "sTitle" : $.i18n._("Year") , "mDataProp" : "year" , "bVisible" : false , "sClass" : "library_year" , "sWidth" : "60px" }
],
"bProcessing": true,
"bServerSide": true,
"aLengthMenu": [[5, 10, 15, 20, 25, 50, 100], [5, 10, 15, 20, 25, 50, 100]],
"aLengthMenu": [5, 10, 15, 20, 25, 50, 100],
"bStateSave": true,
"fnStateSaveParams": function (oSettings, oData) {
@ -552,13 +553,13 @@ var AIRTIME = (function(AIRTIME) {
"fnStateSave": function (oSettings, oData) {
localStorage.setItem('datatables-library', JSON.stringify(oData));
/*
$.ajax({
url: baseUrl+"usersettings/set-library-datatable",
type: "POST",
data: {settings : oData, format: "json"},
dataType: "json"
});
*/
$.ajax({
url: baseUrl+"usersettings/set-library-datatable",
type: "POST",
data: {settings : oData, format: "json"},
dataType: "json"
});
*/
colReorderMap = oData.ColReorder;
},
@ -623,6 +624,8 @@ var AIRTIME = (function(AIRTIME) {
type = (type === undefined) ? 1 : type;
aoData.push( { name: "type", value: type} );
getUsabilityHint();
$.ajax( {
"dataType": 'json',
"type": "POST",
@ -673,7 +676,7 @@ var AIRTIME = (function(AIRTIME) {
return false;
});
},
// remove any selected nodes before the draw.
// remove any selected nodes before the draw.
"fnPreDrawCallback": function( oSettings ) {
// make sure any dragging helpers are removed or else they'll be
@ -696,12 +699,14 @@ var AIRTIME = (function(AIRTIME) {
"aiExclude": [0, 1, 2],
"sSize": "css",
"fnStateChange": setFilterElement,
"buttonText": $.i18n._("Show / hide columns")
"buttonText": $.i18n._("Columns")
},
"oColReorder": {
"iFixedColumns": 3
}
},
"bScrollCollapse": false
});
@ -713,9 +718,9 @@ var AIRTIME = (function(AIRTIME) {
$libContent.on("click", "legend", function(){
$simpleSearch = $libContent.find("#library_display_filter label");
var $fs = $(this).parents("fieldset"),
searchHeight,
tableHeight = getTableHeight(),
height;
searchHeight,
tableHeight = getTableHeight(),
height;
if ($fs.hasClass("closed")) {
$fs.removeClass("closed");
@ -754,7 +759,7 @@ var AIRTIME = (function(AIRTIME) {
$simpleSearch.removeClass("sp-invisible");
$fs.addClass("closed");
//resize the library table to avoid a double scroll bar. CC-4504
//resize the library table to avoid a double scroll bar. CC-4504
$libContent.find(".dataTables_scrolling").css("max-height", tableHeight);
}
});
@ -770,7 +775,7 @@ var AIRTIME = (function(AIRTIME) {
AIRTIME.library.dblClickAdd(data, data.ftype);
});
$libTable.find("tbody").on("click", "tr", function(ev) {
$libTable.find("tbody").on("mousedown", "tr", function(ev) {
var $tr = $(this),
// Get the ID of the selected row
$rowId = $tr.attr("id");
@ -793,19 +798,31 @@ var AIRTIME = (function(AIRTIME) {
}
mod.selectItem($tr);
} else if (ev.ctrlKey && $previouslySelected !== undefined) {
} else if (ev.ctrlKey) {
mod.selectItem($tr);
} else {
$("."+LIB_SELECTED_CLASS).each(function(i, el) {
mod.deselectItem($(el))
});
if (!$tr.hasClass(LIB_SELECTED_CLASS)) {
$("." + LIB_SELECTED_CLASS).each(function (i, el) {
mod.deselectItem($(el))
});
}
mod.selectItem($tr);
}
// Remember this row so we can properly multiselect
$previouslySelected = $tr;
});
$libTable.find("tbody").on("click", "tr", function(ev) {
if (!ev.ctrlKey && !ev.shiftKey) {
$("." + LIB_SELECTED_CLASS).each(function (i, el) {
mod.deselectItem($(el))
});
mod.selectItem($(this));
}
});
};
mod.libraryInit = libraryInit;
return AIRTIME;
@ -886,16 +903,16 @@ function validateAdvancedSearch(divs) {
addRemoveValidationIcons(valid, $(field), searchTermType);
/*
* Empty fields should not have valid/invalid indicator Range values
* are considered valid even if only the 'From' value is provided.
* Therefore, if the 'To' value is empty but the 'From' value is not
* empty we need to keep the validation icon on screen.
*/
/*
* Empty fields should not have valid/invalid indicator Range values
* are considered valid even if only the 'From' value is provided.
* Therefore, if the 'To' value is empty but the 'From' value is not
* empty we need to keep the validation icon on screen.
*/
} else if (searchTerm[0] === "" && searchTerm[1] !== "" ||
searchTerm[0] === "" && searchTerm[1] === ""){
searchTerm[0] === "" && searchTerm[1] === ""){
if ($(field).closest('div').children(':last-child').hasClass('checked-icon') ||
$(field).closest('div').children(':last-child').hasClass('not-available-icon')) {
$(field).closest('div').children(':last-child').hasClass('not-available-icon')) {
$(field).closest('div').children(':last-child').remove();
}
}

View File

@ -836,6 +836,14 @@ var AIRTIME = (function(AIRTIME){
// We also need to run the draw callback to update how dragged items are drawn
AIRTIME.library.fnDrawCallback();
var name = $('#playlist_name_display').text().trim();
if ((name == "Untitled Playlist"
|| name == "Untitled Smart Block")
&& $("#spl_sortable .spl_empty").length == 1) {
mod.fnDelete();
}
$.ajax( {
url : baseUrl+"usersettings/set-library-screen-settings",
type : "POST",

View File

@ -228,7 +228,7 @@ var AIRTIME = (function(AIRTIME) {
$toolbar.append($menu);
// add to timeline button
$toolbar
.find('.icon-plus').parent()
.find('#library-plus')
.click(
function() {
@ -286,7 +286,6 @@ var AIRTIME = (function(AIRTIME) {
}
var selection = $(".media_type_selector.selected").attr("selection_id");
console.log(selection);
if (selection == 2) {
AIRTIME.playlist.fnNew();

View File

@ -97,11 +97,11 @@ var AIRTIME = (function(AIRTIME){
// the is_scheduled flag in cc_files
if (schedId > 0) {
$.post(baseUrl+"schedule/update-future-is-scheduled",
{"format": "json", "schedId": schedId}, function(data) {
if (data.redrawLibTable !== undefined && data.redrawLibTable) {
$("#library_content").find("#library_display").dataTable().fnStandingRedraw();
}
});
{"format": "json", "schedId": schedId}, function(data) {
if (data.redrawLibTable !== undefined && data.redrawLibTable) {
$("#library_content").find("#library_display").dataTable().fnStandingRedraw();
}
});
oSchedTable.fnDraw();
}
};
@ -160,32 +160,32 @@ var AIRTIME = (function(AIRTIME){
mod.checkCancelButton = function() {
var $current = $sbTable.find(".sb-current-show"),
//this user type should be refactored into a separate users module later
//when there's more time and more JS will need to know user data.
//this user type should be refactored into a separate users module later
//when there's more time and more JS will need to know user data.
userType = localStorage.getItem('user-type'),
canCancel = false;
if ($current.length !== 0 && $current.hasClass("sb-allowed")) {
canCancel = true;
canCancel = true;
}
else if ($current.length !== 0 && (userType === 'A' || userType === 'P')) {
canCancel = true;
}
if (canCancel === true) {
AIRTIME.button.enableButton("icon-ban-circle", true);
AIRTIME.button.enableButton("icon-ban-circle", true);
}
else {
AIRTIME.button.disableButton("icon-ban-circle", true);
AIRTIME.button.disableButton("icon-ban-circle", true);
}
};
mod.checkToolBarIcons = function() {
//library may not be on the page.
if (AIRTIME.library !== undefined) {
AIRTIME.library.checkAddButton();
}
//library may not be on the page.
if (AIRTIME.library !== undefined) {
AIRTIME.library.checkAddButton();
}
mod.checkSelectButton();
mod.checkTrimButton();
@ -237,6 +237,7 @@ var AIRTIME = (function(AIRTIME){
mod.selectNone = function () {
var $trs = $sbTable.find("tr.lib-audio");
$trs.removeClass(SB_SELECTED_CLASS);
$previouslySelected = undefined;
mod.checkToolBarIcons();
};
@ -274,6 +275,8 @@ var AIRTIME = (function(AIRTIME){
mod.enableUI();
//Unneccessary reload of the library pane after moving tracks in the showbuilder pane.
//$("#library_content").find("#library_display").dataTable().fnStandingRedraw();
getUsabilityHint();
};
mod.getSelectedCursors = function() {
@ -326,12 +329,12 @@ var AIRTIME = (function(AIRTIME){
mod.disableUI();
if (confirm($.i18n._("Delete selected item(s)?"))) {
$.post( baseUrl+"showbuilder/schedule-remove",
{"items": aItems, "format": "json"},
mod.fnItemCallback
);
$.post( baseUrl+"showbuilder/schedule-remove",
{"items": aItems, "format": "json"},
mod.fnItemCallback
);
}else{
mod.enableUI();
mod.enableUI();
}
};
@ -407,18 +410,18 @@ var AIRTIME = (function(AIRTIME){
oSchedTable = $sbTable.dataTable( {
"aoColumns": [
/* Type */ {"mDataProp": "image", "sTitle": "", "sClass": "library_image sb-image", "sWidth": "16px"},
/* starts */ {"mDataProp": "starts", "sTitle": $.i18n._("Start"), "sClass": "sb-starts", "sWidth": "60px"},
/* ends */ {"mDataProp": "ends", "sTitle": $.i18n._("End"), "sClass": "sb-ends", "sWidth": "60px"},
/* runtime */ {"mDataProp": "runtime", "sTitle": $.i18n._("Duration"), "sClass": "library_length sb-length", "sWidth": "65px"},
/* title */ {"mDataProp": "title", "sTitle": $.i18n._("Title"), "sClass": "sb-title"},
/* creator */ {"mDataProp": "creator", "sTitle": $.i18n._("Creator"), "sClass": "sb-creator"},
/* album */ {"mDataProp": "album", "sTitle": $.i18n._("Album"), "sClass": "sb-album"},
/* cue in */ {"mDataProp": "cuein", "sTitle": $.i18n._("Cue In"), "bVisible": false, "sClass": "sb-cue-in"},
/* cue out */ {"mDataProp": "cueout", "sTitle": $.i18n._("Cue Out"), "bVisible": false, "sClass": "sb-cue-out"},
/* fade in */ {"mDataProp": "fadein", "sTitle": $.i18n._("Fade In"), "bVisible": false, "sClass": "sb-fade-in"},
/* fade out */ {"mDataProp": "fadeout", "sTitle": $.i18n._("Fade Out"), "bVisible": false, "sClass": "sb-fade-out"},
/* Mime */ {"mDataProp" : "mime", "sTitle" : $.i18n._("Mime"), "bVisible": false, "sClass": "sb-mime"}
/* Type */ {"mDataProp": "image", "sTitle": "", "sClass": "library_image sb-image", "sWidth": "16px"},
/* starts */ {"mDataProp": "starts", "sTitle": $.i18n._("Start"), "sClass": "sb-starts", "sWidth": "60px"},
/* ends */ {"mDataProp": "ends", "sTitle": $.i18n._("End"), "sClass": "sb-ends", "sWidth": "60px"},
/* runtime */ {"mDataProp": "runtime", "sTitle": $.i18n._("Duration"), "sClass": "library_length sb-length", "sWidth": "65px"},
/* title */ {"mDataProp": "title", "sTitle": $.i18n._("Title"), "sClass": "sb-title"},
/* creator */ {"mDataProp": "creator", "sTitle": $.i18n._("Creator"), "sClass": "sb-creator"},
/* album */ {"mDataProp": "album", "sTitle": $.i18n._("Album"), "sClass": "sb-album"},
/* cue in */ {"mDataProp": "cuein", "sTitle": $.i18n._("Cue In"), "bVisible": false, "sClass": "sb-cue-in"},
/* cue out */ {"mDataProp": "cueout", "sTitle": $.i18n._("Cue Out"), "bVisible": false, "sClass": "sb-cue-out"},
/* fade in */ {"mDataProp": "fadein", "sTitle": $.i18n._("Fade In"), "bVisible": false, "sClass": "sb-fade-in"},
/* fade out */ {"mDataProp": "fadeout", "sTitle": $.i18n._("Fade Out"), "bVisible": false, "sClass": "sb-fade-out"},
/* Mime */ {"mDataProp" : "mime", "sTitle" : $.i18n._("Mime"), "bVisible": false, "sClass": "sb-mime"}
],
"bJQueryUI": true,
@ -469,7 +472,7 @@ var AIRTIME = (function(AIRTIME){
fnPrepareSeparatorRow,
$node,
cl="",
//background-color to imitate calendar color.
//background-color to imitate calendar color.
r,g,b,a,
$nRow = $(nRow),
$image,
@ -583,7 +586,7 @@ var AIRTIME = (function(AIRTIME){
}
else {
//add the play function if the file exists on disk.
//add the play function if the file exists on disk.
$image = $nRow.find('td.sb-image');
$image.empty();
//check if the file exists.
@ -707,13 +710,13 @@ var AIRTIME = (function(AIRTIME){
if (temp.length > 0) {
aData = temp.data("aData");
// max time interval
// setTimeout allows only up to (2^31)-1 millisecs timeout value
maxRefreshInterval = Math.pow(2, 31) - 1;
refreshInterval = aData.refresh * 1000;
if(refreshInterval > maxRefreshInterval){
refreshInterval = maxRefreshInterval;
}
mod.timeout = setTimeout(function() {mod.refresh(aData.id)}, refreshInterval); //need refresh in milliseconds
// setTimeout allows only up to (2^31)-1 millisecs timeout value
maxRefreshInterval = Math.pow(2, 31) - 1;
refreshInterval = aData.refresh * 1000;
if(refreshInterval > maxRefreshInterval){
refreshInterval = maxRefreshInterval;
}
mod.timeout = setTimeout(function() {mod.refresh(aData.id)}, refreshInterval); //need refresh in milliseconds
break;
}
}
@ -727,7 +730,7 @@ var AIRTIME = (function(AIRTIME){
"oColVis": {
"aiExclude": [ 0, 1 ],
"buttonText": $.i18n._("Show / hide columns"),
"buttonText": $.i18n._("Columns")
},
"oColReorder": {
@ -736,10 +739,12 @@ var AIRTIME = (function(AIRTIME){
"sAjaxDataProp": "schedule",
"oLanguage": datatables_dict,
"sAjaxSource": baseUrl+"showbuilder/builder-feed"
"sAjaxSource": baseUrl+"showbuilder/builder-feed" ,
"bScrollCollapseY": false
});
$sbTable.find("tbody").on("click", "tr:not(.sb-past, .sb-empty)", function(ev) {
$sbTable.find("tbody").on("mousedown", "tr:not(.sb-past, .sb-empty)", function(ev) {
var $tr = $(this),
// Get the ID of the selected row
@ -765,7 +770,9 @@ var AIRTIME = (function(AIRTIME){
} else if (ev.ctrlKey && $previouslySelected !== undefined) {
$tr.addClass(SB_SELECTED_CLASS);
} else {
$("."+SB_SELECTED_CLASS).removeClass(SB_SELECTED_CLASS);
if (!$tr.hasClass(SB_SELECTED_CLASS)) {
$("."+SB_SELECTED_CLASS).removeClass(SB_SELECTED_CLASS);
}
$tr.addClass(SB_SELECTED_CLASS);
}
@ -775,6 +782,13 @@ var AIRTIME = (function(AIRTIME){
mod.checkToolBarIcons();
});
$sbTable.find("tbody").on("click", "tr:not(.sb-past, .sb-empty)", function(ev) {
if (!ev.ctrlKey && !ev.shiftKey) {
$("."+SB_SELECTED_CLASS).removeClass(SB_SELECTED_CLASS);
$(this).addClass(SB_SELECTED_CLASS);
}
});
var sortableConf = (function(){
var origTrs,
aItemData = [],
@ -830,7 +844,7 @@ var AIRTIME = (function(AIRTIME){
//can't add items outside of shows.
if (prev.find("td:first").hasClass("dataTables_empty")
|| prev.length === 0) {
|| prev.length === 0) {
alert($.i18n._("Cannot schedule outside a show."));
ui.item.remove();
return;
@ -873,52 +887,51 @@ var AIRTIME = (function(AIRTIME){
distance: 10,
helper:
function(event, item) {
var selected = mod.getSelectedData(NOW_PLAYING_CLASS),
thead = $("#show_builder_table thead"),
colspan = thead.find("th").length,
trfirst = thead.find("tr:first"),
width = trfirst.width(),
height = trfirst.height(),
message;
var selected = mod.getSelectedData(NOW_PLAYING_CLASS),
thead = $("#show_builder_table thead"),
colspan = thead.find("th").length,
trfirst = thead.find("tr:first"),
width = trfirst.width(),
height = trfirst.height(),
message;
//if nothing is checked select the dragged item.
if (selected.length === 0) {
selected = [item.data("aData")];
}
//if nothing is checked select the dragged item.
if (selected.length === 0) {
selected = [item.data("aData")];
}
if (selected.length === 1) {
message = sprintf($.i18n._("Moving %s"), selected[0].title);
//draggingContainer = item; //Default DataTables drag and drop
draggingContainer = $('<tr/>')
.addClass('sb-helper')
.append('<td/>')
.find("td")
.attr("colspan", colspan)
.width(width)
.height(height)
.addClass("ui-state-highlight")
.append(message)
.end();
}
else {
message = sprintf($.i18n._("Moving %s Items"), selected.length);
draggingContainer = $('<tr/>')
.addClass('sb-helper')
.append('<td/>')
.find("td")
.attr("colspan", colspan)
.width(width)
.height(height)
.addClass("ui-state-highlight")
.append(message)
.end();
if (selected.length === 1) {
message = sprintf($.i18n._("Moving %s"), selected[0].title);
//draggingContainer = item; //Default DataTables drag and drop
draggingContainer = $('<tr/>')
.addClass('sb-helper')
.append('<td/>')
.find("td")
.attr("colspan", colspan)
.width(width)
.height(height)
.addClass("ui-state-highlight")
.append(message)
.end();
}
else {
message = sprintf($.i18n._("Moving %s Items"), selected.length);
draggingContainer = $('<tr/>')
.addClass('sb-helper')
.append('<td/>')
.find("td")
.attr("colspan", colspan)
.width(width)
.height(height)
.addClass("ui-state-highlight")
.append(message)
.end();
}
}
helperData = selected;
helperData = selected;
return draggingContainer;
},
return draggingContainer;
},
items: 'tr:not(:first, :last, .sb-header, .sb-not-allowed, .sb-past, .sb-now-playing, .sb-empty)',
cancel: '.sb-footer',
receive: fnReceive,
@ -941,30 +954,30 @@ var AIRTIME = (function(AIRTIME){
$menu = $("<div class='btn-toolbar'/>");
$menu.append("<div class='btn-group'>" +
"<button class='btn btn-small dropdown-toggle' id='timeline-select' data-toggle='dropdown'>" +
$.i18n._("Select")+" <span class='caret'></span>" +
"</button>" +
"<ul class='dropdown-menu'>" +
"<li id='timeline-sa'><a href='#'>"+$.i18n._("Select all")+"</a></li>" +
"<li id='timeline-sn'><a href='#'>"+$.i18n._("Select none")+"</a></li>" +
"</ul>" +
"</div>")
"<button class='btn btn-small dropdown-toggle' id='timeline-select' data-toggle='dropdown'>" +
$.i18n._("Select")+" <span class='caret'></span>" +
"</button>" +
"<ul class='dropdown-menu'>" +
"<li id='timeline-sa'><a href='#'>"+$.i18n._("Select all")+"</a></li>" +
"<li id='timeline-sn'><a href='#'>"+$.i18n._("Select none")+"</a></li>" +
"</ul>" +
"</div>")
.append("<div class='btn-group'>" +
"<button title='"+$.i18n._("Remove overbooked tracks")+"' class='ui-state-disabled btn btn-small' disabled='disabled'>" +
"<i class='icon-white icon-cut'></i></button></div>")
"<button title='"+$.i18n._("Remove overbooked tracks")+"' class='ui-state-disabled btn btn-small' disabled='disabled'>" +
"<i class='icon-white icon-cut'></i></button></div>")
.append("<div class='btn-group'>" +
"<button title='"+$.i18n._("Remove selected scheduled items")+"' class='ui-state-disabled btn btn-small' disabled='disabled'>" +
"<i class='icon-white icon-trash'></i></button></div>");
"<button title='"+$.i18n._("Remove selected scheduled items")+"' class='ui-state-disabled btn btn-small' disabled='disabled'>" +
"<i class='icon-white icon-trash'></i></button></div>");
//if 'Add/Remove content' was chosen from the context menu
//in the Calendar do not append these buttons
if ($(".ui-dialog-content").length === 0) {
$menu.append("<div class='btn-group'>" +
"<button title='"+$.i18n._("Jump to the current playing track")+"' class='ui-state-disabled btn btn-small' disabled='disabled'>" +
"<i class='icon-white icon-step-forward'></i></button></div>")
.append("<div class='btn-group'>" +
"<button title='"+$.i18n._("Cancel current show")+"' class='ui-state-disabled btn btn-small btn-danger' disabled='disabled'>" +
"<i class='icon-white icon-ban-circle'></i></button></div>");
"<button title='"+$.i18n._("Jump to the current playing track")+"' class='ui-state-disabled btn btn-small' disabled='disabled'>" +
"<i class='icon-white icon-step-forward'></i></button></div>")
.append("<div class='btn-group'>" +
"<button title='"+$.i18n._("Cancel current show")+"' class='ui-state-disabled btn btn-small btn-danger' disabled='disabled'>" +
"<i class='icon-white icon-ban-circle'></i></button></div>");
}
if (localStorage.getItem('user-type') != 'G') {
@ -1019,14 +1032,14 @@ var AIRTIME = (function(AIRTIME){
return;
}
/*
var $scroll = $sbContent.find(".dataTables_scrolling"),
scrolled = $scroll.scrollTop(),
scrollingTop = $scroll.offset().top,
current = $sbTable.find("."+NOW_PLAYING_CLASS),
currentTop = current.offset().top;
var $scroll = $sbContent.find(".dataTables_scrolling"),
scrolled = $scroll.scrollTop(),
scrollingTop = $scroll.offset().top,
current = $sbTable.find("."+NOW_PLAYING_CLASS),
currentTop = current.offset().top;
$scroll.scrollTop(currentTop - scrollingTop + scrolled);
*/
$scroll.scrollTop(currentTop - scrollingTop + scrolled);
*/
mod.jumpToCurrentTrack();
});