diff --git a/airtime_mvc/public/js/airtime/library/library.js b/airtime_mvc/public/js/airtime/library/library.js index 75aaf124c..52a4e402f 100644 --- a/airtime_mvc/public/js/airtime/library/library.js +++ b/airtime_mvc/public/js/airtime/library/library.js @@ -55,7 +55,7 @@ var AIRTIME = (function(AIRTIME) { "info_url" : "s", "replay_gain" : "n", "artwork" : "s", - "track_type" : "s" + "track_type" : "tt" }; if (AIRTIME.library === undefined) { @@ -592,7 +592,7 @@ var AIRTIME = (function(AIRTIME) { /* Cue Out */ { "sTitle" : $.i18n._("Cue Out") , "mDataProp" : "cueout" , "bVisible" : false , "sClass" : "library_length" , "sWidth" : "80px" }, /* Description */ { "sTitle" : $.i18n._("Description") , "mDataProp" : "description" , "bVisible" : false , "sClass" : "library_description" , "sWidth" : "150px" }, /* Encoded */ { "sTitle" : $.i18n._("Encoded By") , "mDataProp" : "encoded_by" , "bVisible" : false , "sClass" : "library_encoded" , "sWidth" : "150px" }, - /* Track Type */ { "sTitle" : $.i18n._("Type") , "mDataProp" : "track_type" , "bVisible" : false , "sClass" : "library_track_type" , "sWidth" : "60px" }, + /* Track Type */ { "sTitle" : $.i18n._("Type") , "mDataProp" : "track_type" , "sClass" : "library_track_type" , "sWidth" : "60px" }, /* Genre */ { "sTitle" : $.i18n._("Genre") , "mDataProp" : "genre" , "sClass" : "library_genre" , "sWidth" : "100px" }, /* ISRC Number */ { "sTitle" : $.i18n._("ISRC") , "mDataProp" : "isrc_number" , "bVisible" : false , "sClass" : "library_isrc" , "sWidth" : "150px" }, /* Label */ { "sTitle" : $.i18n._("Label") , "mDataProp" : "label" , "bVisible" : false , "sClass" : "library_label" , "sWidth" : "125px" }, @@ -854,9 +854,12 @@ var AIRTIME = (function(AIRTIME) { var inputClass = 'filter_column filter_number_text'; var labelStyle = "style='margin-right:35px;'"; - if (libraryColumnTypes[ele.mDataProp] != "s") { + if (libraryColumnTypes[ele.mDataProp] == "n" || libraryColumnTypes[ele.mDataProp] == "i") { inputClass = 'filterColumn filter_number_range'; labelStyle = ""; + } else if (libraryColumnTypes[ele.mDataProp] == "tt") { + inputClass = 'filterColumn filter_track_type_select'; + labelStyle = ""; } if (ele.bVisible) { @@ -875,6 +878,8 @@ var AIRTIME = (function(AIRTIME) { if (libraryColumnTypes[ele.mDataProp] == "s") { var obj = { sSelector: "#"+ele.mDataProp } + } else if (libraryColumnTypes[ele.mDataProp] == "tt") { + var obj = { sSelector: "#"+ele.mDataProp, type: "select" } } else { var obj = { sSelector: "#"+ele.mDataProp, type: "number-range" } } @@ -1603,8 +1608,29 @@ var validationTypes = { "year" : "i" }; +function airtimeScheduleJsonpError(jqXHR, textStatus, errorThrown){ +} + +function tracktypesJson() { + $(function() { + jQuery.getJSON( + baseUrl + "api/track-types", + function(json){ + var ttSelect = $('#track_type .filter_select .select_filter'); + $.each(json, function(key, value) { + var option = $("