# HG changeset patch # User cavaliet # Date 1391700181 -3600 # Node ID 2bbc6c42ca9a9d24e2c8b3fc6974341c6097c9e7 # Parent efe2907f38c5468530a189543d38e18ed892b6b7 v1.52.4 : correct enhancements on mdp for group page. diff -r efe2907f38c5 -r 2bbc6c42ca9a src/ldt/ldt/__init__.py --- a/src/ldt/ldt/__init__.py Thu Feb 06 14:52:09 2014 +0100 +++ b/src/ldt/ldt/__init__.py Thu Feb 06 16:23:01 2014 +0100 @@ -1,6 +1,6 @@ __all__ = ["VERSION", "get_version", "__version__"] -VERSION = (1, 52, 3, "final", 0) +VERSION = (1, 52, 4, "final", 0) def get_version(): diff -r efe2907f38c5 -r 2bbc6c42ca9a src/ldt/ldt/ldt_utils/templates/front/front_player.html --- a/src/ldt/ldt/ldt_utils/templates/front/front_player.html Thu Feb 06 14:52:09 2014 +0100 +++ b/src/ldt/ldt/ldt_utils/templates/front/front_player.html Thu Feb 06 16:23:01 2014 +0100 @@ -12,7 +12,7 @@ {% if toggle_multisegments %} @@ -31,9 +31,12 @@ $j("#search_submit").addClass('search_invalid').removeClass('search_valid'); $j("#search_submit").attr('disabled', 'disabled'); }); + {% if toggle_multisegments %} $j(".toggle_multisegments").click(function () { $j("#{{player_id}}_embed_widget_MultiSegments_11").toggle(); + $j("#TagcloudContainer").toggle(); }); + {% endif %} }); {% endblock %} diff -r efe2907f38c5 -r 2bbc6c42ca9a src/ldt/ldt/ldt_utils/templates/ldt/ldt_utils/partial/embed_player.html --- a/src/ldt/ldt/ldt_utils/templates/ldt/ldt_utils/partial/embed_player.html Thu Feb 06 14:52:09 2014 +0100 +++ b/src/ldt/ldt/ldt_utils/templates/ldt/ldt_utils/partial/embed_player.html Thu Feb 06 16:23:01 2014 +0100 @@ -112,7 +112,8 @@ include_titles: false, include_descriptions: false, min_count: 0, - tag_count: 100 + tag_count: 100, + remove_zero_duration: {% if remove_zero_duration %}true{% else %}false{% endif %} } {% endif %} ] diff -r efe2907f38c5 -r 2bbc6c42ca9a src/ldt/ldt/ldt_utils/views/front.py --- a/src/ldt/ldt/ldt_utils/views/front.py Thu Feb 06 14:52:09 2014 +0100 +++ b/src/ldt/ldt/ldt_utils/views/front.py Thu Feb 06 16:23:01 2014 +0100 @@ -212,6 +212,11 @@ group_id = request.GET.get("group") if group_id is not None : json_url += "?group=" + group_id + # add parameter to remove segment with duration = 0 + remove_zero_duration = False + remove_zero_param = request.GET.get("remove_zero_duration") + if remove_zero_param is not None : + remove_zero_duration = {'true': True, 'false': False, "0": False, "1": True}.get(remove_zero_param.lower()) player_width = 854 player_height = 480 @@ -223,7 +228,7 @@ return render_to_response("front/front_player.html", {'content': content, 'player_id': player_id, 'json_url': json_url, 'player_width':player_width, 'player_height':player_height, 'stream_mode':stream_mode, 'external_url':external_url, - 'is_gecko': is_gecko, 'annotation_block':annotation_block, 'toggle_multisegments':True}, + 'is_gecko': is_gecko, 'annotation_block':annotation_block, 'toggle_multisegments':True, 'remove_zero_duration':remove_zero_duration}, context_instance=RequestContext(request)) diff -r efe2907f38c5 -r 2bbc6c42ca9a src/ldt/ldt/static/ldt/metadataplayer/Tagcloud.js --- a/src/ldt/ldt/static/ldt/metadataplayer/Tagcloud.js Thu Feb 06 14:52:09 2014 +0100 +++ b/src/ldt/ldt/static/ldt/metadataplayer/Tagcloud.js Thu Feb 06 16:23:01 2014 +0100 @@ -22,7 +22,8 @@ segment_annotation_type: false, min_font_size: 10, max_font_size: 26, - min_count: 2 + min_count: 2, + remove_zero_duration: false }; IriSP.Widgets.Tagcloud.prototype.stopword_lists = { @@ -55,16 +56,29 @@ IriSP.Widgets.Tagcloud.prototype.redraw = function(_from, _to) { var _urlRegExp = /https?:\/\/[0-9a-zA-Z\.%\/-_]+/g, - _regexpword = /[^\.&;,'"!\?\d\(\)\+\[\]\\\…\-«»:\/]{3,}/g, _words = {}, _this = this, _annotations = this.getWidgetAnnotations(); + + if(!this.include_titles && !this.include_descriptions){ + var _regexpword = /[^\.&;,'"!\?\d\(\)\+\[\]\\\…\-«»\/]{3,}/g; + } + else{ + var _regexpword = /[^\s\.&;,'"!\?\d\(\)\+\[\]\\\…\-«»:\/]{3,}/g; + } if (typeof _from !== "undefined" && typeof _to !== "undefined") { _annotations = _annotations.filter(function(_annotation) { return _annotation.begin >= _from && _annotation.end <= _to; }); } + + if(this.remove_zero_duration){ + _annotations = _annotations.filter(function(_annotation) { + return _annotation.getDuration()>0; + }); + } + _annotations.forEach(function(_annotation) { var _txt = (_this.include_titles ? _annotation.title : '')