Updated video thumbnail selection form prefix
authorThierry Florac <thierry.florac@onf.fr>
Mon, 27 Aug 2018 11:03:11 +0200
changeset 101 0cb6cb0ac01c
parent 100 7ac21495e0b1
child 102 532cb52f120b
Updated video thumbnail selection form prefix
src/pyams_media/skin/resources/js/pyams_media.js
src/pyams_media/skin/resources/js/pyams_media.min.js
src/pyams_media/zmi/video.py
--- a/src/pyams_media/skin/resources/js/pyams_media.js	Mon Aug 27 11:02:44 2018 +0200
+++ b/src/pyams_media/skin/resources/js/pyams_media.js	Mon Aug 27 11:03:11 2018 +0200
@@ -41,7 +41,7 @@
 			if (video && video.time) {
 				var position = video.time;
 				var form = parent.parents('form');
-				$('INPUT[name="form.widgets.time"]', form).val(position);
+				$('INPUT[name="thumbnail_form.widgets.time"]', form).val(position);
 			}
 		},
 
--- a/src/pyams_media/skin/resources/js/pyams_media.min.js	Mon Aug 27 11:02:44 2018 +0200
+++ b/src/pyams_media/skin/resources/js/pyams_media.min.js	Mon Aug 27 11:03:11 2018 +0200
@@ -1,1 +1,1 @@
-(function(c,b){var d=b.MyAMS;var a={initPlayer:function(){var g=c(this);d.dialog.registerShownCallback(a.initPlayerDialog,g);var e=g.flowplayer();var f=g.data("ams-flowplayer-events");if(f){for(var h in f){if(!f.hasOwnProperty(h)){continue}e.on(h,d.getFunctionByName(f[h]))}}d.dialog.registerHideCallback(a.shutdownPlayerDialog,g)},initPlayerDialog:function(){var e=c(this);c(".modal-viewport",e).removeAttr("style").removeClass("modal-viewport")},getPlayerTime:function(l,i){var h=c(this);var g=h.data("flowplayer");if(g.playing){return}var k=g.video;if(!k.time&&g.conf.flowplayer){k=g.conf.flowplayer.video}if(k&&k.time){var f=k.time;var j=h.parents("form");c('INPUT[name="form.widgets.time"]',j).val(f)}},shutdownPlayerDialog:function(){var f=c(this);var e=c(".flowplayer",f).data("flowplayer");e.shutdown()}};b.PyAMS_media=a})(jQuery,this);
\ No newline at end of file
+!function(a,e){"use strict";var i=e.MyAMS,t={initPlayer:function(){var e=a(this);i.dialog.registerShownCallback(t.initPlayerDialog,e);var r=e.flowplayer(),o=e.data("ams-flowplayer-events");if(o)for(var l in o)o.hasOwnProperty(l)&&r.on(l,i.getFunctionByName(o[l]));i.dialog.registerHideCallback(t.shutdownPlayerDialog,e)},initPlayerDialog:function(){var e=a(this);a(".modal-viewport",e).removeAttr("style").removeClass("modal-viewport")},getPlayerTime:function(e,i){var t=a(this),r=t.data("flowplayer");if(!r.playing){var o=r.video;if(!o.time&&r.conf.flowplayer&&(o=r.conf.flowplayer.video),o&&o.time){var l=o.time,n=t.parents("form");a('INPUT[name="thumbnail_form.widgets.time"]',n).val(l)}}},shutdownPlayerDialog:function(){var e=a(this);a(".flowplayer",e).data("flowplayer").shutdown()}};e.PyAMS_media=t}(jQuery,this);
--- a/src/pyams_media/zmi/video.py	Mon Aug 27 11:02:44 2018 +0200
+++ b/src/pyams_media/zmi/video.py	Mon Aug 27 11:03:11 2018 +0200
@@ -104,6 +104,8 @@
 class VideoThumbnailEditForm(AdminDialogAddForm):
     """Video thumbnail selection form"""
 
+    prefix = 'thumbnail_form.'
+
     legend = _("Select video thumbnail")
     icon_css_class = 'fa fa-fw fa-film'