CC-6097, CC-6091, CC-6080, CC-6066 - css fixes and more work on add/remove content screen

This commit is contained in:
Duncan Sommerville 2015-08-25 17:09:05 -04:00
parent 371a26ff97
commit 84baef1996
17 changed files with 169 additions and 318 deletions

View file

@ -361,7 +361,7 @@ var AIRTIME = (function(AIRTIME) {
*/
mod.deselectCurrentPage = function() {
var $trs = $libTable.find("tr");
mod.selectAll($trs);
mod.deselectAll($trs);
};
mod.selectNone = function() {
@ -599,7 +599,7 @@ var AIRTIME = (function(AIRTIME) {
/* Upload Time */ { "sTitle" : $.i18n._("Uploaded") , "mDataProp" : "utime" , "bVisible" : false , "sClass" : "library_upload_time" , "sWidth" : "155px" },
/* Website */ { "sTitle" : $.i18n._("Website") , "mDataProp" : "info_url" , "bVisible" : false , "sClass" : "library_url" , "sWidth" : "150px" },
/* Year */ { "sTitle" : $.i18n._("Year") , "mDataProp" : "year" , "bVisible" : false , "sClass" : "library_year" , "sWidth" : "60px" },
/* Context Menu */ { "sTitle" : "" , "mData" : null , "bSortable" : false , "sClass" : "library_actions" , "bSearchable" : false , "sWidth" : "16px" }
/* Context Menu */ { "sTitle" : "" , "mDataProp" : "options" , "bSortable" : false , "bSearchable" : false , "sWidth" : "16px", "sClass" : "library_actions" }
],
"bProcessing": true,
@ -678,6 +678,7 @@ var AIRTIME = (function(AIRTIME) {
*/
var advSearchFields = $("div#advanced_search").children(':visible');
var advSearchValid = validateAdvancedSearch(advSearchFields);
advSearchFields.val("TEST");
var type;
aoData.push( { name: "format", value: "json"} );
aoData.push( { name: "advSearch", value: advSearchValid} );

View file

@ -121,10 +121,15 @@ function findViewportDimensions() {
}
function highlightMediaTypeSelector(dialog) {
var selected;
if (location.hash === "") {
dialog.find("a[href$='#files']").parent().addClass("selected");
selected = dialog.find("a[href$='#tracks']");
} else {
selected = dialog.find("a[href$='"+location.hash+"']")
}
dialog.find("a[href$='"+location.hash+"']").parent().addClass("selected");
selected.parent().addClass("selected");
$("#library_filter").text(selected.text());
// Slightly hacky way of triggering the click event when it's outside of the anchor text
dialog.find(".media_type_selector").on("click", function() {
@ -133,11 +138,13 @@ function highlightMediaTypeSelector(dialog) {
});
$(window).on('hashchange', function() {
var selected = dialog.find("a[href$='"+location.hash+"']");
AIRTIME.library.selectNone();
dialog.find(".media_type_selector").each(function () {
$(this).removeClass("selected");
});
dialog.find("a[href$='"+location.hash+"']").parent().addClass("selected");
$("#library_filter").text(selected.text());
selected.parent().addClass("selected");
oTable.fnDraw();
});
}

View file

@ -198,7 +198,6 @@ var AIRTIME = (function(AIRTIME){
};
mod.checkToolBarIcons = function() {
//library may not be on the page.
if (AIRTIME.library !== undefined) {
AIRTIME.library.checkAddButton();
@ -332,7 +331,6 @@ var AIRTIME = (function(AIRTIME){
};
mod.fnMove = function(aSelect, aAfter) {
mod.disableUI();
$.post(baseUrl+"showbuilder/schedule-move",
@ -757,6 +755,7 @@ var AIRTIME = (function(AIRTIME){
tr.addClass(SB_SELECTED_CLASS);
tr.find("input[type='checkbox']").prop("checked", true);
});
mod.checkToolBarIcons();
}
},
@ -874,11 +873,12 @@ var AIRTIME = (function(AIRTIME){
$previouslySelected = undefined;
tr.removeClass(SB_SELECTED_CLASS);
tr.find(".sb-checkbox > input").prop('checked', false);
mod.checkToolBarIcons();
} else {
tr.addClass(SB_SELECTED_CLASS);
tr.find(".sb-checkbox > input").prop('checked', true);
mod.checkToolBarIcons();
}
mod.checkToolBarIcons();
selectedRows = $("." + SB_SELECTED_CLASS);
});
@ -889,14 +889,14 @@ var AIRTIME = (function(AIRTIME){
$previouslySelected = undefined;
tr.removeClass(SB_SELECTED_CLASS);
tr.find(".sb-checkbox > input").prop('checked', false);
mod.checkToolBarIcons();
} else if (!(e.shiftKey || e.ctrlKey)) {
mod.selectNone();
tr.addClass(SB_SELECTED_CLASS);
tr.find(".sb-checkbox > input").prop('checked', true);
$previouslySelected = tr;
mod.checkToolBarIcons();
}
mod.checkToolBarIcons();
selectedRows = $("." + SB_SELECTED_CLASS);
});

View file

@ -118,10 +118,16 @@ AIRTIME = (function(AIRTIME) {
function highlightMediaTypeSelector()
{
$(".media_type_selector:first").addClass("highlight");
var selected;
if (location.hash === "") {
$("a[href$='#files']").parent().addClass("selected");
selected = $("a[href$='#tracks']");
} else {
selected = $("a[href$='"+location.hash+"']");
}
$("a[href$='"+location.hash+"']").parent().addClass("selected");
selected.parent().addClass("selected");
$("#library_filter").text(selected.text());
// Slightly hacky way of triggering the click event when it's outside of the anchor text
$(".media_type_selector").on("click", function() {
@ -130,7 +136,7 @@ AIRTIME = (function(AIRTIME) {
});
$(window).on('hashchange', function() {
var selected = $("a[href$='"+location.hash+"']");
// If we click Dashboard from one of the media views, do nothing
if (!location.hash) {
return;
@ -139,8 +145,11 @@ AIRTIME = (function(AIRTIME) {
$(".media_type_selector").each(function () {
$(this).removeClass("selected");
});
$("a[href$='"+location.hash+"']").parent().addClass("selected");
selected.parent().addClass("selected");
oTable.fnDraw();
$("#library_filter").text(selected.text());
// Highlight the dashboard link
$(".media_type_selector:first").addClass("highlight");
});
}