* Fix error in automatic podcast ingest
* Switch from text-scrolling to using title attributes to display overflowing text strings
This commit is contained in:
parent
14104a93ae
commit
be3a3fbd9f
|
@ -31,14 +31,14 @@ class PodcastManager {
|
|||
$episodes = array();
|
||||
foreach ($autoIngestPodcasts as $podcast) {
|
||||
/** @var ImportedPodcast $podcast */
|
||||
$podcastArray = Application_Service_PodcastService::getPodcastById($podcast->getDbId());
|
||||
$podcastArray = Application_Service_PodcastService::getPodcastById($podcast->getDbPodcastId());
|
||||
// A bit hacky... sort the episodes by publication date to get the most recent
|
||||
usort($podcastArray["episodes"], array(static::class, "_sortByEpisodePubDate"));
|
||||
$episodeData = $podcastArray["episodes"][0];
|
||||
$episode = PodcastEpisodesQuery::create()->findOneByDbEpisodeGuid($episodeData["guid"]);
|
||||
// Make sure there's no existing episode placeholder or import, and that the data is non-empty
|
||||
if (empty($episode) && !empty($episodeData)) {
|
||||
$placeholder = $service->addPodcastEpisodePlaceholder($podcast->getDbId(), $episodeData);
|
||||
$placeholder = $service->addPodcastEpisodePlaceholder($podcast->getDbPodcastId(), $episodeData);
|
||||
array_push($episodes, $placeholder);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -304,9 +304,27 @@ function getUsabilityHint() {
|
|||
});
|
||||
}
|
||||
|
||||
// Set up text scrolling for all tags matching selector within the calling element(s)
|
||||
jQuery.fn.textScroll = function(selector) {
|
||||
/**
|
||||
* Add title attributes (whose values are their inner text) to all elements in the calling parent matching selector
|
||||
*
|
||||
* @param selector jQuery selector to search descendants
|
||||
* @returns {jQuery}
|
||||
*/
|
||||
jQuery.fn.addTitles = function(selector) {
|
||||
this.each(function() {
|
||||
// Put this in a mouseenter event handler so it's dynamic
|
||||
// (newly created elements will have the title applied on hover)
|
||||
$(this).on("mouseenter", selector, function () {
|
||||
$(this).attr("title", $(this).text());
|
||||
});
|
||||
});
|
||||
|
||||
return this; // jQuery chaining
|
||||
};
|
||||
|
||||
// XXX: Old code to pan selector text; keeping this around in case we want to use it later - Duncan
|
||||
jQuery.fn.scrollText = function(selector) {
|
||||
this.each(function () {
|
||||
$(this).on("mouseenter", selector, function () {
|
||||
var sw = $(this)[0].scrollWidth - parseFloat($(this).css("textIndent")), iw = $(this).innerWidth();
|
||||
if (sw > iw) {
|
||||
|
@ -322,5 +340,5 @@ jQuery.fn.textScroll = function(selector) {
|
|||
});
|
||||
});
|
||||
|
||||
return this; // jQuery chaining
|
||||
return this;
|
||||
};
|
||||
|
|
|
@ -162,7 +162,7 @@ $(document).ready(function () {
|
|||
});
|
||||
};
|
||||
|
||||
$("#recent_uploads").textScroll("td");
|
||||
$("#recent_uploads").addTitles("td");
|
||||
|
||||
self.isRecentUploadsRefreshTimerActive = false;
|
||||
|
||||
|
|
|
@ -18,7 +18,6 @@ var AIRTIME = (function (AIRTIME) {
|
|||
//when you're creating a new podcast, we already have the object from the result of the POST. We're saving
|
||||
//a roundtrip by not fetching it again here.
|
||||
$scope.podcast = podcast;
|
||||
console.log(podcast);
|
||||
tab.setName($scope.podcast.title);
|
||||
|
||||
$scope.savePodcast = function() {
|
||||
|
@ -168,7 +167,7 @@ var AIRTIME = (function (AIRTIME) {
|
|||
}
|
||||
});
|
||||
|
||||
podcastEpisodesTableWidget.getDatatable().textScroll("td");
|
||||
podcastEpisodesTableWidget.getDatatable().addTitles("td");
|
||||
return podcastEpisodesTableWidget;
|
||||
};
|
||||
|
||||
|
|
|
@ -339,7 +339,7 @@ var AIRTIME = (function(AIRTIME){
|
|||
|
||||
$(document).ready(function() {
|
||||
// Add text scrolling to tab names
|
||||
$("#show_builder").textScroll(".tab-name");
|
||||
$("#show_builder").addTitles(".tab-name");
|
||||
// Initialize the ScheduleTab
|
||||
AIRTIME.tabs.initScheduleTab();
|
||||
});
|
||||
|
|
Loading…
Reference in New Issue