Skip to content

Commit

Permalink
Update assets after successful production
Browse files Browse the repository at this point in the history
  • Loading branch information
eteubert committed Jul 27, 2013
1 parent 0272081 commit 737f3a9
Show file tree
Hide file tree
Showing 4 changed files with 24 additions and 20 deletions.
17 changes: 17 additions & 0 deletions js/admin.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,22 @@
var PODLOVE = PODLOVE || {};

// jQuery Tiny Pub/Sub
// https://github.com/cowboy/jquery-tiny-pubsub
(function($) {
var o = $({});
$.subscribe = function() {
o.on.apply(o, arguments);
};

$.unsubscribe = function() {
o.off.apply(o, arguments);
};

$.publish = function() {
o.trigger.apply(o, arguments);
};
}(jQuery));

PODLOVE.rtrim = function (string, thechar) {
var re = new RegExp(thechar + "+$","g");
return string.replace(re, '');
Expand Down
8 changes: 5 additions & 3 deletions js/admin/episode.js
Original file line number Diff line number Diff line change
Expand Up @@ -158,11 +158,13 @@ var PODLOVE = PODLOVE || {};

$(".row__podlove_meta_episode_assets > span > label").after(" <a href='#' id='update_all_media_files'>update all media files</a>")

$(document).on("click", "#update_all_media_files", function(e) {
var update_all_media_files = function(e) {
e.preventDefault();
$(".update_media_file").click();
return false;
});
};

$.subscribe("/auphonic/production/status/done", update_all_media_files);
$(document).on("click", "#update_all_media_files", update_all_media_files);

$(document).on("click", ".update_media_file", function(e) {
e.preventDefault();
Expand Down
18 changes: 1 addition & 17 deletions lib/modules/auphonic/admin.js
Original file line number Diff line number Diff line change
@@ -1,22 +1,5 @@
var PODLOVE = PODLOVE || {};

// jQuery Tiny Pub/Sub
// https://github.com/cowboy/jquery-tiny-pubsub
(function($) {
var o = $({});
$.subscribe = function() {
o.on.apply(o, arguments);
};

$.unsubscribe = function() {
o.off.apply(o, arguments);
};

$.publish = function() {
o.trigger.apply(o, arguments);
};
}(jQuery));

(function($){

/**
Expand Down Expand Up @@ -140,6 +123,7 @@ var PODLOVE = PODLOVE || {};
update_production_status(data.data.status_string, data.data.status);
if (data.data.status_string === "Done") {
$("#start_auphonic_production_button, #stop_auphonic_production_button").toggle();
$.publish("/auphonic/production/status/done", [production_uuid]);
} else {
statusTimeoutId = window.setTimeout(function() { fetch_auphonic_production_status(production_uuid); }, 5000);
}
Expand Down
1 change: 1 addition & 0 deletions readme.txt
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,7 @@ Find the setting Flattr > Advanced Settings > Flattrable content > Post Types an

= 1.8.3 =
* Enhancement: dates with leading zeros in Auphonic module
* Enhancement: Auphonic UI smoothifications

= 1.8.2 (2013-07-27) =
Auphonic integration Enhancements
Expand Down

0 comments on commit 737f3a9

Please sign in to comment.