# HG changeset patch # User cavaliet # Date 1368720660 -7200 # Node ID 6a3d8d05e3fb153189d0648cf79d717bf5716617 # Parent 16b482c153fd14cb9e3218d739de5a74fcacb701 update js and modal views diff -r 16b482c153fd -r 6a3d8d05e3fb src/metadatacomposer/static/metadatacomposer/js/edition.js --- a/src/metadatacomposer/static/metadatacomposer/js/edition.js Thu May 16 18:03:54 2013 +0200 +++ b/src/metadatacomposer/static/metadatacomposer/js/edition.js Thu May 16 18:11:00 2013 +0200 @@ -3,7 +3,46 @@ var global = { diaporama : null, idAnnotation : null -}; +}, +chapitres = [], +annotations = []; + +myProject.onLoad(function() { + + $(".project-title").text(myProject.title); + + myMedia = myProject.getCurrentMedia(); + + IriSP.htmlPlayer( + myMedia, + $(".main-video"), + { + width: 460, + height: 345, + controls: true, + autostart: true + } + ); + + myMedia.on("timeupdate", function(t) { + + //curseur chapitre + var pos = $(".chapitre-cut-wrap").width() * t / myMedia.duration, + wContainer = $('.chapitre-cut-wrap').width(), + btnCutChapter = $('.btn-cut-chapter'), + wBtnCutChapter = btnCutChapter.outerWidth(); + + $(".indicateur-chapter").css("left",pos); + if(pos+wBtnCutChapter>wContainer){ + btnCutChapter.css("left",(pos - wBtnCutChapter)); + }else{ + btnCutChapter.css("left",pos); + } + + });//timeupdate + +});//myProject.onLoad + //modal $(document).on('click', 'a.open-modal', function(e){ @@ -91,7 +130,7 @@ $('.project-title').html($(this).val()); }); -//chapter +//--chapter $('.list-chapter-wrap').on('click', '.edit-chapter', function(e){ e.preventDefault(); var viewChapter = { @@ -109,6 +148,7 @@ //nouveau chapitre $('.chapter-widget').on('click', '.btn-cut-chapter', function(e){ e.preventDefault(); + var uniqId = 'id' + (new Date()).getTime(); $.get('template.html', function(templates){ var viewChapterRow = { @@ -120,6 +160,9 @@ }); }); + function addChapter(data){ + + } //edit annotation $('#list-annotations').on('click', 'a.btn-edit-annotation', function(e){ @@ -261,11 +304,7 @@ }); //annotation > diaporama (spin) -var spinParam = { - imageBasePath :'lib/spin/img/', - max:60, - min:0 -}; + //config //CLEditor annotation > text (wysiwyg) @@ -371,4 +410,4 @@ $('#annotation-tab a:last-child').tab('show'); -}); \ No newline at end of file +});//ready \ No newline at end of file diff -r 16b482c153fd -r 6a3d8d05e3fb src/metadatacomposer/static/metadatacomposer/js/projet.js --- a/src/metadatacomposer/static/metadatacomposer/js/projet.js Thu May 16 18:03:54 2013 +0200 +++ b/src/metadatacomposer/static/metadatacomposer/js/projet.js Thu May 16 18:11:00 2013 +0200 @@ -6,7 +6,7 @@ //ZeroClipboard (fonctionne sous localhost) var clip = new ZeroClipboard( $('.clipboard'), { - moviePath: "lib/ZeroClipboard/ZeroClipboard.swf" + moviePath: ZeroClipboardMoviePath }); clip.on( 'complete', function(client, args) { alert("Copied text to clipboard: " + args.text ); diff -r 16b482c153fd -r 6a3d8d05e3fb src/metadatacomposer/templates/metadatacomposer_modal_image.html --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/metadatacomposer/templates/metadatacomposer_modal_image.html Thu May 16 18:11:00 2013 +0200 @@ -0,0 +1,59 @@ +{% load static %} +
+
+ +
+ +
\ No newline at end of file diff -r 16b482c153fd -r 6a3d8d05e3fb src/metadatacomposer/templates/metadatacomposer_modal_video.html --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/metadatacomposer/templates/metadatacomposer_modal_video.html Thu May 16 18:11:00 2013 +0200 @@ -0,0 +1,53 @@ +{% load static %} +
+
+ +
+ +
+ \ No newline at end of file diff -r 16b482c153fd -r 6a3d8d05e3fb src/metadatacomposer/templates/metadatacomposer_project_list.html --- a/src/metadatacomposer/templates/metadatacomposer_project_list.html Thu May 16 18:03:54 2013 +0200 +++ b/src/metadatacomposer/templates/metadatacomposer_project_list.html Thu May 16 18:11:00 2013 +0200 @@ -87,4 +87,7 @@ {% block js_page %} + {% endblock %} diff -r 16b482c153fd -r 6a3d8d05e3fb src/metadatacomposer/templates/metadatacomposer_resource_list.html --- a/src/metadatacomposer/templates/metadatacomposer_resource_list.html Thu May 16 18:03:54 2013 +0200 +++ b/src/metadatacomposer/templates/metadatacomposer_resource_list.html Thu May 16 18:11:00 2013 +0200 @@ -19,7 +19,7 @@

