diff --git a/airtime_mvc/application/controllers/PreferenceController.php b/airtime_mvc/application/controllers/PreferenceController.php index 812ece169..02e3c406b 100644 --- a/airtime_mvc/application/controllers/PreferenceController.php +++ b/airtime_mvc/application/controllers/PreferenceController.php @@ -55,8 +55,16 @@ class PreferenceController extends Zend_Controller_Action // Refresh the download key when enabling privacy Application_Model_Preference::setStationPodcastDownloadKey(); } + + // Append sharing token (download key) to Station podcast URL + $stationPodcast = PodcastQuery::create()->findOneByDbId(Application_Model_Preference::getStationPodcastId()); + $key = Application_Model_Preference::getStationPodcastDownloadKey(); + $url = Application_Common_HTTPHelper::getStationUrl() . + (((int) $values["stationPodcastPrivacy"]) ? "feeds/station-rss?sharing_token=$key" : "feeds/station-rss"); + $stationPodcast->setDbUrl($url)->save(); Application_Model_Preference::setStationPodcastPrivacy($values["stationPodcastPrivacy"]); + $logoUploadElement = $form->getSubForm('preferences_general')->getElement('stationLogo'); $logoUploadElement->receive(); $imagePath = $logoUploadElement->getFileName(); diff --git a/airtime_mvc/application/forms/PodcastPreferences.php b/airtime_mvc/application/forms/PodcastPreferences.php index 8c6bc0075..5b2060e2f 100644 --- a/airtime_mvc/application/forms/PodcastPreferences.php +++ b/airtime_mvc/application/forms/PodcastPreferences.php @@ -17,8 +17,8 @@ class Application_Form_PodcastPreferences extends Zend_Form_SubForm { $stationPodcastPrivacy->setValue($isPrivate); $this->addElement($stationPodcastPrivacy); - $key = Application_Model_Preference::getStationPodcastDownloadKey(); - $url = Application_Common_HTTPHelper::getStationUrl()."feeds/station-rss".($isPrivate ? "?sharing_token=$key" : ""); + $stationPodcast = PodcastQuery::create()->findOneByDbId(Application_Model_Preference::getStationPodcastId()); + $url = $stationPodcast->getDbUrl(); $feedUrl = new Zend_Form_Element_Text("stationPodcastFeedUrl:"); $feedUrl->setAttrib('class', 'input_text') ->setAttrib('disabled', 'disabled') diff --git a/airtime_mvc/public/css/playlist_builder.css b/airtime_mvc/public/css/playlist_builder.css index 85e1c1ec8..41a5304a1 100644 --- a/airtime_mvc/public/css/playlist_builder.css +++ b/airtime_mvc/public/css/playlist_builder.css @@ -14,7 +14,6 @@ } .edit-md-dialog dd input.input_text { - /*width: auto;*/ width: 100%; } @@ -46,8 +45,9 @@ .playlist_editor input, .playlist_editor textarea { width: 200px; height: 70px; - box-sizing: border-box; -} + -webkit-box-sizing: border-box; + -moz-box-sizing: border-box; + box-sizing: border-box;} .side_playlist textarea { /*height: 70px;*/ diff --git a/airtime_mvc/public/css/styles.css b/airtime_mvc/public/css/styles.css index ae29e39ce..5f05da839 100644 --- a/airtime_mvc/public/css/styles.css +++ b/airtime_mvc/public/css/styles.css @@ -1180,8 +1180,11 @@ input[type="checkbox"] { width: 100%; } #pref_form textarea { - width: 98.5%; + width: 100%; padding-left: 5px; + -webkit-box-sizing: border-box; + -moz-box-sizing: border-box; + box-sizing: border-box; } #pref_form select { width: 100%; @@ -1703,12 +1706,13 @@ h2#scheduled_playlist_name span { } .simple-formblock dd .input_text { - /*width: 97.8%;*/ width: 100%; + -webkit-box-sizing: border-box; + -moz-box-sizing: border-box; + box-sizing: border-box; } .simple-formblock dd textarea { - box-sizing: border-box; height: 70px; } diff --git a/airtime_mvc/public/js/airtime/library/podcast.js b/airtime_mvc/public/js/airtime/library/podcast.js index 7a0b00595..3da968a7b 100644 --- a/airtime_mvc/public/js/airtime/library/podcast.js +++ b/airtime_mvc/public/js/airtime/library/podcast.js @@ -12,10 +12,12 @@ var AIRTIME = (function (AIRTIME) { /** * PodcastController constructor. * - * @param {{}} $scope angular scope service object - * @param {{}} $http angular http service object - * @param {{}} podcast podcast metadata object - * @param {Tab} tab Tab object the controller is being bootstrapped in + * @param {Object} $scope angular scope service object + * @param {Object} $http angular http service object + * @param {Object} podcast podcast metadata object + * @param {int} podcast.id podcast unique identifier + * @param {string} podcast.title podcast metadata title + * @param {Tab} tab Tab object the controller is being bootstrapped in * * @constructor */ @@ -57,7 +59,6 @@ var AIRTIME = (function (AIRTIME) { self._updatePodcast = function () { $http.put(endpoint + $scope.podcast.id, {csrf_token: $scope.csrf, podcast: $scope.podcast}) .success(function () { - // episodeTable.reload($scope.podcast.id); self.episodeTable.getDatatable().fnDraw(); AIRTIME.library.podcastDataTable.fnDraw(); tab.setName($scope.podcast.title); @@ -440,10 +441,10 @@ var AIRTIME = (function (AIRTIME) { * * Selection for the internal table represents episodes marked for ingest and is disabled for ingested episodes. * - * @param podcast the podcast data JSON object. - * @param tab Tab object the podcast will be opened in - * @param params JSON object containing datatables parameters to override - * @param buttons JSON object containing datatables button parameters + * @param {Object} podcast the podcast data JSON object. + * @param {Tab} tab Tab object the podcast will be opened in + * @param {Object} params JSON object containing datatables parameters to override + * @param {Object} buttons JSON object containing datatables button parameters * * @returns {*} the created Table object */ diff --git a/airtime_mvc/public/js/airtime/showbuilder/tabs.js b/airtime_mvc/public/js/airtime/showbuilder/tabs.js index fcfd33ff4..0268c390e 100644 --- a/airtime_mvc/public/js/airtime/showbuilder/tabs.js +++ b/airtime_mvc/public/js/airtime/showbuilder/tabs.js @@ -111,10 +111,6 @@ var AIRTIME = (function(AIRTIME){ Tab.prototype._init = function() { var self = this; self.assignTabClickHandler(function(e) { - if (e.which == 2) { // Middle mouse - self.close(); - return; - } if (!$(this).hasClass('active')) { self.switchTo(); } @@ -146,7 +142,17 @@ var AIRTIME = (function(AIRTIME){ * @param {function} f the function to call when the tab is clicked */ Tab.prototype.assignTabClickHandler = function(f) { - this.tab.unbind("click").on("click", f); + var self = this; + self.tab.unbind("click").on("click", function (e) { + // Always close on middle mouse press + if (e.which == 2) { + // Simulate a click on the close tab button so any + // additional on-close behaviour is executed + self.tab.find(".lib_pl_close").click(); + return; + } + f(); + }); }; /**