Merge branch 'CC-3174' into devel

Conflicts:
	airtime_mvc/public/js/airtime/library/library.js
This commit is contained in:
Naomi Aro 2012-03-06 13:51:37 +01:00
commit 157078b963
12 changed files with 150 additions and 30 deletions

View File

@ -29,9 +29,15 @@ class LibraryController extends Zend_Controller_Action
public function indexAction() {
global $CC_CONFIG;
$this->_helper->layout->setLayout('library');
$request = $this->getRequest();
$baseUrl = $request->getBaseUrl();
$this->view->headScript()->appendFile($this->view->baseUrl('/js/airtime/library/events/library_playlistbuilder.js'),'text/javascript');
$this->view->headScript()->appendFile($baseUrl.'/js/airtime/library/main_library.js?'.$CC_CONFIG['airtime_version'],'text/javascript');
$this->_helper->actionStack('library', 'library');
$this->_helper->actionStack('index', 'playlist');
@ -56,8 +62,8 @@ class LibraryController extends Zend_Controller_Action
$this->view->headScript()->appendFile($baseUrl.'/js/datatables/plugin/dataTables.TableTools.js?'.$CC_CONFIG['airtime_version'],'text/javascript');
$this->view->headScript()->appendFile($baseUrl.'/js/airtime/buttons/buttons.js?'.$CC_CONFIG['airtime_version'],'text/javascript');
$this->view->headScript()->appendFile($baseUrl.'/js/airtime/utilities/utilities.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/main_library.js?'.$CC_CONFIG['airtime_version'],'text/javascript');
$this->view->headLink()->appendStylesheet($baseUrl.'/css/media_library.css?'.$CC_CONFIG['airtime_version']);
$this->view->headLink()->appendStylesheet($baseUrl.'/css/jquery.contextMenu.css?'.$CC_CONFIG['airtime_version']);

View File

@ -23,7 +23,7 @@
<div class="wrapper">
<!--Set to z-index 254 to make it lower than the top-panel and the ZFDebug info bar, but higher than the side-playlist-->
<div id="library_content" class="ui-widget ui-widget-content block-shadow alpha-block padded" style="z-index:254"><?php echo $this->layout()->library ?></div>
<div id="side_playlist" class="ui-widget ui-widget-content block-shadow omega-block"><?php echo $this->layout()->spl ?></div>
<div id="side_playlist" class="ui-widget ui-widget-content block-shadow omega-block padded"><?php echo $this->layout()->spl ?></div>
</div>
</body>
</html>

View File

@ -19,6 +19,7 @@ class TimeFilledFormatter {
{
$formatted = "";
$sign = ($this->_seconds < 0) ? "-" : "+";
$perfect = true;
$time = Application_Model_Playlist::secondsToPlaylistTime(abs($this->_seconds));
Logging::log("time is: ".$time);
@ -29,16 +30,24 @@ class TimeFilledFormatter {
if (intval($info[0]) > 0) {
$info[0] = ltrim($info[0], "0");
$formatted .= " {$info[0]}h";
$perfect = false;
}
if (intval($info[1]) > 0) {
$info[1] = ltrim($info[1], "0");
$formatted .= " {$info[1]}m";
$perfect = false;
}
if (intval($info[2]) > 0) {
$sec = round($info[2], 0);
$formatted .= " {$sec}s";
$perfect = false;
}
//0 over/under lap of content.
if ($perfect === true) {
$formatted = "+ 0s";
}
return $formatted;

View File

@ -1,7 +1,7 @@
#library_content {
float: left;
width: 50%;
min-height: 475px;
overflow: auto;
}
#library_display {
@ -10,7 +10,7 @@
}
#library_display th {
text-align: left;
text-align: left;
}
#library_content #library_display {
@ -80,7 +80,9 @@
text-align: center;
}
.library_sr,
.library_bitrate {
text-align: right;
}
td.library_track,
td.library_sr,
td.library_bitrate {
text-align: right;
padding-right: 1em !important;
}

View File

@ -1,9 +1,7 @@
#side_playlist {
width: 40%;
min-height: 475px;
padding: 8px;
padding-bottom: 0px;
font-size: 16px;
overflow: auto;
}
#side_playlist,