Liste des images

- + Ajouter une image
@@ -48,7 +48,7 @@ 14/03/2014 - + @@ -66,7 +66,7 @@ 14/03/2014 - + @@ -92,7 +92,7 @@

Liste des vidéos

diff -r 16b482c153fd -r 6a3d8d05e3fb src/metadatacomposer/templates/partial/resource_content_list.html --- a/src/metadatacomposer/templates/partial/resource_content_list.html Thu May 16 18:03:54 2013 +0200 +++ b/src/metadatacomposer/templates/partial/resource_content_list.html Thu May 16 18:11:00 2013 +0200 @@ -26,7 +26,7 @@ {{ res.content.update_date|date:"Y/m/d" }} - + diff -r 16b482c153fd -r 6a3d8d05e3fb src/metadatacomposer/urls.py --- a/src/metadatacomposer/urls.py Thu May 16 18:03:54 2013 +0200 +++ b/src/metadatacomposer/urls.py Thu May 16 18:11:00 2013 +0200 @@ -1,12 +1,15 @@ from django.conf.urls.defaults import patterns, url from metadatacomposer.views import MetadataComposerHome, MetadataComposerProjectList,\ - MetadataComposerResourceList, MetadataComposerContentPagination + MetadataComposerResourceList, MetadataComposerContentPagination,\ + MetadataComposerModalVideo, MetadataComposerModalImage urlpatterns = patterns('', url(r'^jsi18n/(?P\S+?)/$', 'django.views.i18n.javascript_catalog', name='jsi18n'), url(r'^(?P.*)/projectlist/$', MetadataComposerProjectList.as_view(), name="composer_project_list"), url(r'^(?P.*)/resourcelist/$', MetadataComposerResourceList.as_view(), name="composer_resource_list"), url(r'^(?P.*)/contentpage/$', MetadataComposerContentPagination.as_view(), name="composer_content_page"), + url(r'^(?P.*)/modalvideo/$', MetadataComposerModalVideo.as_view(), name="composer_modal_video"), + url(r'^(?P.*)/modalimage/$', MetadataComposerModalImage.as_view(), name="composer_modal_image"), url(r'^(?P.*)/$', MetadataComposerHome.as_view(), name="composer_home"), url(r'^$', MetadataComposerHome.as_view(), name="composer_home"), ) diff -r 16b482c153fd -r 6a3d8d05e3fb src/metadatacomposer/views.py --- a/src/metadatacomposer/views.py Thu May 16 18:03:54 2013 +0200 +++ b/src/metadatacomposer/views.py Thu May 16 18:11:00 2013 +0200 @@ -143,4 +143,36 @@ results.object_list = results_object_list return results + + + +class MetadataComposerModalVideo(TemplateResponseMixin, MetadataComposerContextView): + + def get_template_names(self): + return "metadatacomposer_modal_video.html" + + @method_decorator(login_required) + def dispatch(self, *args, **kwargs): + return super(MetadataComposerModalVideo, self).dispatch(*args, **kwargs) + + def get(self, request, branding="iri", **kwargs): + self.branding = branding + context = self.get_context_dict(request) + return self.render_to_response(context) + + + +class MetadataComposerModalImage(TemplateResponseMixin, MetadataComposerContextView): + + def get_template_names(self): + return "metadatacomposer_modal_image.html" + + @method_decorator(login_required) + def dispatch(self, *args, **kwargs): + return super(MetadataComposerModalImage, self).dispatch(*args, **kwargs) + + def get(self, request, branding="iri", **kwargs): + self.branding = branding + context = self.get_context_dict(request) + return self.render_to_response(context) \ No newline at end of file