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>
<div class="wrapper"> <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="display:none"><?php echo $this->layout()->library ?></div>
<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="show_builder" class="ui-widget ui-widget-content block-shadow omega-block padded"><?php echo $this->layout()->builder ?></div> <div id="show_builder" class="ui-widget ui-widget-content block-shadow omega-block padded"><?php echo $this->layout()->builder ?></div>
</div> </div>
</body> </body>

View File

@ -4,6 +4,7 @@
<?php echo $this->element->getElement('sb_date_end') ?> <?php echo $this->element->getElement('sb_date_end') ?>
<?php echo $this->element->getElement('sb_time_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_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>
<div class="sb-advanced-options"> <div class="sb-advanced-options">
<label><?php echo $this->element->getElement('sb_show_filter')->getLabel() ?></label> <label><?php echo $this->element->getElement('sb_show_filter')->getLabel() ?></label>

View File

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

View File

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

View File

@ -7,11 +7,7 @@ $(document).ready(function(){
oBaseDatePickerSettings = { oBaseDatePickerSettings = {
dateFormat: 'yy-mm-dd', dateFormat: 'yy-mm-dd',
onSelect: function(sDate, oDatePicker) { onSelect: function(sDate, oDatePicker) {
var oDate, $(this).datepicker( "setDate", sDate );
dInput;
dInput = $(this);
oDate = dInput.datepicker( "setDate", sDate );
} }
}; };
@ -120,6 +116,36 @@ $(document).ready(function(){
oTable.fnDraw(); 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(); oRange = fnGetScheduleRange();
AIRTIME.showbuilder.fnServerData.start = oRange.start; AIRTIME.showbuilder.fnServerData.start = oRange.start;
AIRTIME.showbuilder.fnServerData.end = oRange.end; AIRTIME.showbuilder.fnServerData.end = oRange.end;