# HG changeset patch # User ymh # Date 1451320847 -3600 # Node ID f1c220ead0d7de641293f5976d59572462f07f40 # Parent 74b0b90517ed500d4782d331918005b2b3696fe2 add grammar control for polemic widget in metadataplayer. Created new version of embed code, upgrade metadataplayer diff -r 74b0b90517ed -r f1c220ead0d7 .pylintrc --- a/.pylintrc Wed Oct 28 15:53:59 2015 +0100 +++ b/.pylintrc Mon Dec 28 17:40:47 2015 +0100 @@ -8,7 +8,7 @@ #init-hook= # Profiled execution. -profile=no +#profile=no # Add files or directories to the blacklist. They should be base names, not # paths. @@ -67,7 +67,7 @@ # Add a comment according to your evaluation note. This is used by the global # evaluation report (RP0004). -comment=no +#comment=no # Template used to display messages. This is a python new-style format string # used to format the message information. See doc for all details @@ -100,7 +100,7 @@ [BASIC] # Required attributes for module, separated by a comma -required-attributes= +#required-attributes= # List of builtins function names that should not be used, separated by a comma bad-functions=map,filter @@ -278,7 +278,7 @@ # When zope mode is activated, add a predefined set of Zope acquired attributes # to generated-members. -zope=no +#zope=no # List of members which are set dynamically and missed by pylint inference # system, and so shouldn't trigger E0201 when accessed. Python regular @@ -308,7 +308,7 @@ # List of interface methods to ignore, separated by a comma. This is used for # instance to not check methods defines in Zope's Interface base class. -ignore-iface-methods=isImplementedBy,deferred,extends,names,namesAndDescriptions,queryDescriptionFor,getBases,getDescriptionFor,getDoc,getName,getTaggedValue,getTaggedValueTags,isEqualOrExtendedBy,setTaggedValue,isImplementedByInstancesOf,adaptWith,is_implemented_by +#ignore-iface-methods=isImplementedBy,deferred,extends,names,namesAndDescriptions,queryDescriptionFor,getBases,getDescriptionFor,getDoc,getName,getTaggedValue,getTaggedValueTags,isEqualOrExtendedBy,setTaggedValue,isImplementedByInstancesOf,adaptWith,is_implemented_by # List of method names used to declare (i.e. assign) instance attributes. defining-attr-methods=__init__,__new__,setUp diff -r 74b0b90517ed -r f1c220ead0d7 src/ldt/ldt/ldt_utils/templates/ldt/ldt_utils/embed/v3/iframe.html --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/ldt/ldt/ldt_utils/templates/ldt/ldt_utils/embed/v3/iframe.html Mon Dec 28 17:40:47 2015 +0100 @@ -0,0 +1,214 @@ +{% extends "ldt/ldt_utils/embed/iframe_base.html" %} +{% load i18n %} +{% load thumbnail %} +{% load static %} +{% load absurl %} +{% load analytics %} +{% block mdplayer_config %} + var _config = { + width: '{{ player_width }}', + container: '{{ player_id }}_embed', + css: '{% static "ldt/metadataplayer/LdtPlayer-core.css" %}', + default_options: { + metadata: _metadata + }, + widgets: [ + { + type: "AutoPlayer", + {% if external_url %} + video: "{{ external_url }}", + {% else %} + streamer: function(_url) { + var _matches = _url.match(/^[^\/]+\/\/[^\/]+\/[^\/]+\//); + if (_matches) { + return _matches[0]; + } else { + return _url; + } + }, + {% endif %} + height: '{{ player_height }}', + url_transform: function(url) { + // Adaptation to jwplayer 6 + if(url.substr(url.length - 4).toLowerCase()=='.flv'){ + return url.replace('/ddc_player/video/','/ddc_player/flv:video/'); + } + return url.replace('/ddc_player/video/','/ddc_player/mp4:video/'); + }, + autostart: {% if autostart %} true {% else %} false {% endif %} + } + {% if polemic %} + ,{ + type: "Polemic", + {% if polemic == 'all' %} + annotation_type: false, + {% else %} + annotation_type: [ + {% for type in polemic_annotation_types %} + {% if type == polemic_annotation_types|last %} + "{{type}}" + {% else %} + "{{type}}", + {% endif %} + {% endfor %}], + {% endif %} + max_elements: {{ polemic_max_elements }}, + defaultcolor: "#{{ polemic_defaultColor }}", + foundcolor: "#{{ polemic_foundColor }}", + default_version: "{{ polemic_version }}", + {% if polemics_list %} + polemics : {{ polemics_list|safe }} + {% else %} + polemics : { "1" : [ + { + "name" : "OK", + "keywords" : [ "++" ], + "color" : "#{{ polemic_okColor }}" + }, + { + "name" : "KO", + "keywords" : [ "--" ], + "color" : "#{{ polemic_koColor }}" + }, + { + "name" : "REF", + "keywords" : [ "==", "http://" ], + "color" : "#{{ polemic_refColor }}" + }, + { + "name" : "Q", + "keywords" : [ "?" ], + "color" : "#{{ polemic_qColor }}" + } + ], + "2" : [ + { + "name" : "OK", + "keywords" : [ "++" ], + "color" : "#{{ polemic_okColor }}" + }, + { + "name" : "KO", + "keywords" : [ "!!" ], + "color" : "#{{ polemic_koColor }}" + }, + { + "name" : "REF", + "keywords" : [ "==", "http://" ], + "color" : "#{{ polemic_refColor }}" + }, + { + "name" : "Q", + "keywords" : [ "?" ], + "color" : "#{{ polemic_qColor }}" + } + ] + } + {% endif %} + } + {% endif %} + {% if sparkline %} + ,{ + type: "Sparkline", + lineColor: "#{{ sparkline_lineColor }}", + fillColor: "#{{ sparkline_fillColor }}", + } + {% endif %} + ,{ + type: "Slider" + } + + {% if annotations_list %},{ + type: "AnnotationsList", + container: "AnnotationsList_ext", + ajax_url: "{% absurl 'segment_api_empty' resource_name='segments' api_name='1.0' %}{% templatetag openvariable %}media{% templatetag closevariable %}/{% templatetag openvariable %}begin{% templatetag closevariable %}/{% templatetag openvariable %}end{% templatetag closevariable %}", + ajax_granularity : 300000, + default_thumbnail : '{% static "ldt/css/imgs/video_sequence.png" %}', + show_audio: true, + rtmp_streamer: "rtmp://media.iri.centrepompidou.fr/ddc_micro_record/" + }{% endif %},{ + type: "Controller" + } + {% if segments %},{ + type: "Segments", + annotation_type: [ + {% for type in segments_annotation_types %} + {% if type == segments_annotation_types|last %} + "{{type}}" + {% else %} + "{{type}}", + {% endif %} + {% endfor %}] + } + {% endif %} + {% if multisegments %},{ + type: "MultiSegments" + } + {% endif %} + {% if annotation %},{ + type: "Annotation", + start_minimized: true, + site_name : "Lignes de Temps", + annotation_type: ["chap","découpage"] + } + {% endif %} + {% if tweet %},{ + type: "Tweet", + hide_timeout: 5000 + } + {% endif %} + {% if createannotation %},{ + type: "CreateAnnotation", + api_endpoint_template: "{% absurl 'api_dispatch_list' resource_name='annotations' api_name='1.0' %}", + after_send_timeout: 8000, + {% if tag_titles or tag_titles == "" %} + tag_titles : tag_titles_array, + {% else %} + tag_titles : false, + {% endif %} + show_mic_record: {% if show_mic_record %}true{% else %}false{% endif %}, + close_after_send: false, + slice_annotation_type: {% if createannotation_annotation_types %} + [{% for type in createannotation_annotation_types %} + {% if forloop.last %} "{{type}}" + {% else %} "{{type}}", + {% endif %} + {% endfor %}] + {% else %} + ["chap","découpage"] + {% endif %}, + creator_name: '{{request.user.username}}', + creator_avatar: '{% thumbnail request.user.image "48x48" format="PNG" crop="center" as im %}{{ im.url }}{% endthumbnail %}' || "https://si0.twimg.com/sticky/default_profile_images/default_profile_1_normal.png", + {% if not createannotation_polemics %}polemics: []{% endif %} + }{% endif %} + {% if slideshare %},{ + type: "Slideshare", + container: "Slideshare_ext", + embed_width: 400, + embed_height: 334, + annotation_type: "slide" + } + {% endif %},{ + type: "Mediafragment" + } + {% if social %},{ + type: "Social", + container: "Social_ext", + show_url: {% if show_url %}true{% else %}false{% endif %}, + show_twitter: {% if show_twitter %}true{% else %}false{% endif %}, + show_fb: {% if show_fb %}true{% else %}false{% endif %}, + show_gplus: {% if show_gplus %}true{% else %}false{% endif %}, + show_mail: {% if show_mail %}true{% else %}false{% endif %}, + url: document.location.href.replace(/#.*$/,""), + text: document.title + } + {% endif %} + + {% if tagcloud %},{ + type: "Tagcloud" + } + {% endif %} + ] + }; +{% endblock mdplayer_config %} +{% analytics %} diff -r 74b0b90517ed -r f1c220ead0d7 src/ldt/ldt/ldt_utils/templates/ldt/ldt_utils/embed/v3/mdplayer_config.html --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/ldt/ldt/ldt_utils/templates/ldt/ldt_utils/embed/v3/mdplayer_config.html Mon Dec 28 17:40:47 2015 +0100 @@ -0,0 +1,156 @@ +{% extends "ldt/ldt_utils/embed/mdplayer_config_base.html" %} +{% load i18n %} +{% load front_tags %} +{% load absurl %} +{% load static %} +{% load static %} +{% load analytics %} +{% block js_import %} + {{ block.super }} + +{% endblock %} + +{% block js_declaration %} + {{ block.super }} +{% endblock %} +{% block css_import %} + {{ block.super }} +{% endblock %} +{% block embed_widget_config %} + {% trans 'Widgets' %}
+
+ + CreateAnnotation +
+
+ + {% trans 'Audio annotation' %} +
+
+ {% trans 'Display annotation types: (annotation types must be separated by commas, leave blank to display everything) '%}
+
+
+ {% trans 'Use most used tags ' %} + + {%trans 'Set your own tags : ' %} + +
+ + {% trans '4 polemics buttons' %} ++/--/??/== + +
+
+
+ + Segments +
+
+
+ {% trans 'Display annotation types: (annotation types must be separated by commas, leave blank to display everything) '%}
+
+
+
+
+
+ + MultiSegments +
+
+ + AnnotationsList +
+
+ + Polemic +
+
+
+ {% trans 'Polemic version:' %}
+
+ {% trans 'Polemic max elements:' %}
+
+ {% trans 'Display annotation types: (annotation types must be separated by commas, leave blank to display everything) '%}
+
+ + {% trans "Personalize tweet's color" %} + +
+
+
+ {% trans "Default color" %} + +
+
+ {% trans "Polemic's color : ++ : " %} + + -- : + + == : + + ? : + +
+
+ {% trans "Found color" %} + +
+
+
+
+
+ + Sparkline +
+
+ + {% trans "personalize sparkline's color" %} + +
+
+ {% trans 'line color' %} + +
+ +
+ {% trans 'fill color' %} + +
+
+
+
+ + Slideshare +
+
+ + Social +
+
+ Url + Twitter + Facebook + Google Plus + {% trans 'share with email' %}
+
+
+ + Annotation +
+ + Tweet +
+ + Tagcloud +