View File

@ -2,6 +2,7 @@
#show_builder {
width:95%;
overflow: auto;
}
#show_builder_table th {
@ -47,10 +48,22 @@ tr.cursor-selected-row .marker {
.ui-dialog .wrapper {
margin: 0;
padding: 10px 0 0 0;
overflow: hidden;
}
.ui-dialog #library_content {
margin: 0 10px 10px 0;
overflow: auto;
min-height: 0;
}
.ui-dialog #show_builder {
width:45%;
margin: 0 0 10px 0;
overflow: auto;
}
.ui-dialog .padded {
padding: 5px 10px 5px 8px;
}
.ui-dialog .ui-buttonset {

View File

@ -9,7 +9,7 @@ body {
padding: 0;
}
html, body {
height: 100%;
height: 100%;
}
#login-page {
@ -366,7 +366,7 @@ select {
.wrapper {
margin: 0 20px 0 20px;
padding:20px 0 0 0;
padding:10px 0 0 0;
}
.alpha-block {
@ -577,7 +577,7 @@ dl.inline-list dd {
line-height:22px;
}
.dataTables_filter {
margin:8px 0 0 8px;
margin:0 0 0 8px;
}
.dataTables_filter .auto-search {
width:55%;
@ -623,7 +623,7 @@ dl.inline-list dd {
width: 55%;
border: 1px solid #5B5B5B;
margin-left: -8px;
padding: 4px 3px 4px 25px;
padding: 5px 3px 4px 25px;
}
.dataTables_length select {
background-color: #DDDDDD;

View File

@ -1,4 +1,4 @@
var AIRTIME = (function(AIRTIME){
var AIRTIME = (function(AIRTIME) {
var mod,
libraryInit;
@ -58,7 +58,7 @@ var AIRTIME = (function(AIRTIME){
/* Length */ {"sTitle": "Length", "mDataProp": "length", "sClass": "library_length", "sWidth": "80px"},
/* Upload Time */ {"sTitle": "Uploaded", "mDataProp": "utime", "sClass": "library_upload_time"},
/* Last Modified */ {"sTitle": "Last Modified", "mDataProp": "mtime", "bVisible": false, "sClass": "library_modified_time"},
/* Track Number */ {"sTitle": "Track", "mDataProp": "track_number", "bSearchable": false, "bVisible": false, "sClass": "library_track"},
/* Track Number */ {"sTitle": "Track", "mDataProp": "track_number", "bSearchable": false, "bVisible": false, "sClass": "library_track", "sWidth": "65px"},
/* Mood */ {"sTitle": "Mood", "mDataProp": "mood", "bSearchable": false, "bVisible": false, "sClass": "library_mood"},
/* BPM */ {"sTitle": "BPM", "mDataProp": "bpm", "bSearchable": false, "bVisible": false, "sClass": "library_bpm"},
/* Composer */ {"sTitle": "Composer", "mDataProp": "composer", "bSearchable": false, "bVisible": false, "sClass": "library_composer"},

View File

@ -1 +1,16 @@
$(document).ready(AIRTIME.library.libraryInit);
$(document).ready(function() {
var viewport = AIRTIME.utilities.findViewportDimensions(),
lib = $("#library_content"),
pl = $("#side_playlist"),
widgetHeight = viewport.height - 185,
width = Math.floor(viewport.width - 110);
lib.height(widgetHeight)
.width(Math.floor(width * 0.55));
pl.height(widgetHeight)
.width(Math.floor(width * 0.45));
AIRTIME.library.libraryInit();
});

View File

@ -100,15 +100,32 @@ function buildScheduleDialog (json) {
var dialog = $(json.dialog),
viewport = findViewportDimensions(),
height = viewport.height * 0.96,
width = viewport.width * 0.96,
fnServer = AIRTIME.showbuilder.fnServerData;
height = Math.floor(viewport.height * 0.96),
width = Math.floor(viewport.width * 0.96),
fnServer = AIRTIME.showbuilder.fnServerData,
//subtract padding in pixels
widgetWidth = width - 50,
libWidth = Math.floor(widgetWidth * 0.5),
builderWidth = Math.floor(widgetWidth * 0.5),
libLength,
libType,
libFilter;
dialog.find("#library_content")
.height(height - 110)
.width(libWidth);
dialog.find("#show_builder")
.height(height - 110)
.width(builderWidth);
dialog.dialog({
autoOpen: false,
title: json.title,
width: width,
height: height,
resizable: false,
draggable: false,
modal: true,
close: closeDialog,
buttons: {"Ok": function() {
@ -116,7 +133,7 @@ function buildScheduleDialog (json) {
$("#schedule_calendar").fullCalendar( 'refetchEvents' );
}}
});
//set the start end times so the builder datatables knows its time range.
fnServer.start = json.start;
fnServer.end = json.end;
@ -125,6 +142,13 @@ function buildScheduleDialog (json) {
AIRTIME.showbuilder.builderDataTable();
dialog.dialog('open');
//calculate dynamically width fo the library search input.
libLength = dialog.find("#library_display_length");
libType = dialog.find("#library_display_type");
libFilter = dialog.find("#library_display_filter");
libFilter.find("input").width(libFilter.width() - libType.width() - libLength.width() - 80);
}
function buildContentDialog (json){

View File

@ -1,9 +1,21 @@
$(document).ready(function(){
var oBaseDatePickerSettings,
var viewport = AIRTIME.utilities.findViewportDimensions(),
lib = $("#library_content"),
builder = $("#show_builder"),
widgetHeight = viewport.height - 185,
screenWidth = Math.floor(viewport.width - 110),
oBaseDatePickerSettings,
oBaseTimePickerSettings,
oRange;
//set the heights of the main widgets.
lib.height(widgetHeight);
//builder takes all the screen on first load
builder.height(widgetHeight)
.width(screenWidth);
oBaseDatePickerSettings = {
dateFormat: 'yy-mm-dd',
onSelect: function(sDate, oDatePicker) {
@ -125,17 +137,17 @@ $(document).ready(function(){
if ($button.hasClass("sb-edit")) {
$lib.show();
$lib.width("45%");
$builder.width("50%");
$lib.width(Math.floor(screenWidth * 0.5));
$builder.width(Math.floor(screenWidth * 0.5));
$button.removeClass("sb-edit");
$button.addClass("sb-finish-edit");
$button.val("Close Library");
}
else if($button.hasClass("sb-finish-edit")) {
else if ($button.hasClass("sb-finish-edit")) {
$lib.hide();
$builder.width("95%");
$builder.width(screenWidth);
$button.removeClass("sb-finish-edit");
$button.addClass("sb-edit");
@ -149,7 +161,8 @@ $(document).ready(function(){
oRange = fnGetScheduleRange();
AIRTIME.showbuilder.fnServerData.start = oRange.start;
AIRTIME.showbuilder.fnServerData.end = oRange.end;
AIRTIME.library.libraryInit();
AIRTIME.showbuilder.builderDataTable();
setInterval(function(){

View File

@ -0,0 +1,40 @@
var AIRTIME = (function(AIRTIME){
var mod;
if (AIRTIME.utilities === undefined) {
AIRTIME.utilities = {};
}
mod = AIRTIME.utilities;
mod.findViewportDimensions = function() {
var viewportwidth,
viewportheight;
// the more standards compliant browsers (mozilla/netscape/opera/IE7) use
// window.innerWidth and window.innerHeight
if (typeof window.innerWidth != 'undefined') {
viewportwidth = window.innerWidth, viewportheight = window.innerHeight;
}
// IE6 in standards compliant mode (i.e. with a valid doctype as the first
// line in the document)
else if (typeof document.documentElement != 'undefined'
&& typeof document.documentElement.clientWidth != 'undefined'
&& document.documentElement.clientWidth != 0) {
viewportwidth = document.documentElement.clientWidth;
viewportheight = document.documentElement.clientHeight;
}
// older versions of IE
else {
viewportwidth = document.getElementsByTagName('body')[0].clientWidth;
viewportheight = document.getElementsByTagName('body')[0].clientHeight;
}
return {
width: viewportwidth,
height: viewportheight
};
};
return AIRTIME;
}(AIRTIME || {}));