Merge branch 'devel' of dev.sourcefabric.org:airtime into devel

This commit is contained in:
Martin Konecny 2012-09-17 12:32:54 -04:00
commit 5bbc815a78
7 changed files with 91 additions and 45 deletions

View file

@ -8,8 +8,9 @@ class Application_Model_Soundcloud
public function __construct() public function __construct()
{ {
global $CC_CONFIG; global $CC_CONFIG;
$this->_soundcloud = new Services_Soundcloud(
$this->_soundcloud = new Services_Soundcloud($CC_CONFIG['soundcloud-client-id'], $CC_CONFIG['soundcloud-client-secret']); $CC_CONFIG['soundcloud-client-id'],
$CC_CONFIG['soundcloud-client-secret']);
} }
private function getToken() private function getToken()
@ -51,9 +52,9 @@ class Application_Model_Soundcloud
//YYYY-MM-DD-HH-mm-SS //YYYY-MM-DD-HH-mm-SS
$release = explode("-", $release); $release = explode("-", $release);
$track_data['track[release_year]'] = $release[0]; $track_data['track[release_year]'] = $release[0];
$track_data['track[release_month]'] = $release[1]; $track_data['track[release_month]'] = $release[1];
$track_data['track[release_day]'] = $release[2]; $track_data['track[release_day]'] = $release[2];
} }
if (isset($genre) && $genre != "") { if (isset($genre) && $genre != "") {
@ -81,7 +82,10 @@ class Application_Model_Soundcloud
); );
return $response; return $response;
} else {
throw new NoSoundCloundToken();
} }
} }
} }
class NoSoundCloundToken extends Exception {}

View file

@ -1,4 +1,7 @@
<div id="import_status" class="library_import" style="display:none">File import in progress... <img src="/css/images/file_import_loader.gif"></img></div> <div id="import_status" class="library_import" style="display:none">File import in progress... <img src="/css/images/file_import_loader.gif"></img></div>
<div id="advanced_search"></div> <fieldset class="toggle" id="filter_options">
<legend style="cursor: pointer;"><span class="ui-icon ui-icon-triangle-2-n-s"></span>Advanced Search Options</legend>
<div id="advanced_search" class="advanced_search form-horizontal"></div>
</fieldset>
<table id="library_display" cellpadding="0" cellspacing="0" class="datatable"> <table id="library_display" cellpadding="0" cellspacing="0" class="datatable">
</table> </table>

View file

@ -1,7 +1,7 @@
<div class="wrapper"> <div class="wrapper">
<div id="library_content" class="lib-content tabs ui-widget ui-widget-content block-shadow alpha-block padded"> <div id="library_content" class="lib-content tabs ui-widget ui-widget-content block-shadow alpha-block padded">
<div id="import_status" style="display:none">File import in progress...</div> <div id="import_status" style="display:none">File import in progress...</div>
<div id="advanced_search"></div> <div id="advanced_search" class="advanced_search form-horizontal"></div>
<table id="library_display" cellpadding="0" cellspacing="0" class="datatable"></table> <table id="library_display" cellpadding="0" cellspacing="0" class="datatable"></table>
</div> </div>
<div id="show_builder" class="sb-content ui-widget ui-widget-content block-shadow omega-block padded"> <div id="show_builder" class="sb-content ui-widget ui-widget-content block-shadow omega-block padded">

View file

@ -38,7 +38,7 @@
#library_content { #library_content {
float: left; float: left;
width: 50%; width: 50%;
overflow: hidden; overflow: auto;
} }
#library_display { #library_display {

View file