+ {% trans 'Other settings' %}
+ + Autostart +
+ + {% trans "Concatenate all projects using this content" %} + +{% endblock %} +{% block content %} + {{ block.super }} +{% endblock %} +{% analytics %} diff -r 74b0b90517ed -r f1c220ead0d7 src/ldt/ldt/ldt_utils/templates/ldt/ldt_utils/groups.html --- a/src/ldt/ldt/ldt_utils/templates/ldt/ldt_utils/groups.html Wed Oct 28 15:53:59 2015 +0100 +++ b/src/ldt/ldt/ldt_utils/templates/ldt/ldt_utils/groups.html Mon Dec 28 17:40:47 2015 +0100 @@ -21,9 +21,9 @@ var get_group_projects_url = "{% url 'ldt.ldt_utils.views.group.get_group_projects_view' %}"; function init_events(base_node) { - init_events_projects(base_node, "{% url 'embed_config_v2' %}", project_filter_url, publish_project_url, unpublish_project_url); + init_events_projects(base_node, "{% url 'embed_config_v3' %}", project_filter_url, publish_project_url, unpublish_project_url); } - + var global_csrf_token = "{{ csrf_token }}"; //Functions to manage history with parameters @@ -41,17 +41,17 @@ } $(document).ready(function(){ - + input_list_init = [ {'input_selector':"#searchprojectsinput", 'container_selector':"#projectslistcontainer", 'url':project_filter_url}, {'input_selector':"#searchgroupsinput", 'container_selector':"#groupslistcontainer", 'url':groups_filter_url} ]; - - + + searchFieldInit(input_list_init); - + init_events(document); - + $(".update_group_projects").click(function(){ //alert("group id = " + $(this).attr('id') + ", url = " + get_group_projects_url); var id_group = $(this).attr('id'); @@ -77,13 +77,13 @@ init_events(document); }, error: function (jqXHR, textStatus, errorThrown) { - alert(jqXHR.responseText()); + alert(jqXHR.responseText()); } }); }); - + var leave_msg = '{% trans "Do you want to leave this group ?" %}'; - + $(".leave_group").click(function (e) { e.preventDefault(); var group_name = $(this).html(); @@ -92,7 +92,7 @@ window.location = $(this).attr('href'); } }); - + // If some filters parameters were set, we run the filter on contents and projects g = getURLParameter("g"); pf = getURLParameter("pf"); @@ -105,7 +105,7 @@ $('#id_group').val(g); searchCallback($('#searchprojectsinput'), "#projectslistcontainer", project_filter_url, 0, 0); } - + }); {% endblock %} @@ -125,7 +125,7 @@ {% endif %}
- +
loader
@@ -148,4 +148,3 @@
{% endblock %} - diff -r 74b0b90517ed -r f1c220ead0d7 src/ldt/ldt/ldt_utils/templates/ldt/ldt_utils/ldt_list.html --- a/src/ldt/ldt/ldt_utils/templates/ldt/ldt_utils/ldt_list.html Wed Oct 28 15:53:59 2015 +0100 +++ b/src/ldt/ldt/ldt_utils/templates/ldt/ldt_utils/ldt_list.html Mon Dec 28 17:40:47 2015 +0100 @@ -18,7 +18,7 @@ function init_events(base_node) { - init_events_base(base_node, "{% url 'embed_config_v2' %}"); + init_events_base(base_node, "{% url 'embed_config_v3' %}"); $('.publishedproject', base_node).click(function(e) { e.preventDefault(); @@ -47,8 +47,8 @@ }); }); - - + + } $(document).ready(function(){ @@ -58,7 +58,7 @@ ]; searchFieldInit(input_list_init); - + init_events(document); }); @@ -85,6 +85,6 @@
-
+ {% endblock %} diff -r 74b0b90517ed -r f1c220ead0d7 src/ldt/ldt/ldt_utils/templates/ldt/ldt_utils/partial/projectslist.html --- a/src/ldt/ldt/ldt_utils/templates/ldt/ldt_utils/partial/projectslist.html Wed Oct 28 15:53:59 2015 +0100 +++ b/src/ldt/ldt/ldt_utils/templates/ldt/ldt_utils/partial/projectslist.html Mon Dec 28 17:40:47 2015 +0100 @@ -44,11 +44,11 @@ {% endif %} {% endif %} - +
{% trans 'copy project' %}
-
- + @@ -76,4 +76,4 @@ {% endfor %} -
\ No newline at end of file + diff -r 74b0b90517ed -r f1c220ead0d7 src/ldt/ldt/ldt_utils/templates/ldt/ldt_utils/partial/publishedprojectslist.html --- a/src/ldt/ldt/ldt_utils/templates/ldt/ldt_utils/partial/publishedprojectslist.html Wed Oct 28 15:53:59 2015 +0100 +++ b/src/ldt/ldt/ldt_utils/templates/ldt/ldt_utils/partial/publishedprojectslist.html Mon Dec 28 17:40:47 2015 +0100 @@ -26,7 +26,7 @@
{% trans 'copy the project' %}
- + {% trans 'link json by id' %}
diff -r 74b0b90517ed -r f1c220ead0d7 src/ldt/ldt/ldt_utils/templates/ldt/ldt_utils/published_projects.html --- a/src/ldt/ldt/ldt_utils/templates/ldt/ldt_utils/published_projects.html Wed Oct 28 15:53:59 2015 +0100 +++ b/src/ldt/ldt/ldt_utils/templates/ldt/ldt_utils/published_projects.html Mon Dec 28 17:40:47 2015 +0100 @@ -19,9 +19,9 @@ function init_events(base_node) { - init_events_all(base_node, "{% url 'embed_config_v2' %}", content_filter_url, project_filter_url, publish_project_url, unpublish_project_url); + init_events_all(base_node, "{% url 'embed_config_v3' %}", content_filter_url, project_filter_url, publish_project_url, unpublish_project_url); } - + var global_csrf_token = "{{ csrf_token }}"; // Functions to manage history with parameters @@ -40,14 +40,14 @@ } $(document).ready(function(){ - + input_list_init = [ {'input_selector':"#searchcontentsinput", 'container_selector':"#contentslistcontainer", 'url':content_filter_url}, {'input_selector':"#searchprojectsinput", 'container_selector':"#projectslistcontainer", 'url':project_filter_url} ]; - + searchFieldInit(input_list_init); - + init_events(document); // If some filters parameters were set, we run the filter on contents and projects @@ -87,7 +87,7 @@ - +
{% trans "Published projects" %} diff -r 74b0b90517ed -r f1c220ead0d7 src/ldt/ldt/ldt_utils/templates/ldt/ldt_utils/search_results.html --- a/src/ldt/ldt/ldt_utils/templates/ldt/ldt_utils/search_results.html Wed Oct 28 15:53:59 2015 +0100 +++ b/src/ldt/ldt/ldt_utils/templates/ldt/ldt_utils/search_results.html Mon Dec 28 17:40:47 2015 +0100 @@ -11,26 +11,26 @@ {{ block.super }}