Merge branch 'devel' of dev.sourcefabric.org:airtime into devel
This commit is contained in:
commit
337e5fec8a
|
@ -23,7 +23,7 @@ $pages = array(
|
||||||
'resource' => 'plupload'
|
'resource' => 'plupload'
|
||||||
),
|
),
|
||||||
array(
|
array(
|
||||||
'label' => 'Playlist Builder',
|
'label' => 'Library',
|
||||||
'module' => 'default',
|
'module' => 'default',
|
||||||
'controller' => 'Playlist',
|
'controller' => 'Playlist',
|
||||||
'action' => 'index',
|
'action' => 'index',
|
||||||
|
|
|
@ -349,7 +349,7 @@ class ApiController extends Zend_Controller_Action
|
||||||
$result = Application_Model_Schedule::UpdateMediaPlayedStatus($media_id);
|
$result = Application_Model_Schedule::UpdateMediaPlayedStatus($media_id);
|
||||||
|
|
||||||
//set a 'last played' timestamp for media item
|
//set a 'last played' timestamp for media item
|
||||||
//needed for smart playlists
|
//needed for smart blocks
|
||||||
try {
|
try {
|
||||||
$file_id = Application_Model_Schedule::GetFileId($media_id);
|
$file_id = Application_Model_Schedule::GetFileId($media_id);
|
||||||
if (!is_null($file_id)) {
|
if (!is_null($file_id)) {
|
||||||
|
|
|
@ -60,7 +60,7 @@ class LibraryController extends Zend_Controller_Action
|
||||||
if ($this->obj_sess->type === "playlist") {
|
if ($this->obj_sess->type === "playlist") {
|
||||||
$menu["pl_add"] = array("name"=> "Add to Playlist", "icon" => "add-playlist", "icon" => "copy");
|
$menu["pl_add"] = array("name"=> "Add to Playlist", "icon" => "add-playlist", "icon" => "copy");
|
||||||
} else if ($this->obj_sess->type === "block") {
|
} else if ($this->obj_sess->type === "block") {
|
||||||
$menu["pl_add"] = array("name"=> "Add to Smart Playlist", "icon" => "add-playlist", "icon" => "copy");
|
$menu["pl_add"] = array("name"=> "Add to Smart Block", "icon" => "add-playlist", "icon" => "copy");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -152,12 +152,12 @@ class PlaylistController extends Zend_Controller_Action
|
||||||
}
|
}
|
||||||
|
|
||||||
private function wrongTypeToBlock($obj) {
|
private function wrongTypeToBlock($obj) {
|
||||||
$this->view->error = "You can only add tracks to smart playlists.";
|
$this->view->error = "You can only add tracks to smart block.";
|
||||||
$this->createFullResponse($obj);
|
$this->createFullResponse($obj);
|
||||||
}
|
}
|
||||||
|
|
||||||
private function wrongTypeToPlaylist($obj) {
|
private function wrongTypeToPlaylist($obj) {
|
||||||
$this->view->error = "You can only add tracks and smart playlists to playlists.";
|
$this->view->error = "You can only add tracks and smart blocks to playlists.";
|
||||||
$this->createFullResponse($obj);
|
$this->createFullResponse($obj);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -188,7 +188,7 @@ class PlaylistController extends Zend_Controller_Action
|
||||||
$this->view->headLink()->appendStylesheet($baseUrl.'/css/datatables/css/ColReorder.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/spl.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_playlistbuilder.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/playlist_builder.css?'.$CC_CONFIG['airtime_version']);
|
||||||
|
|
||||||
try {
|
try {
|
||||||
|
@ -229,7 +229,7 @@ class PlaylistController extends Zend_Controller_Action
|
||||||
|
|
||||||
$name = 'Untitled Playlist';
|
$name = 'Untitled Playlist';
|
||||||
if ($type == 'block') {
|
if ($type == 'block') {
|
||||||
$name = 'Untitled Smart Playlist';
|
$name = 'Untitled Smart Block';
|
||||||
}
|
}
|
||||||
|
|
||||||
$obj = new $objInfo['className']();
|
$obj = new $objInfo['className']();
|
||||||
|
|
|
@ -100,7 +100,7 @@ class Application_Form_SmartBlockCriteria extends Zend_Form_SubForm
|
||||||
|
|
||||||
|
|
||||||
$spType = new Zend_Form_Element_Radio('sp_type');
|
$spType = new Zend_Form_Element_Radio('sp_type');
|
||||||
$spType->setLabel('Set smart playlist type:')
|
$spType->setLabel('Set smart block type:')
|
||||||
->setDecorators(array('viewHelper'))
|
->setDecorators(array('viewHelper'))
|
||||||
->setMultiOptions(array(
|
->setMultiOptions(array(
|
||||||
'static' => 'Static',
|
'static' => 'Static',
|
||||||
|
@ -229,6 +229,9 @@ class Application_Form_SmartBlockCriteria extends Zend_Form_SubForm
|
||||||
$this->addElement($limitValue);
|
$this->addElement($limitValue);
|
||||||
if (isset($storedCrit["limit"])) {
|
if (isset($storedCrit["limit"])) {
|
||||||
$limitValue->setValue($storedCrit["limit"]["value"]);
|
$limitValue->setValue($storedCrit["limit"]["value"]);
|
||||||
|
} else {
|
||||||
|
// setting default to 1 hour
|
||||||
|
$limitValue->setValue(1);
|
||||||
}
|
}
|
||||||
|
|
||||||
//getting block content candidate count that meets criteria
|
//getting block content candidate count that meets criteria
|
||||||
|
|
|
@ -731,7 +731,7 @@ class Application_Model_StoredFile
|
||||||
$row['audioFile'] = $row['id'];
|
$row['audioFile'] = $row['id'];
|
||||||
$row['image'] = '<img title="Webstream preview" src="/css/images/record_icon.png">';
|
$row['image'] = '<img title="Webstream preview" src="/css/images/record_icon.png">';
|
||||||
} else if ($type == "bl") {
|
} else if ($type == "bl") {
|
||||||
$row['image'] = '<img title="Smart Playlist" src="/css/images/delete.png">';
|
$row['image'] = '<img title="Smart Block" src="/css/images/delete.png">';
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
<form id="smart-playlist-form" method="post" action="">
|
<form id="smart-block-form" method="post" action="">
|
||||||
<fieldset class='toggle <?php echo $this->openOption ? "" : "closed"?>' id='smart_playlist_options'>
|
<fieldset class='toggle <?php echo $this->openOption ? "" : "closed"?>' id='smart_block_options'>
|
||||||
<legend style='cursor: pointer;'><span class='ui-icon ui-icon-triangle-2-n-s'></span>Smart Playlist Options</legend>
|
<legend style='cursor: pointer;'><span class='ui-icon ui-icon-triangle-2-n-s'></span>Smart Block Options</legend>
|
||||||
<dl class='zend_form'>
|
<dl class='zend_form'>
|
||||||
<div id='sp-success' class='success' style='display:none'></div>
|
<div id='sp-success' class='success' style='display:none'></div>
|
||||||
<dd id='sp_type-element'>
|
<dd id='sp_type-element'>
|
||||||
|
|
|
@ -499,7 +499,7 @@ table.library-get-file-md.table-small{
|
||||||
/***** LIBRARY QTIP METADATA SPECIFIC STYLES END *****/
|
/***** LIBRARY QTIP METADATA SPECIFIC STYLES END *****/
|
||||||
|
|
||||||
|
|
||||||
/***** SMART PLAYLIST SPECIFIC STYLES BEGIN *****/
|
/***** SMART BLOCK SPECIFIC STYLES BEGIN *****/
|
||||||
.sp-invisible{
|
.sp-invisible{
|
||||||
visibility: hidden;
|
visibility: hidden;
|
||||||
}
|
}
|
||||||
|
@ -580,7 +580,7 @@ input.input_text.sp_extra_input_text{
|
||||||
.sp-closed{
|
.sp-closed{
|
||||||
border-width: 0 0 0 !important;
|
border-width: 0 0 0 !important;
|
||||||
}
|
}
|
||||||
/***** SMART PLAYLIST SPECIFIC STYLES END *****/
|
/***** SMART BLOCK SPECIFIC STYLES END *****/
|
||||||
|
|
||||||
label {
|
label {
|
||||||
font-size:13px;
|
font-size:13px;
|
||||||
|
|
|
@ -138,7 +138,7 @@ var AIRTIME = (function(AIRTIME){
|
||||||
if (aMediaIds.length > 0) {
|
if (aMediaIds.length > 0) {
|
||||||
AIRTIME.playlist.fnAddItems(aMediaIds, undefined, 'after');
|
AIRTIME.playlist.fnAddItems(aMediaIds, undefined, 'after');
|
||||||
} else {
|
} else {
|
||||||
alert('You can only add tracks to smart playlists.');
|
alert('You can only add tracks to smart blocks.');
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
|
@ -547,7 +547,7 @@ var AIRTIME = (function(AIRTIME) {
|
||||||
.append('<option value="0">All</option>')
|
.append('<option value="0">All</option>')
|
||||||
.append('<option value="1">Files</option>')
|
.append('<option value="1">Files</option>')
|
||||||
.append('<option value="2">Playlists</option>')
|
.append('<option value="2">Playlists</option>')
|
||||||
.append('<option value="3">Smart Playlists</option>')
|
.append('<option value="3">Smart Blocks</option>')
|
||||||
.append('<option value="4">Web Streams</option>')
|
.append('<option value="4">Web Streams</option>')
|
||||||
.end()
|
.end()
|
||||||
.change(function(ev){
|
.change(function(ev){
|
||||||
|
|
|
@ -355,7 +355,7 @@ var AIRTIME = (function(AIRTIME){
|
||||||
setCueEvents();
|
setCueEvents();
|
||||||
setFadeEvents();
|
setFadeEvents();
|
||||||
|
|
||||||
// functions in smart_playlistbuilder.js
|
// functions in smart_blockbuilder.js
|
||||||
setupUI();
|
setupUI();
|
||||||
appendAddButton();
|
appendAddButton();
|
||||||
appendModAddButton();
|
appendModAddButton();
|
||||||
|
@ -909,7 +909,7 @@ var AIRTIME = (function(AIRTIME){
|
||||||
ignoreRightClick: true,
|
ignoreRightClick: true,
|
||||||
items: {
|
items: {
|
||||||
"sp": {name: "New Playlist", callback: AIRTIME.playlist.fnNew},
|
"sp": {name: "New Playlist", callback: AIRTIME.playlist.fnNew},
|
||||||
"sb": {name: "New Smart Playlist", callback: AIRTIME.playlist.fnNewBlock},
|
"sb": {name: "New Smart Block", callback: AIRTIME.playlist.fnNewBlock},
|
||||||
"ws": {name: "New Webstream", callback: AIRTIME.playlist.fnWsNew}
|
"ws": {name: "New Webstream", callback: AIRTIME.playlist.fnWsNew}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
|
@ -1,9 +1,9 @@
|
||||||
$(document).ready(function() {
|
$(document).ready(function() {
|
||||||
setSmartPlaylistEvents();
|
setSmartBlockEvents();
|
||||||
});
|
});
|
||||||
|
|
||||||
function setSmartPlaylistEvents() {
|
function setSmartBlockEvents() {
|
||||||
var form = $('#smart-playlist-form');
|
var form = $('#smart-block-form');
|
||||||
|
|
||||||
/********** ADD CRITERIA ROW **********/
|
/********** ADD CRITERIA ROW **********/
|
||||||
form.find('.criteria_add').live('click', function(){
|
form.find('.criteria_add').live('click', function(){
|
||||||
|
@ -245,7 +245,7 @@ function getRowIndex(ele) {
|
||||||
* remains at the criteria row
|
* remains at the criteria row
|
||||||
*/
|
*/
|
||||||
function appendModAddButton() {
|
function appendModAddButton() {
|
||||||
var divs = $('#smart-playlist-form').find('div select[name^="sp_criteria_modifier"]').parent(':visible');
|
var divs = $('#smart-block-form').find('div select[name^="sp_criteria_modifier"]').parent(':visible');
|
||||||
$.each(divs, function(i, div){
|
$.each(divs, function(i, div){
|
||||||
if (i > 0) {
|
if (i > 0) {
|
||||||
/* If the criteria field is hidden we know it is a modifier row
|
/* If the criteria field is hidden we know it is a modifier row
|
||||||
|
@ -269,7 +269,7 @@ function appendModAddButton() {
|
||||||
* We need to do this everytime a row gets deleted
|
* We need to do this everytime a row gets deleted
|
||||||
*/
|
*/
|
||||||
function reindexElements() {
|
function reindexElements() {
|
||||||
var divs = $('#smart-playlist-form').find('div select[name^="sp_criteria_field"]').parent(),
|
var divs = $('#smart-block-form').find('div select[name^="sp_criteria_field"]').parent(),
|
||||||
index = 0,
|
index = 0,
|
||||||
modIndex = 0;
|
modIndex = 0;
|
||||||
$.each(divs, function(i, div){
|
$.each(divs, function(i, div){
|
||||||
|
@ -302,7 +302,7 @@ function reindexElements() {
|
||||||
}
|
}
|
||||||
|
|
||||||
function buttonClickAction(clickType, url){
|
function buttonClickAction(clickType, url){
|
||||||
var data = $('#smart-playlist-form').serializeArray(),
|
var data = $('#smart-block-form').serializeArray(),
|
||||||
obj_id = $('input[id="obj_id"]').val();
|
obj_id = $('input[id="obj_id"]').val();
|
||||||
|
|
||||||
enableLoadingIcon();
|
enableLoadingIcon();
|
||||||
|
@ -407,7 +407,7 @@ function disableAndHideExtraField(valEle, index) {
|
||||||
}
|
}
|
||||||
|
|
||||||
function sizeTextBoxes(ele, classToRemove, classToAdd) {
|
function sizeTextBoxes(ele, classToRemove, classToAdd) {
|
||||||
var form = $('#smart-playlist-form');
|
var form = $('#smart-block-form');
|
||||||
if (ele.hasClass(classToRemove)) {
|
if (ele.hasClass(classToRemove)) {
|
||||||
ele.removeClass(classToRemove).addClass(classToAdd);
|
ele.removeClass(classToRemove).addClass(classToAdd);
|
||||||
}
|
}
|
||||||
|
@ -453,30 +453,30 @@ function callback(data, type) {
|
||||||
|
|
||||||
if (type == 'shuffle' || type == 'generate') {
|
if (type == 'shuffle' || type == 'generate') {
|
||||||
AIRTIME.playlist.fnOpenPlaylist(json);
|
AIRTIME.playlist.fnOpenPlaylist(json);
|
||||||
var form = $('#smart-playlist-form');
|
var form = $('#smart-block-form');
|
||||||
if (json.result == "0") {
|
if (json.result == "0") {
|
||||||
if (type == 'shuffle') {
|
if (type == 'shuffle') {
|
||||||
form.find('.success').text('Smart playlist shuffled');
|
form.find('.success').text('Smart block shuffled');
|
||||||
} else if (type == 'generate') {
|
} else if (type == 'generate') {
|
||||||
form.find('.success').text('Smart playlist generated and saved');
|
form.find('.success').text('Smart block generated and saved');
|
||||||
//redraw library table so the length gets updated
|
//redraw library table so the length gets updated
|
||||||
dt.fnStandingRedraw();
|
dt.fnStandingRedraw();
|
||||||
}
|
}
|
||||||
form.find('.success').show();
|
form.find('.success').show();
|
||||||
}
|
}
|
||||||
form.find('#smart_playlist_options').removeClass("closed");
|
form.find('#smart_block_options').removeClass("closed");
|
||||||
} else {
|
} else {
|
||||||
AIRTIME.playlist.fnOpenPlaylist(json);
|
AIRTIME.playlist.fnOpenPlaylist(json);
|
||||||
var form = $('#smart-playlist-form');
|
var form = $('#smart-block-form');
|
||||||
if (json.result == "0") {
|
if (json.result == "0") {
|
||||||
$('#sp-success-saved').text('Smart playlist saved');
|
$('#sp-success-saved').text('Smart block saved');
|
||||||
$('#sp-success-saved').show();
|
$('#sp-success-saved').show();
|
||||||
|
|
||||||
//redraw library table so the length gets updated
|
//redraw library table so the length gets updated
|
||||||
var dt = $('table[id="library_display"]').dataTable();
|
var dt = $('table[id="library_display"]').dataTable();
|
||||||
dt.fnStandingRedraw();
|
dt.fnStandingRedraw();
|
||||||
}
|
}
|
||||||
form.find('#smart_playlist_options').removeClass("closed");
|
form.find('#smart_block_options').removeClass("closed");
|
||||||
}
|
}
|
||||||
setTimeout(removeSuccessMsg, 5000);
|
setTimeout(removeSuccessMsg, 5000);
|
||||||
}
|
}
|
||||||
|
@ -490,7 +490,7 @@ function removeSuccessMsg() {
|
||||||
function appendAddButton() {
|
function appendAddButton() {
|
||||||
var add_button = "<a class='ui-button sp-ui-button-icon-only criteria_add'>" +
|
var add_button = "<a class='ui-button sp-ui-button-icon-only criteria_add'>" +
|
||||||
"<span class='ui-icon ui-icon-plusthick'></span></a>";
|
"<span class='ui-icon ui-icon-plusthick'></span></a>";
|
||||||
var rows = $('#smart_playlist_options'),
|
var rows = $('#smart_block_options'),
|
||||||
enabled = rows.find('select[name^="sp_criteria_field"]:enabled');
|
enabled = rows.find('select[name^="sp_criteria_field"]:enabled');
|
||||||
|
|
||||||
rows.find('.criteria_add').remove();
|
rows.find('.criteria_add').remove();
|
Loading…
Reference in New Issue