@ -84,15 +84,27 @@
text-align:right; text-align:right;
} }
.spl_block_expand { .spl_block_expand, .spl_block_expand.close {
float:right; float:right;
font-size: 9px; font-size: 9px;
height: 15px; height: 15px;
right: 35px; /*right: 35px;*/
width: 100px; width: 120px;
margin-top:2px; margin-top:2px;
cursor:pointer; cursor:pointer;
} color:#fff;
font-weight: normal;
text-shadow:none;
opacity:1;
}
.spl_block_expand:hover, .spl_block_expand.close:hover {
color:#FF611F;
text-shadow:none;
opacity:1;
}
.spl_block_expand .ui-icon {
float:left;
}
.spl_artist { .spl_artist {
font-size:12px; font-size:12px;
@ -495,11 +507,21 @@ li.spl_empty {
float: none; float: none;
margin-bottom: 4px; margin-bottom: 4px;
width: 100%; width: 100%;
font-size: 13px;
} }
.smart-block-info > li span { .smart-block-info > li span.block-item-time {
text-align: right; text-align: right;
float: right; float: right;
color: #D5D5D5; color: #D5D5D5;
font-size: 12px; font-size: 12px;
} }
.smart-block-info > li span.block-item-title {
font-weight: bold;
display: inline-block;
padding-right: 6px;
}
.smart-block-info > li span.block-item-author {
font-weight: normal;
display: inline-block;
}

View file

@ -51,8 +51,6 @@ var AIRTIME = (function(AIRTIME) {
$trs; $trs;
// TODO : hack, get rid of this crap library
if (!$libTable) { return ; }
// Get visible items and check if any chosenItems are visible // Get visible items and check if any chosenItems are visible
$trs = $libTable.find("tbody input:checkbox").parents("tr"); $trs = $libTable.find("tbody input:checkbox").parents("tr");
$trs.each(function(i){ $trs.each(function(i){
@ -363,6 +361,8 @@ var AIRTIME = (function(AIRTIME) {
var tableHeight = $libContent.height() - 130; var tableHeight = $libContent.height() - 130;
function setColumnFilter(oTable){ function setColumnFilter(oTable){
// TODO : remove this dirty hack once js is refactored
if (!oTable.fnSettings()) { return ; }
var aoCols = oTable.fnSettings().aoColumns; var aoCols = oTable.fnSettings().aoColumns;
var colsForAdvancedSearch = new Array(); var colsForAdvancedSearch = new Array();
var advanceSearchDiv = $("div#advanced_search"); var advanceSearchDiv = $("div#advanced_search");
@ -381,11 +381,17 @@ var AIRTIME = (function(AIRTIME) {
label = " (Hz)"; label = " (Hz)";
} }
if (ele.bVisible) { var inputClass = 'filter_column filter_number_text';
advanceSearchDiv.append("<div id='advanced_search_col_"+currentColId+"'><span>"+ele.sTitle+label+"</span> : <span id='"+ele.mDataProp+"'></span></div>"); if (criteriaTypes[ele.mDataProp] != "s") {
} else { inputClass = 'filterColumn filter_number_range';
advanceSearchDiv.append("<div id='advanced_search_col_"+currentColId+"' style='display:none;'><span>"+ele.sTitle+label+"</span> : <span id='"+ele.mDataProp+"'></span></div>");
} }
if (ele.bVisible) {
advanceSearchDiv.append("<div id='advanced_search_col_"+currentColId+" class='control-group'><label class='control-label'>"+ele.sTitle+label+" : </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'>"+ele.sTitle+label+"</label><div id='"+ele.mDataProp+"' class='controls "+inputClass+"'></div></div>");
}
if (criteriaTypes[ele.mDataProp] == "s") { if (criteriaTypes[ele.mDataProp] == "s") {
var obj = { sSelector: "#"+ele.mDataProp } var obj = { sSelector: "#"+ele.mDataProp }
} else { } else {
@ -647,8 +653,20 @@ var AIRTIME = (function(AIRTIME) {
} }
}); });
setColumnFilter(oTable); setColumnFilter(oTable);
oTable.fnSetFilteringDelay(350); oTable.fnSetFilteringDelay(350);
$libContent.on("click", "legend", function(){
var $fs = $(this).parents("fieldset");
if ($fs.hasClass("closed")) {
$fs.removeClass("closed");
}
else {
$fs.addClass("closed");
}
});
$libContent.find(".dataTables_scrolling").css("max-height", tableHeight); $libContent.find(".dataTables_scrolling").css("max-height", tableHeight);

View file

@ -71,6 +71,11 @@ var AIRTIME = (function(AIRTIME){
else { else {
AIRTIME.button.disableButton("btn-group #timeline-select", true); AIRTIME.button.disableButton("btn-group #timeline-select", true);
} }
//need to check if the 'Select' button is disabled
if ($(".btn-group #timeline-select").is(":disabled")) {
$(".btn-group #timeline-select").removeAttr("disabled");
}
}; };
mod.checkTrimButton = function() { mod.checkTrimButton = function() {
@ -330,28 +335,6 @@ var AIRTIME = (function(AIRTIME){
$lib = $("#library_content"), $lib = $("#library_content"),
$sbTable = $sbContent.find('table'); $sbTable = $sbContent.find('table');
/*
* Icon hover states in the toolbar.
*/
$sbContent.on("mouseenter", "#timeline-select .dropdown-toggle", function(ev) {
$el = $(this);
if (!$el.hasClass("ui-state-disabled")) {
$el.addClass("ui-state-hover");
$("#timeline-select .caret").contextMenu(true);
}
else {
$("#timeline-select .caret").contextMenu(false);
}
});
$sbContent.on("mouseleave", ".fg-toolbar ul li", function(ev) {
$el = $(this);
if (!$el.hasClass("ui-state-disabled")) {
$el.removeClass("ui-state-hover");
}
});
oSchedTable = $sbTable.dataTable( { oSchedTable = $sbTable.dataTable( {
"aoColumns": [ "aoColumns": [
/* checkbox */ {"mDataProp": "allowed", "sTitle": "", "sWidth": "15px", "sClass": "sb-checkbox"}, /* checkbox */ {"mDataProp": "allowed", "sTitle": "", "sWidth": "15px", "sClass": "sb-checkbox"},
@ -989,7 +972,7 @@ var AIRTIME = (function(AIRTIME){
$('#timeline-sn').click(function(){mod.selectNone();}); $('#timeline-sn').click(function(){mod.selectNone();});
//cancel current show //cancel current show
$toolbar.find('.icon-ban-circle') $toolbar.find('.icon-ban-circle').parent()
.click(function() { .click(function() {
var $tr, var $tr,
data, data,
@ -1023,7 +1006,7 @@ var AIRTIME = (function(AIRTIME){
}); });
//jump to current //jump to current
$toolbar.find('.icon-step-forward') $toolbar.find('.icon-step-forward').parent()
.click(function() { .click(function() {
if (AIRTIME.button.isDisabled('icon-step-forward') === true) { if (AIRTIME.button.isDisabled('icon-step-forward') === true) {
@ -1040,7 +1023,7 @@ var AIRTIME = (function(AIRTIME){
}); });
//delete overbooked tracks. //delete overbooked tracks.
$toolbar.find('.icon-cut') $toolbar.find('.icon-cut').parent()
.click(function() { .click(function() {
if (AIRTIME.button.isDisabled('icon-cut') === true) { if (AIRTIME.button.isDisabled('icon-cut') === true) {
@ -1060,7 +1043,7 @@ var AIRTIME = (function(AIRTIME){
}); });
//delete selected tracks //delete selected tracks
$toolbar.find('.icon-trash') $toolbar.find('.icon-trash').parent()
.click(function() { .click(function() {
if (AIRTIME.button.isDisabled('icon-trash') === true) { if (AIRTIME.button.isDisabled('icon-trash') === true) {
@ -1090,6 +1073,22 @@ var AIRTIME = (function(AIRTIME){
return false; return false;
}); });
/*
* Icon hover states in the toolbar.
*/
$sbContent.on("mouseenter", ".btn-group #timeline-select", function(ev) {
$el = $(this).parent(),
$ch = $el.children('#timeline-select');
if ($el.hasClass("ui-state-disabled")) {
$ch.attr("disabled", "disabled");
}
else {
$ch.removeAttr("disabled");
}
});
//begin context menu initialization. //begin context menu initialization.
$.contextMenu({ $.contextMenu({
selector: '.sb-content table tbody tr:not(.sb-empty, .sb-footer, .sb-header, .sb-record) td:not(.sb-checkbox, .sb-image)', selector: '.sb-content table tbody tr:not(.sb-empty, .sb-footer, .sb-header, .sb-record) td:not(.sb-checkbox, .sb-image)',