CC-3174 : showbuilder

making the library toggle in when pressing the edit button
This commit is contained in:
Naomi Aro 2012-03-02 15:28:04 +01:00
parent 9e1b3e7e6e
commit b358c90cfb
5 changed files with 64 additions and 29 deletions

View File

@ -20,8 +20,7 @@
</div>
<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="tabs ui-widget ui-widget-content block-shadow alpha-block padded" style="z-index:254"><?php echo $this->layout()->library ?></div>
<div id="library_content" class="tabs ui-widget ui-widget-content block-shadow alpha-block padded" style="display:none"><?php echo $this->layout()->library ?></div>
<div id="show_builder" class="ui-widget ui-widget-content block-shadow omega-block padded"><?php echo $this->layout()->builder ?></div>
</div>
</body>

View File

@ -4,6 +4,7 @@
<?php echo $this->element->getElement('sb_date_end') ?>
<?php echo $this->element->getElement('sb_time_end') ?>
<input type="button" id="sb_submit" class="ui-button ui-state-default" value="GO"></input>
<input type="button" id="sb_edit" class="ui-button ui-state-default sb-edit" value="Edit"></input>
</div>
<div class="sb-advanced-options">
<label><?php echo $this->element->getElement('sb_show_filter')->getLabel() ?></label>

View File

@ -1,7 +1,11 @@
@CHARSET "UTF-8";
#show_builder {
width:45%;
width:95%;
}
#show_builder_table th {
text-align: left;
}
#show_builder input.input_text {

View File

@ -267,27 +267,32 @@ var AIRTIME = (function(AIRTIME){
"fnDrawCallback": function(oSettings, json) {
var wrapperDiv,
markerDiv,
td;
td,
$lib = $("#library_content");
//create cursor arrows.
tableDiv.find("tr.sb-now-playing, tr:not(:first, .sb-footer, .sb-empty, .sb-not-allowed)").each(function(i, el) {
td = $(el).find("td:first");
if (td.hasClass("dataTables_empty")) {
return false;
}
wrapperDiv = $("<div />", {
"class": "innerWrapper",
"css": {
"height": td.height()
}
});
markerDiv = $("<div />", {
"class": "marker"
});
td.append(markerDiv).wrapInner(wrapperDiv);
});
//only create the cursor arrows if the library is on the page.
if ($lib.length > 0 && $lib.filter(":visible").length > 0) {
//create cursor arrows.
tableDiv.find("tr.sb-now-playing, tr:not(:first, .sb-footer, .sb-empty, .sb-not-allowed)").each(function(i, el) {
td = $(el).find("td:first");
if (td.hasClass("dataTables_empty")) {
return false;
}
wrapperDiv = $("<div />", {
"class": "innerWrapper",
"css": {
"height": td.height()
}
});
markerDiv = $("<div />", {
"class": "marker"
});
td.append(markerDiv).wrapInner(wrapperDiv);
});
}
},
"fnHeaderCallback": function(nHead) {
$(nHead).find("input[type=checkbox]").attr("checked", false);

View File

@ -6,12 +6,8 @@ $(document).ready(function(){
oBaseDatePickerSettings = {
dateFormat: 'yy-mm-dd',
onSelect: function(sDate, oDatePicker) {
var oDate,
dInput;
dInput = $(this);
oDate = dInput.datepicker( "setDate", sDate );
onSelect: function(sDate, oDatePicker) {
$(this).datepicker( "setDate", sDate );
}
};
@ -120,6 +116,36 @@ $(document).ready(function(){
oTable.fnDraw();
});
$("#sb_edit").click(function(ev){
var $button = $(this),
$lib = $("#library_content"),
$builder = $("#show_builder"),
oTable = $("#show_builder_table").dataTable();
if ($button.hasClass("sb-edit")) {
$lib.show();
$lib.width("45%");
$builder.width("50%");
$button.removeClass("sb-edit");
$button.addClass("sb-finish-edit");
$button.val("Close");
}
else if($button.hasClass("sb-finish-edit")) {
$lib.hide();
$builder.width("95%");
$button.removeClass("sb-finish-edit");
$button.addClass("sb-edit");
$button.val("Edit");
}
oTable.fnDraw();
});
oRange = fnGetScheduleRange();
AIRTIME.showbuilder.fnServerData.start = oRange.start;
AIRTIME.showbuilder.fnServerData.end = oRange.end;