Merge with 4e8c6e580e78179f27cd14d17b0fccf0dab24d5f
authorverrierj
Fri, 27 Jan 2012 14:56:11 +0100
changeset 471 c54a7864a22f
parent 470 b1dd78b59750 (current diff)
parent 466 4e8c6e580e78 (diff)
child 473 a400c401f78b
Merge with 4e8c6e580e78179f27cd14d17b0fccf0dab24d5f
src/ldt/ldt/ldt_utils/templates/front/front_all_contents.html
src/ldt/ldt/ldt_utils/templates/front/front_home.html
--- a/src/ldt/ldt/ldt_utils/templates/front/front_all_contents.html	Fri Jan 27 14:39:39 2012 +0100
+++ b/src/ldt/ldt/ldt_utils/templates/front/front_all_contents.html	Fri Jan 27 14:56:11 2012 +0100
@@ -27,9 +27,11 @@
         {% else %}<h2>{% trans 'All medias' %}</h2>{% endif %}
     </li>
     {% for content in content_list %}
-    <li class="li_media">
-        <a class="img_and_overlay" href="{% url ldt.ldt_utils.views.front.annot_content content.iri_id %}">
-            {% thumbnail content.image "294x165" format="PNG" crop="center" as im %}<img src="{{ im.url }}" class="img_media" width="{{ im.width }}" height="{{ im.height }}" alt="{% trans 'open this media' %}" title="{% trans 'open this media' %}">{% endthumbnail %}
+    <li class="li_media">        
+        <div class="img_and_overlay">
+            <a href="{% url ldt.ldt_utils.views.front.annot_content content.iri_id %}">
+                {% thumbnail content.image "294x165" format="PNG" crop="center" as im %}<img src="{{ im.url }}" class="img_media" width="{{ im.width }}" height="{{ im.height }}" alt="{% trans 'open this media' %}" title="{% trans 'open this media' %}">{% endthumbnail %}
+            </a>
             <div class="overlay">
                 <ul class="polemics">
                     <li class="pol-negative" style="width:{{content.pol_positive_rate }}%">{{content.pol_positive_rate }}%</li>
@@ -37,9 +39,9 @@
                     <li class="pol-reference" style="width:0%">0%</li>
                     <li class="pol-question" style="width:0%">0%</li>
                 </ul>
-                <span class="graph_annotation" id="sp_{{ content.iri_id }}">{{ content.annotation_volume|list2str }}</span>
+                <span class="graph_annotation" id="sp_{{ content.iri_id }}">{{ content.stat_annotation }}</span>
             </div>
-        </a>
+        </div>
         <div class="bulle_annot" title="{% blocktrans count nb=content.nb_annotation %}{{nb}} annotation on this media{% plural %}{{nb}} annotations on this media{% endblocktrans %}">{{ content.nb_annotation }}</div>
         <p><a href="{% url ldt.ldt_utils.views.front.annot_content content.iri_id %}"><b>{% if content.title|length > 69 %}{{content.title|slice:":69"}}...{% else %}{{content.title}}{% endif %}</b></a></p>
         <p>{% trans 'by' %} IRI | {{content.duration|str_duration:"h"}}</p>
--- a/src/ldt/ldt/ldt_utils/templates/front/front_home.html	Fri Jan 27 14:39:39 2012 +0100
+++ b/src/ldt/ldt/ldt_utils/templates/front/front_home.html	Fri Jan 27 14:56:11 2012 +0100
@@ -33,17 +33,20 @@
     </li>
     {% for content in last_contents %}
     <li class="li_media">
-        <a class="img_and_overlay" href="{% url ldt.ldt_utils.views.front.annot_content content.iri_id %}">{% thumbnail content.image "294x165" format="PNG" crop="center" as im %}<img src="{{ im.url }}" class="img_media" width="{{ im.width }}" height="{{ im.height }}" alt="{% trans 'open this media' %}" title="{% trans 'open this media' %}">{% endthumbnail %}
+        <div class="img_and_overlay">
+            <a class="img_and_overlay" href="{% url ldt.ldt_utils.views.front.annot_content content.iri_id %}">
+                {% thumbnail content.image "294x165" format="PNG" crop="center" as im %}<img src="{{ im.url }}" class="img_media" width="{{ im.width }}" height="{{ im.height }}" alt="{% trans 'open this media' %}" title="{% trans 'open this media' %}">{% endthumbnail %}
+            </a>
             <div class="overlay">
                 <ul class="polemics">
-                    <li class="pol-negative" style="width:{{content.pol_positive_rate }}%">{{content.pol_positive_rate }}%</li>
-                    <li class="pol-positive" style="width:{{content.pol_negative_rate}}%">{{content.pol_negative_rate}}%</li>
+                    <li class="pol-negative" style="width:{{content.pol_negative_rate}}%">{{content.pol_negative_rate}}%</li>
+                    <li class="pol-positive" style="width:{{content.pol_positive_rate}}%">{{content.pol_positive_rate}}%</li>
                     <li class="pol-reference" style="width:0%">0%</li>
                     <li class="pol-question" style="width:0%">0%</li>
-                </ul>                
-                <span class="graph_annotation" id="sp_{{ content.iri_id }}">{{ content.annotation_volume|list2str }}</span>
+                </ul>
+                <span class="graph_annotation" id="sp_{{ content.iri_id }}">{{ content.stat_annotation }}</span>
             </div>
-        </a>
+        </div>
         <div class="bulle_annot" title="{% blocktrans count nb=content.nb_annotation %}{{nb}} annotation on this media{% plural %}{{nb}} annotations on this media{% endblocktrans %}">{{ content.nb_annotation }}</div>
         <p><a href="{% url ldt.ldt_utils.views.front.annot_content content.iri_id %}" title="{% trans 'open this media' %}"><b>{{content.title}}</b></a></p>
         <p>{% trans 'by' %} IRI | {{content.duration|str_duration:"h"}}</p>
@@ -63,17 +66,18 @@
     </li>
     {% for content in most_contents %}
     <li class="li_media">
-        <a class="img_and_overlay" href="{% url ldt.ldt_utils.views.front.annot_content content.iri_id %}">
-        {% thumbnail content.image "134x75" format="PNG" crop="center" as im %}<img src="{{ im.url }}" class="img_media" width="{{ im.width }}" height="{{ im.height }}" alt="{% trans 'open this media' %}" title="{% trans 'open this media' %}">{% endthumbnail %}
+        <div class="img_and_overlay">
+            <a href="{% url ldt.ldt_utils.views.front.annot_content content.iri_id %}">
+            {% thumbnail content.image "134x75" format="PNG" crop="center" as im %}<img src="{{ im.url }}" class="img_media" width="{{ im.width }}" height="{{ im.height }}" alt="{% trans 'open this media' %}" title="{% trans 'open this media' %}">{% endthumbnail %}</a>
             <div class="overlay">
                 <ul class="polemics">
-                    <li class="pol-negative" style="width:{{content.pol_positive_rate }}%">{{content.pol_positive_rate }}%</li>
-                    <li class="pol-positive" style="width:{{content.pol_negative_rate}}%">{{content.pol_negative_rate}}%</li>
+                    <li class="pol-negative" style="width:{{content.pol_negative_rate}}%">{{content.pol_negative_rate}}%</li>
+                    <li class="pol-positive" style="width:{{content.pol_positive_rate}}%">{{content.pol_positive_rate}}%</li>
                     <li class="pol-reference" style="width:0%">0%</li>
                     <li class="pol-question" style="width:0%">0%</li>
                 </ul>
             </div>
-        </a>
+        </div>
         <div class="bulle_annot" title="{% blocktrans count nb=content.nb_annotation %}{{nb}} annotation on this media{% plural %}{{nb}} annotations on this media{% endblocktrans %}">{{ content.nb_annotation }}</div>
         <p><a href="{% url ldt.ldt_utils.views.front.annot_content content.iri_id %}" title="{% trans 'open this media' %}"><b>{% if content.title|length > 69 %}{{content.title|slice:":69"}}...{% else %}{{content.title}}{% endif %}</b></a></p>
         <p class="font_11">{% trans 'by' %} IRI | {{content.duration|str_duration:"h"}}</p>
--- a/src/ldt/ldt/ldt_utils/templates/ldt/ldt_utils/partial/embed_player.html	Fri Jan 27 14:39:39 2012 +0100
+++ b/src/ldt/ldt/ldt_utils/templates/ldt/ldt_utils/partial/embed_player.html	Fri Jan 27 14:56:11 2012 +0100
@@ -1,7 +1,6 @@
 {% spaceless %}
 {% load i18n %}
 <div>
-<div style="height: 80px">&nbsp;</div>
 <div id="{{ player_id }}_embed" class="iri_player_embed">
 </div>
 <script type="text/javascript">
--- a/src/ldt/ldt/static/ldt/css/LdtPlayer.css	Fri Jan 27 14:39:39 2012 +0100
+++ b/src/ldt/ldt/static/ldt/css/LdtPlayer.css	Fri Jan 27 14:56:11 2012 +0100
@@ -689,6 +689,66 @@
   color: #D93C71;
 }
 
+.Ldt-createAnnotation-Minimize {
+  position: relative;
+  float: right;
+  height: 17px;
+  width: 17px;
+  right: 0px;
+}
+
+/* polemic tweet annotation buttons */
+.Ldt-createAnnotation-polemics {
+  padding-top: 2px;
+}
+
+.Ldt-createAnnotation-polemic-button {
+  margin: 0;
+  border: 0;
+  padding: 0;
+  margin-right: 2px;
+  width: 38px;
+  height: 26px;
+  text-indent: -999px;
+  background: url(imgs/polemic_buttons_sprite.png);
+}
+
+.Ldt-createAnnotation-polemic-positive:hover {
+    background-position: 0 -26px;
+}
+.Ldt-createAnnotation-polemic-positive.Ldt-createAnnotation-polemic-active {
+    background-position: 0 -52px;
+}
+
+.Ldt-createAnnotation-polemic-negative {
+    background-position: -38px 0;
+}
+.Ldt-createAnnotation-polemic-negative:hover {
+    background-position: -38px -26px;
+}
+.Ldt-createAnnotation-polemic-negative.Ldt-createAnnotation-polemic-active {
+    background-position: -38px -52px;
+}
+
+.Ldt-createAnnotation-polemic-reference {
+    background-position: -76px 0;
+}
+.Ldt-createAnnotation-polemic-reference:hover {
+    background-position: -76px -26px;
+}
+.Ldt-createAnnotation-polemic-reference.Ldt-createAnnotation-polemic-active {
+    background-position: -76px -52px;
+}
+
+.Ldt-createAnnotation-polemic-question {
+    background-position: -114px 0;
+}
+.Ldt-createAnnotation-polemic-question:hover {
+    background-position: -114px -26px;
+}
+.Ldt-createAnnotation-polemic-question.Ldt-createAnnotation-polemic-active {
+    background-position: -114px -52px;
+}
 /* AnnotationsListWidget */
 
 .Ldt-AnnotationsListWidget {
@@ -715,6 +775,10 @@
   background-color: #e9e9e9;
 }
 
+.Ldt-AnnotationsListWidget li a {
+  text-decoration: none;
+}
+
 .Ldt-AnnotationsList-Caption {
   float: left;
   display: table-cell;
@@ -734,3 +798,13 @@
   display: table-cell;
   width: 80%;
 }
+
+/* Tagcloud */
+
+.Ldt-TagCloud ul {
+    list-style: none; padding: 0; margin: 5px; text-align: center;
+}
+
+.Ldt-TagCloud li {
+    display: inline-block; margin: 2px;
+}
--- a/src/ldt/ldt/static/ldt/css/front_player.css	Fri Jan 27 14:39:39 2012 +0100
+++ b/src/ldt/ldt/static/ldt/css/front_player.css	Fri Jan 27 14:56:11 2012 +0100
@@ -3,7 +3,7 @@
 }
 
 #top_media {
-    width: 550px; border-bottom: 1px solid #484848;
+    width: 550px; border-bottom: 1px solid #484848; margin-bottom: 5px;
 }
 
 #media_share {
@@ -49,7 +49,7 @@
 }
 
 #annot_media {
-    width: 400px; margin: 5px 0 10px 10px; max-height: 400px; overflow: auto;
+    width: 400px; margin: 5px 0 10px 10px;
 }
 
 #annot_media li {
Binary file src/ldt/ldt/static/ldt/css/imgs/polemic_buttons_sprite.png has changed
--- a/src/ldt/ldt/static/ldt/js/LdtPlayer-release.js	Fri Jan 27 14:39:39 2012 +0100
+++ b/src/ldt/ldt/static/ldt/js/LdtPlayer-release.js	Fri Jan 27 14:56:11 2012 +0100
@@ -1,7 +1,7 @@
 /* 
  * 	
- *	Copyright 2010 Institut de recherche et d'innovation 
- *	contributor(s) : Samuel Huron 
+ *	Copyright 2010-2012 Institut de recherche et d'innovation 
+ *	contributor(s) : Karim Hamidou, Samuel Huron 
  *	 
  *	contact@iri.centrepompidou.fr
  *	http://www.iri.centrepompidou.fr 
@@ -1085,9 +1085,9 @@
 IriSP.annotation_template = "{{! template for an annotation displayed in a segmentWidget }}<div title='{{divTitle}}' id='{{id}}'	class='Ldt-iri-chapter' 	style='left: {{startPixel}}px;          width: {{pxWidth}}px;          background-color:#{{hexa_color}};' 	></div>";
 IriSP.annotationWidget_template = "{{! template for the annotation widget }}<div class='Ldt-AnnotationsWidget'>  <!-- ugly div because we want to have a double border -->  <div class='Ldt-Annotation-DoubleBorder'>      <div class='Ldt-AnnotationContent'>        <div class='Ldt-AnnotationShareIcons'>         <a target='_blank' class='Ldt-fbShare' href=''><img src='{{img_dir}}/facebook.png' alt='share on facebook'></img></a>         <a target='_blank' class='Ldt-TwShare' href=''><img src='{{img_dir}}/twitter.png' alt='share on twitter'></img></a>         <a target='_blank'  class='Ldt-GplusShare' href=''><img src='{{img_dir}}/google.png' alt='share on google+'></img></a>      </div>		  <div class='Ldt-SaTitle'></div>	  	<div class='Ldt-SaDescription'></div>    </div>  </div></div>";
 IriSP.annotation_loading_template = "{{! template shown while the annotation widget is loading }}<div id='Ldt-load-container'><div id='Ldt-loader'>&nbsp;</div> Chargement... </div>";
-IriSP.annotationsListWidget_template = "{{! template for the annotation list widget }}<div class='Ldt-AnnotationsListWidget'>  <!-- ugly div because we want to have a double border -->  <div class='Ldt-Annotation-DoubleBorder'>    <ul>    {{#annotations}}      <li>        {{^url}}        <a href='#id={{id}}'>        {{/url}}        {{url}}        <a href='{{url}}#id={{id}}'>          <div style='overflow: auto; margin-top: 5px; margin-bottom: 5px;'>            <div class='Ldt-AnnotationsList-Caption'>              <img src='http://i.imgur.com/aoUlC.jpg'></img>            </div>            <div class='Ldt-AnnotationsList-Duration'>{{begin}} - {{end}}</div>            <div class='Ldt-AnnotationsList-Title'>{{title}}</div>            <div class='Ldt-AnnotationsList-Description'>{{desc}}</div>          </div>        </a>      </li>    {{/annotations}}    </ul>  </div></div>";
+IriSP.annotationsListWidget_template = "{{! template for the annotation list widget }}<div class='Ldt-AnnotationsListWidget'>  <!-- ugly div because we want to have a double border -->  <div class='Ldt-Annotation-DoubleBorder'>    <ul>    {{#annotations}}      <li>        {{! if the url is not present, it means that the annotation exists             in the current project }}        {{^url}}        <a href='#id={{id}}'>        {{/url}}        {{! otherwise link to url }}        {{#url}}        <a href='{{url}}#id={{id}}'>        {{/url}}          <div style='overflow: auto; margin-top: 5px; margin-bottom: 5px;'>            <div class='Ldt-AnnotationsList-Caption'>              <img src='http://i.imgur.com/aoUlC.jpg'></img>            </div>            <div class='Ldt-AnnotationsList-Duration'>{{begin}} - {{end}}</div>            <div class='Ldt-AnnotationsList-Title'>{{title}}</div>            <div class='Ldt-AnnotationsList-Description'>{{desc}}</div>          </div>        </a>      </li>    {{/annotations}}    </ul>  </div></div>";
 IriSP.arrowWidget_template = "<div class='Ldt-arrowWidget'></div>";
-IriSP.createAnnotationWidget_template = "{{! template for the annotation creation widget }}<div class='Ldt-createAnnotationWidget'>  <!-- ugly div because we want to have a double border -->  <div class='Ldt-createAnnotation-DoubleBorder'>    <div class='Ldt-createAnnotation-startScreen'>      <div style='margin-bottom: 7px; overflow: auto;'>        <div class='Ldt-createAnnotation-Title'></div>        <div class='Ldt-createAnnotation-TimeFrame'></div>      </div>            <div class='Ldt-createAnnotation-Container'>        <textarea class='Ldt-createAnnotation-Description'></textarea>        <div class='Ldt-createAnnotation-profileArrow'>          <img src='{{img_dir}}/annotate_arrow.png'></img>        </div>        <div class='Ldt-createAnnotation-userAvatar'>                  <img src='https://si0.twimg.com/sticky/default_profile_images/default_profile_1_normal.png'></img>        </div>      </div>            <div class='Ldt-createAnnotation-keywords'>        Add keywords :             </div>                <div class='Ldt-createAnnotation-submitButton'>        <div style='position: absolute; bottom: 10pt; right: 11pt;'>Submit</div>      </div>    </div>    <div class='Ldt-createAnnotation-waitScreen' style='display: none; text-align: center'>      <img src='{{img_dir}}/spinner.gif'></img>      Please wait while your request is being processed...    </div>        <div class='Ldt-createAnnotation-endScreen' style='display: none'>      Thank you, your annotation has been saved.<br>      Would you like to share it on social networks ?      <div style='margin-top: 12px; text-align: center;'>          <a target='_blank' class='Ldt-createAnnotation-endScreen-TweetLink'><img src='{{img_dir}}/tweet_button.png' style='margin-right: 20px;'></img></a>          <a target='_blank' class='Ldt-createAnnotation-endScreen-FbLink'><img src='{{img_dir}}/facebook_button.png' style='margin-right: 20px;'></img></a>          <a target='_blank' class='Ldt-createAnnotation-endScreen-GplusLink'><img src='{{img_dir}}/gplus_button.png' style='margin-right: 20px;'></img></a>                          </div>    </div>  </div></div>";
+IriSP.createAnnotationWidget_template = "{{! template for the annotation creation widget }}<div class='Ldt-createAnnotationWidget'>  <!-- ugly div because we want to have a double border -->  <div class='Ldt-createAnnotation-DoubleBorder'>    <div class='Ldt-createAnnotation-startScreen'>      <div style='margin-bottom: 7px; overflow: auto;'>        <div class='Ldt-createAnnotation-Title'></div>        <div class='Ldt-createAnnotation-TimeFrame'></div>        {{^cinecast_version}}          <img src='{{img_dir}}/minimize.png' class='Ldt-createAnnotation-Minimize' alt='Cancel'></img>        {{/cinecast_version}}      </div>            <div class='Ldt-createAnnotation-Container'>        <textarea class='Ldt-createAnnotation-Description'></textarea>        <div class='Ldt-createAnnotation-profileArrow'>          <img src='{{img_dir}}/annotate_arrow.png'></img>        </div>        <div class='Ldt-createAnnotation-userAvatar'>                  <img src='https://si0.twimg.com/sticky/default_profile_images/default_profile_1_normal.png'></img>        </div>      </div>            <div class='Ldt-createAnnotation-keywords'>        Add keywords :             </div>      {{#polemic_mode}}      <div class='Ldt-createAnnotation-polemics'>        Add polemic keywords           </div>      {{/polemic_mode}}      <div class='Ldt-createAnnotation-submitButton'>        <div style='position: absolute; bottom: 10pt; right: 11pt;'>Submit</div>      </div>    </div>    <div class='Ldt-createAnnotation-waitScreen' style='display: none; text-align: center'>      <img src='{{img_dir}}/spinner.gif'></img>      Please wait while your request is being processed...    </div>        <div class='Ldt-createAnnotation-endScreen' style='display: none'>      Thank you, your annotation has been saved.<br>      Would you like to share it on social networks ?      <div style='margin-top: 12px; text-align: center;'>          <a target='_blank' class='Ldt-createAnnotation-endScreen-TweetLink'><img src='{{img_dir}}/tweet_button.png' style='margin-right: 20px;'></img></a>          <a target='_blank' class='Ldt-createAnnotation-endScreen-FbLink'><img src='{{img_dir}}/facebook_button.png' style='margin-right: 20px;'></img></a>          <a target='_blank' class='Ldt-createAnnotation-endScreen-GplusLink'><img src='{{img_dir}}/gplus_button.png' style='margin-right: 20px;'></img></a>                          </div>    </div>  </div></div>";
 IriSP.createAnnotationWidget_festivalCinecast_template = "{{! template for the annotation creation widget specific for the cinecast festival}}<div class='Ldt-createAnnotationWidget'>  <!-- ugly div because we want to have a double border -->  <div class='Ldt-createAnnotation-DoubleBorder'>    <div style='margin-bottom: 7px; overflow: auto;'>      <div class='Ldt-createAnnotation-Title'></div>      <div class='Ldt-createAnnotation-TimeFrame'></div>    </div>        <div class='Ldt-createAnnotation-Container'>      <textarea class='Ldt-createAnnotation-Description'></textarea>      <div class='Ldt-createAnnotation-profileArrow'>        <img src='{{img_dir}}/annotate_arrow.png'></img>      </div>      <div class='Ldt-createAnnotation-userAvatar'>                <img src='https://si0.twimg.com/sticky/default_profile_images/default_profile_1_normal.png'></img>      </div>    </div>        <div class='Ldt-createAnnotation-keywords'>      Add keywords :           </div>              <div class='Ldt-createAnnotation-submitButton'>      <div style='position: absolute; bottom: 10pt; right: 11pt;'>Submit</div>    </div>        <div class='Ldt-createAnnotation-endScreen' style='display: none'>      Thank you, your annotation has been saved.<br>      Would you like to share it on social networks ?      <div style='margin-top: 12px; text-align: center;'>          <a target='_blank' class='Ldt-createAnnotation-endScreen-TweetLink'><img src='{{img_dir}}/tweet_button.png' style='margin-right: 20px;'></img></a>          <a target='_blank' class='Ldt-createAnnotation-endScreen-FbLink'><img src='{{img_dir}}/facebook_button.png' style='margin-right: 20px;'></img></a>          <a target='_blank' class='Ldt-createAnnotation-endScreen-GplusLink'><img src='{{img_dir}}/gplus_button.png' style='margin-right: 20px;'></img></a>                          </div>    </div>  </div></div>";
 IriSP.createAnnotation_errorMessage_template = "<p class='Ldt-createAnnotation-errorMessage'>  You must enter text to submit an annotation</p>";
 IriSP.overlay_marker_template = "{{! the template for the small bars which is z-indexed over our segment widget }}<div class='Ldt-SegmentPositionMarker' style='background-color: #F7268E;'></div>";
@@ -1098,208 +1098,7 @@
 IriSP.sliderWidget_template = "{{! template for the slider widget - it's composed of two divs we one overlayed on top    of the other }}<div class='Ldt-sliderBackground'></div><div class='Ldt-sliderForeground'></div><div class='Ldt-sliderPositionMarker'></div>";
 IriSP.tooltip_template = "{{! template used by the jquery ui tooltip }}<div class='Ldt-tooltip'>  <div class='title'>{{title}}</div>  <div class='time'>{{begin}} : {{end}} </div>  <div class='description'>{{description}}</div></div>";
 IriSP.tooltipWidget_template = "{{! template for the tooltip widget }}<div class='tip'>	<div class='tipcolor' style='height:10px;width:10px'></div>	<div class='tiptext'></div>";
-IriSP.tweetWidget_template = "{{! template for the tweet widget }}<div class='Ldt-tweetWidget'>  <div class='Ldt-tweet-DoubleBorder'>      <img src='{{img_dir}}/minimize.png' class='Ldt-tweetWidgetKeepOpen' alt='dont minimize automatically'></img>      <img src='{{img_dir}}/minimize.png' class='Ldt-tweetWidgetMinimize' alt='minimize window'></img>      <div class='Ldt-tweetAvatar'></div>      <img src='{{img_dir}}/profile_arrow.png' class='Ldt-tweetAvatar-profileArrow'></img>      <div class='Ldt-tweetContents'></div>      <a href='' target='_blank' class='Ldt-Retweet'><div class='Ldt-RetweetIcon'></div> - Retweet </a>      <a href='' target='_blank' class='Ldt-TweetReply'><div class='Ldt-TweetReplyIcon'></div> - Reply</a>  </div></div>";/* wrapper that simulates popcorn.js because
-   popcorn is a bit unstable at the time */
-
-IriSP.PopcornReplacement = {
-  msgPump : {} /* used by jquery to receive and send messages */,
-  __delay_seek_signal : false
-};
-
-IriSP.PopcornReplacement.media = { 
-  "paused": true,
-  "muted": false
-};
-
-IriSP.PopcornReplacement.listen = function(msg, callback) {
-//  IriSP.jQuery(IriSP.PopcornReplacement.msgPump).bind(msg, function(event, rest) { callback(rest); });
-  if (!IriSP.PopcornReplacement.msgPump.hasOwnProperty(msg))
-    IriSP.PopcornReplacement.msgPump[msg] = [];
-
-  IriSP.PopcornReplacement.msgPump[msg].push(callback);
-};
-
-IriSP.PopcornReplacement.trigger = function(msg, params) {
-//  IriSP.jQuery(IriSP.PopcornReplacement.msgPump).trigger(msg, params);
-  
-  if (!IriSP.PopcornReplacement.msgPump.hasOwnProperty(msg))
-    return;
-
-  var d = IriSP.PopcornReplacement.msgPump[msg];
-
-  for(var i = 0; i < d.length; i++) {
-    d[i].call(window, params);
-  }
-
-};
-
-IriSP.PopcornReplacement.guid = function(prefix) {
-  var str = 'xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx'.replace(/[xy]/g, function(c) {
-      var r = Math.random()*16|0, v = c == 'x' ? r : (r&0x3|0x8);
-      return v.toString(16);
-   });
-
-  return prefix + str;
-};
-
-IriSP.PopcornReplacement.__initApi = function() {
-  IriSP.PopcornReplacement.trigger("loadedmetadata"); // we've done more than loading metadata of course,
-                                                      // but popcorn doesn't need to know more.
-  IriSP.PopcornReplacement.media.muted = jwplayer(IriSP.PopcornReplacement._container).getMute();
-  
-  /* some programmed segments are supposed to be run at the beginning */
-  var i = 0;
-  for(i = 0; i < IriSP.PopcornReplacement.__codes.length; i++) {
-    var c = IriSP.PopcornReplacement.__codes[i];
-    if (0 == c.start) {
-      c.onStart();
-    }
-    
-    if (0 == c.end) {
-      c.onEnd();
-    }
-  }
-};
-
-IriSP.PopcornReplacement.jwplayer = function(container, options) {
-  IriSP.PopcornReplacement._container = container.slice(1); //eschew the '#'
-  options.events = {
-      onReady: IriSP.PopcornReplacement.__initApi,
-      onTime: IriSP.PopcornReplacement.__timeHandler,
-      onPlay: IriSP.PopcornReplacement.__playHandler,
-      onPause: IriSP.PopcornReplacement.__pauseHandler,
-      onSeek: IriSP.PopcornReplacement.__seekHandler 
-      }
-    
-  jwplayer(IriSP.PopcornReplacement._container).setup(options);
-  IriSP.PopcornReplacement.media.duration = options.duration;
-  return IriSP.PopcornReplacement;
-};
-
-IriSP.PopcornReplacement.currentTime = function(time) {
-  if (typeof(time) === "undefined") {        
-      return jwplayer(IriSP.PopcornReplacement._container).getPosition();            
-  } else {
-     var currentTime = +time;
-     jwplayer( IriSP.PopcornReplacement._container ).seek( currentTime );
-     IriSP.PopcornReplacement.__delay_seek_signal = true;     
-     IriSP.PopcornReplacement.trigger("seeked");           
-     return currentTime;
-  }
-};
-
-IriSP.PopcornReplacement.play = function() {
-      IriSP.PopcornReplacement.media.paused = false;
-      IriSP.PopcornReplacement.trigger("play");
-//      IriSP.PopcornReplacement.trigger("playing");
-      jwplayer( IriSP.PopcornReplacement._container ).play();
-};
-    
-IriSP.PopcornReplacement.pause = function() {
-      if ( !IriSP.PopcornReplacement.media.paused ) {
-        IriSP.PopcornReplacement.media.paused = true;
-        IriSP.PopcornReplacement.trigger( "pause" );
-        jwplayer( IriSP.PopcornReplacement._container ).pause();
-      }
-};
-
-IriSP.PopcornReplacement.muted = function(val) {
-  if (typeof(val) !== "undefined") {
-
-    if (jwplayer(IriSP.PopcornReplacement._container).getMute() !== val) {
-      if (val) {
-        jwplayer(IriSP.PopcornReplacement._container).setMute(true);
-        IriSP.PopcornReplacement.media.muted = true;
-      } else {
-        jwplayer( IriSP.PopcornReplacement._container ).setMute(false);
-        IriSP.PopcornReplacement.media.muted = false;
-      }
-
-      IriSP.PopcornReplacement.trigger( "volumechange" );
-    }
-    
-    return jwplayer( IriSP.PopcornReplacement._container ).getMute();
-  } else {
-    return jwplayer( IriSP.PopcornReplacement._container ).getMute();
-  }
-};
-
-IriSP.PopcornReplacement.mute = IriSP.PopcornReplacement.muted;
-
-IriSP.PopcornReplacement.__codes = [];
-IriSP.PopcornReplacement.code = function(options) {
-  IriSP.PopcornReplacement.__codes.push(options);
-  return IriSP.PopcornReplacement;
-};
-
-/* called everytime the player updates itself 
-   (onTime event)
- */
-
-IriSP.PopcornReplacement.__timeHandler = function(event) {
-  var pos = event.position;
-  
-  var i = 0;
-  for(i = 0; i < IriSP.PopcornReplacement.__codes.length; i++) {
-     var c = IriSP.PopcornReplacement.__codes[i];
-
-     if (pos >= c.start && pos < c.end && 
-         pos - 1 <= c.start) {       
-        c.onStart();
-     }
- 
-     if (pos > c.start && pos > c.end && 
-         pos - 1 <= c.end) {
-         c.onEnd();
-     }
-   
-  }
- 
-  IriSP.PopcornReplacement.trigger("timeupdate");
-};
-
-IriSP.PopcornReplacement.__seekHandler = function(event) {
-  var i = 0;
-  
-  for(i = 0; i < IriSP.PopcornReplacement.__codes.length; i++) {
-     var c = IriSP.PopcornReplacement.__codes[i];
-    
-     if (event.position >= c.start && event.position < c.end) {        
-        c.onEnd();
-     }         
-   }
-  
-   for(i = 0; i < IriSP.PopcornReplacement.__codes.length; i++) {
-     var c = IriSP.PopcornReplacement.__codes[i];
-
-     if (typeof(event.offset) === "undefined")
-       event.offset = 0;
-           
-     if (event.offset >= c.start && event.offset < c.end) { 
-       c.onStart();
-     }
-     
-   }
-
-  IriSP.PopcornReplacement.trigger("timeupdate");
-};
-
-
-IriSP.PopcornReplacement.__playHandler = function(event) {
-  IriSP.PopcornReplacement.media.paused = false;
-  IriSP.PopcornReplacement.trigger("play");
-};
-
-IriSP.PopcornReplacement.__pauseHandler = function(event) {
-  IriSP.PopcornReplacement.media.paused = true;
-  IriSP.PopcornReplacement.trigger("pause");
-};
-
-IriSP.PopcornReplacement.roundTime = function() {
-  var currentTime = IriSP.PopcornReplacement.currentTime();
-  return Math.round(currentTime);
-};
-/* utils.js - various utils that don't belong anywhere else */
+IriSP.tweetWidget_template = "{{! template for the tweet widget }}<div class='Ldt-tweetWidget'>  <div class='Ldt-tweet-DoubleBorder'>      <img src='{{img_dir}}/minimize.png' class='Ldt-tweetWidgetKeepOpen' alt='dont minimize automatically'></img>      <img src='{{img_dir}}/minimize.png' class='Ldt-tweetWidgetMinimize' alt='minimize window'></img>      <div class='Ldt-tweetAvatar'></div>      <img src='{{img_dir}}/profile_arrow.png' class='Ldt-tweetAvatar-profileArrow'></img>      <div class='Ldt-tweetContents'></div>      <a href='' target='_blank' class='Ldt-Retweet'><div class='Ldt-RetweetIcon'></div> - Retweet </a>      <a href='' target='_blank' class='Ldt-TweetReply'><div class='Ldt-TweetReplyIcon'></div> - Reply</a>  </div></div>";/* utils.js - various utils that don't belong anywhere else */
 
 /* trace function, for debugging */
 
@@ -1450,7 +1249,7 @@
 
 /** returns an url to share on google + */
 IriSP.mkGplusUrl = function(url, text) {
-  return "";
+  return "https://plusone.google.com/_/+1/confirm?hl=en&url=" + IriSP.shorten_url(url);
 };
 
 /** test if a value is null or undefined */
@@ -1482,7 +1281,223 @@
    }
 }
 */
-/* data.js - this file deals with how the players gets and sends data */
+/* wrapper that simulates popcorn.js because
+   popcorn is a bit unstable at the time */
+
+IriSP.PopcornReplacement = {  
+};
+
+/** base class for our popcorn-compatible players.
+ */
+IriSP.PopcornReplacement.player = function(container, options) {
+  /* the jwplayer calls the callbacks in the global space so we need to 
+     preserve them using IriSP.wrap */
+  this.callbacks = {
+      onReady:  IriSP.wrap(this, this.__initApi),
+      onTime:   IriSP.wrap(this, this.__timeHandler),
+      onPlay:   IriSP.wrap(this, this.__playHandler),
+      onPause:  IriSP.wrap(this, this.__pauseHandler),
+      onSeek:   IriSP.wrap(this, this.__seekHandler) 
+  };
+  
+  this.media = { 
+    "paused": true,
+    "muted": false
+  };
+    
+  this.container = container.slice(1); //eschew the '#'
+  
+  this.msgPump = {}; /* dictionnary used to receive and send messages */
+  this.__codes = []; /* used to schedule the execution of a piece of code in 
+                        a segment (similar to the popcorn.code plugin). */
+                          
+};
+
+IriSP.PopcornReplacement.player.prototype.listen = function(msg, callback) {
+  if (!this.msgPump.hasOwnProperty(msg))
+    this.msgPump[msg] = [];
+
+  this.msgPump[msg].push(callback);
+};
+
+IriSP.PopcornReplacement.player.prototype.trigger = function(msg, params) {
+  if (!this.msgPump.hasOwnProperty(msg))
+    return;
+
+  var d = this.msgPump[msg];
+
+  for(var i = 0; i < d.length; i++) {
+    d[i].call(window, params);
+  }
+
+};
+
+IriSP.PopcornReplacement.player.prototype.guid = function(prefix) {
+  var str = 'xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx'.replace(/[xy]/g, function(c) {
+      var r = Math.random()*16|0, v = c == 'x' ? r : (r&0x3|0x8);
+      return v.toString(16);
+   });
+
+  return prefix + str;
+};
+
+/** init the api after that flash player has been setup - called by the callback
+    defined by the embedded flash player 
+*/
+IriSP.PopcornReplacement.player.prototype.__initApi = function() {
+  this.trigger("loadedmetadata"); // we've done more than loading metadata of course,
+                                                      // but popcorn doesn't need to know more.
+  this.media.muted = this.playerFns.getMute();
+  /* some programmed segments are supposed to be run at the beginning */
+  var i = 0;
+  for(i = 0; i < this.__codes.length; i++) {
+    var c = this.__codes[i];
+    if (0 == c.start) {
+      c.onStart();
+    }
+    
+    if (0 == c.end) {
+      c.onEnd();
+    }
+  }
+};
+
+/*
+IriSP.PopcornReplacement.jwplayer = function(container, options) {
+  IriSP.PopcornReplacement._container = container.slice(1); //eschew the '#'
+  options.events = {
+      onReady: IriSP.PopcornReplacement.__initApi,
+      onTime: IriSP.PopcornReplacement.__timeHandler,
+      onPlay: IriSP.PopcornReplacement.__playHandler,
+      onPause: IriSP.PopcornReplacement.__pauseHandler,
+      onSeek: IriSP.PopcornReplacement.__seekHandler 
+      }
+    
+  jwplayer(IriSP.PopcornReplacement._container).setup(options);
+  IriSP.PopcornReplacement.media.duration = options.duration;
+  return IriSP.PopcornReplacement;
+};
+*/
+
+IriSP.PopcornReplacement.player.prototype.currentTime = function(time) {
+  if (typeof(time) === "undefined") {        
+      return this.playerFns.getPosition();            
+  } else {
+     var currentTime = +time;
+     this.playerFns.seek(currentTime);              
+     return currentTime;
+  }
+};
+
+IriSP.PopcornReplacement.player.prototype.play = function() {
+  this.media.paused = false;
+  this.trigger("play");
+  //IriSP.PopcornReplacement.trigger("playing");
+  this.playerFns.play();
+};
+    
+IriSP.PopcornReplacement.player.prototype.pause = function() {
+  if ( !this.media.paused ) {
+    this.media.paused = true;
+    this.trigger( "pause" );
+    this.playerFns.pause();
+  }
+};
+
+IriSP.PopcornReplacement.player.prototype.muted = function(val) {
+  if (typeof(val) !== "undefined") {
+
+    if (this.playerFns.getMute() !== val) {
+      if (val) {
+        this.playerFns.setMute(true);
+        this.media.muted = true;
+      } else {
+        this.playerFns.setMute(false);
+        this.media.muted = false;
+      }
+
+      this.trigger( "volumechange" );
+    }
+    
+    return this.playerFns.getMute();
+  } else {
+    return this.playerFns.getMute();
+  }
+};
+
+IriSP.PopcornReplacement.player.prototype.mute = IriSP.PopcornReplacement.player.prototype.muted;
+
+IriSP.PopcornReplacement.player.prototype.code = function(options) {
+  this.__codes.push(options);
+  return this;
+};
+
+/* called everytime the player updates itself 
+   (onTime event)
+ */
+
+IriSP.PopcornReplacement.player.prototype.__timeHandler = function(event) {
+  var pos = event.position;
+
+  var i = 0;
+  for(i = 0; i < this.__codes.length; i++) {
+     var c = this.__codes[i];
+
+     if (pos >= c.start && pos < c.end && 
+         pos - 1 <= c.start) {       
+        c.onStart();
+     }
+ 
+     if (pos > c.start && pos > c.end && 
+         pos - 1 <= c.end) {
+         c.onEnd();
+     }
+   
+  }
+ 
+  this.trigger("timeupdate");
+};
+
+IriSP.PopcornReplacement.player.prototype.__seekHandler = function(event) {
+  var i = 0;
+  
+  for(i = 0; i < this.__codes.length; i++) {
+     var c = this.__codes[i];
+    
+     if (event.position >= c.start && event.position < c.end) {        
+        c.onEnd();
+     }         
+   }
+  
+   for(i = 0; i < this.__codes.length; i++) {
+     var c = this.__codes[i];
+
+     if (typeof(event.offset) === "undefined")
+       event.offset = 0;
+           
+     if (event.offset >= c.start && event.offset < c.end) { 
+       c.onStart();
+     }
+     
+   }
+  
+  this.trigger("seeked");  
+};
+
+IriSP.PopcornReplacement.player.prototype.__playHandler = function(event) {
+  this.media.paused = false;
+  this.trigger("play");
+};
+
+IriSP.PopcornReplacement.player.prototype.__pauseHandler = function(event) {
+  this.media.paused = true;
+  this.trigger("pause");
+};
+
+IriSP.PopcornReplacement.player.prototype.roundTime = function() {
+  var currentTime = this.currentTime();
+  return Math.round(currentTime);
+};/* data.js - this file deals with how the players gets and sends data */
 
 IriSP.DataLoader = function() {
   this._cache = {};
@@ -1637,7 +1652,13 @@
       minimize_period: 850 // how long does the slider stays maximized after the user leaves the zone ?
   },
   "createAnnotationWidget" : {
-      keywords: ["#faux-raccord", "#mot-clef"],
+      keywords: ["#faux-raccord", "#mot-clef"],      
+      polemic_mode: true, /* enable polemics ? */
+      /* polemics - the corresponding class names defined in the css should be for instance :
+         Ldt-createAnnotation-polemic-positive for positive
+         Ldt-createAnnotation-polemic-reference for reference, etc.
+      */
+      polemics: {"++" : "positive", "--" : "negative", "==" : "reference", "??" : "question"}, 
       cinecast_version: true /* put to false to enable the platform version, true for the festival cinecast one. */
   },
   "SparklineWidget" : {
@@ -1655,8 +1676,11 @@
                                                                          where to
                                                                          get the 
                                                                          ajax */
-      ajax_granularity: 10000 /* how much ms should we look before and after the
+      ajax_granularity: 10000, /* how much ms should we look before and after the
                                  current timecode */
+      project_url: IriSP.platform_url + "/ldtplatform/ldt/front/player/" /* the beginning 
+                                                                            of a link to the
+                                                                            new front */
   }, 
 };
 
@@ -2001,14 +2025,15 @@
           delete opts.container;
           delete opts.type;
 
-          if (options.provider === "rtmp") {
+          
+          /* Try to guess options.file and options.streamer only if file and streamer
+             are not already defined in the configuration */
+          if (options.provider === "rtmp" && !opts.hasOwnProperty("file") && !opts.hasOwnProperty("streamer")) {
             /* exit if we can't access the metadata */
             if (typeof(IriSP.__jsonMetadata) === "undefined") {
                 break;
             };
 
-
-             
             // the json format is totally illogical
             //opts.streamer = IriSP.__jsonMetadata["medias"][0]["meta"]["item"]["value"];
             //var source = IriSP.__jsonMetadata["medias"][0]["href"];
@@ -2035,8 +2060,7 @@
                  if (i < pathSplit.length - 1)
                   opts.file += "/";
               }
-            }
-
+            }            
           } else {
             /* other providers type, video for instance -
                pass everything as is */
@@ -2050,7 +2074,7 @@
             opts["controlbar.position"] = "none";
           }
 
-          pop = IriSP.PopcornReplacement.jwplayer("#" + containerDiv, opts);
+          pop = new IriSP.PopcornReplacement.jwplayer("#" + containerDiv, opts);
         break;
       
       case "youtube":
@@ -2066,6 +2090,11 @@
           pop = Popcorn.youtube("#" + containerDiv, opts.video, opts);
         break;
         
+      case "allocine":
+          /* pass the options as-is to the allocine player and let it handle everything */
+          pop = new IriSP.PopcornReplacement.allocine("#" + containerDiv, options);
+          break;
+          
       default:
         pop = undefined;
     };
@@ -2156,6 +2185,33 @@
     serializer.sync(IriSP.wrap(widget, function() { this.draw(); }));
     return widget;
 };
+/* To wrap a player the develop should create a new class derived from 
+   the IriSP.PopcornReplacement.player and defining the correct functions */
+
+/** jwplayer player wrapper */
+IriSP.PopcornReplacement.jwplayer = function(container, options) {
+
+  /* appel du parent pour initialiser les structures communes à tous les players */
+  IriSP.PopcornReplacement.player.call(this, container, options);
+  
+  this.media.duration = options.duration; /* optional */
+  
+  /* Définition des fonctions de l'API -  */
+  this.playerFns = {
+    play: function() { return jwplayer(this.container).play(); },
+    pause: function() { return jwplayer(this.container).pause(); },
+    getPosition: function() { return jwplayer(this.container).getPosition(); },
+    seek: function(pos) { return jwplayer(this.container).seek(pos); },
+    getMute: function() { return jwplayer(this.container).getMute() },
+    setMute: function(p) { return jwplayer(this.container).setMute(p); }
+  }
+
+  options.events = this.callbacks;
+
+  jwplayer(this.container).setup(options);
+};
+
+IriSP.PopcornReplacement.jwplayer.prototype = new IriSP.PopcornReplacement.player("", {});
 /* mediafragment module */
 
 IriSP.MediaFragment = function(Popcorn, config, Serializer) {
@@ -2257,6 +2313,7 @@
   this.__oldList = [];
   
   this.ajax_mode = IriSP.widgetsDefaults["AnnotationsListWidget"].ajax_mode;
+  this.project_url = IriSP.widgetsDefaults["AnnotationsListWidget"].project_url;  
 };
 
 
@@ -2374,10 +2431,11 @@
   var view_types = serializer.getIds("Contributions");
   var l = [];
   
+  var media = this._serializer.currentMedia()["id"];
+  
   for (i = 0; i < annotations.length; i++) {
       var annotation = annotations[i];
-      console.log(annotation);
-      console.log(view_types, annotation.meta["id-ref"]);
+
       /* filter the annotations whose type is not the one we want */
       /* We want _all_ the annotations.
       if (typeof(annotation.meta) !== "undefined" && typeof(annotation.meta["id-ref"]) !== "undefined"
@@ -2393,21 +2451,46 @@
       obj["desc"] = a.content.description;
       obj["begin"] = IriSP.msToTime(annotation.begin);
       obj["end"] = IriSP.msToTime(annotation.end);
-      obj["url"] = document.location.href.split("#")[0] + "/" + annotation.meta["project"];
+
+      /* only if the annotation isn't present in the document create an
+         external link */
+      if (!this.annotations_ids.hasOwnProperty(obj["id"])) {
+        // braindead url; jacques didn't want to create a new one in the platform,
+        // so we append the cutting id to the url.
+        obj["url"] = this.project_url + "/" + media + "/" + 
+                     annotation.meta["project"] + "/" +
+                     annotation.meta["id-ref"] + "/";
+        
+        // obj["url"] = document.location.href.split("#")[0] + "/" + annotation.meta["project"];
+      }
+      
       l.push(obj);
   }
-  console.log(l);
+
   this.do_redraw(l);
 };
 IriSP.AnnotationsListWidget.prototype.draw = function() {
-
+  
+  /* build a table of the annotations present in the document for faster 
+     lookup
+  */
+  this.annotations_ids = {};
+  
+  var annotations = this._serializer._data.annotations;
+  var i = 0;
+  for(i = 0; i < annotations.length; i++) {
+    this.annotations_ids[annotations[i]["id"]] = 1;
+  }
+  
   this.drawList();
     
   if (!this.ajax_mode) {    
     this._Popcorn.listen("IriSP.createAnnotationWidget.addedAnnotation", IriSP.wrap(this, function() { this.drawList(true); }));
     this._Popcorn.listen("timeupdate", IriSP.wrap(this, this.redraw));
   } else {
+    /* update the widget when the video has finished loading and when it's seeked and paused */
     this._Popcorn.listen("seeked", IriSP.wrap(this, this.ajaxRedraw));
+    this._Popcorn.listen("loadedmetadata", IriSP.wrap(this, this.ajaxRedraw));
     this._Popcorn.listen("paused", IriSP.wrap(this, this.ajaxRedraw));
   }
 
@@ -2605,6 +2688,10 @@
   IriSP.Widget.call(this, Popcorn, config, Serializer);
   this._hidden = true;
   this.keywords = IriSP.widgetsDefaults["createAnnotationWidget"].keywords;
+  
+  this.polemic_mode = IriSP.widgetsDefaults["createAnnotationWidget"].polemic_mode;
+  this.polemics = IriSP.widgetsDefaults["createAnnotationWidget"].polemics;
+  
   this.cinecast_version = IriSP.widgetsDefaults["createAnnotationWidget"].cinecast_version;
   this.ids = {}; /* a dictionnary linking buttons ids to keywords */
   
@@ -2627,7 +2714,9 @@
 IriSP.createAnnotationWidget.prototype.draw = function() {
   var _this = this;
 
-  var annotationMarkup = IriSP.templToHTML(IriSP.createAnnotationWidget_template);
+  var annotationMarkup = IriSP.templToHTML(IriSP.createAnnotationWidget_template, 
+                                           {cinecast_version: this.cinecast_version, 
+                                            polemic_mode: this.polemic_mode});
   
 	this.selector.append(annotationMarkup);
   
@@ -2661,10 +2750,43 @@
       // change in a textfield.
       _this.selector.find(".Ldt-createAnnotation-Description").trigger("js_mod");
       // also call our update function.
-      _this.handleTextChanges();
+      //_this.handleTextChanges();
     }
    }(keyword));
   }
+
+  // add the polemic buttons.
+  if(this.polemic_mode)
+    for (var polemic in this.polemics) {
+
+      var classname = IriSP.templToHTML("Ldt-createAnnotation-polemic-{{classname}}", {classname : this.polemics[polemic]});
+
+      var templ = IriSP.templToHTML("<button class='{{classname}} Ldt-createAnnotation-polemic-button'>{{polemic}}</button>",
+                  {classname: classname, polemic: polemic});
+                  
+      this.selector.find(".Ldt-createAnnotation-polemics").append(templ);
+      this.selector.find("." + classname).click(function(polemic) { return function() {
+          var contents = _this.selector.find(".Ldt-createAnnotation-Description").val();
+          if (contents.indexOf(polemic) != -1) {
+            var newVal = contents.replace(" " + polemic, "");
+            if (newVal == contents)
+              newVal = contents.replace(polemic, "");
+          } else {
+            if (contents === "")
+              var newVal = polemic;
+            else
+              var newVal = contents + " " + polemic;      
+          }
+          
+          _this.selector.find(".Ldt-createAnnotation-Description").val(newVal);
+          // we use a custom event because there's no simple way to test for a js
+          // change in a textfield.
+          _this.selector.find(".Ldt-createAnnotation-Description").trigger("js_mod");
+          // also call our update function.
+          _this.handleTextChanges();
+        }
+       }(polemic));
+      }    
   
   this.selector.find(".Ldt-createAnnotation-Description")
                .bind("propertychange keyup input paste", IriSP.wrap(this, this.handleTextChanges));
@@ -2699,6 +2821,7 @@
       
       code = {start: annotation.begin / 1000, end: annotation.end / 1000,
               onStart: function(annotation) { return function() {
+                      console.log("runned ?", annotation);
                       if (typeof(annotation.content) !== "undefined")
                         _this.selector.find(".Ldt-createAnnotation-Title").html(annotation.content.title);
 
@@ -2716,9 +2839,20 @@
   
   this.selector.find(".Ldt-createAnnotation-submitButton").click(IriSP.wrap(this, this.handleButtonClick));
   
-  if (!this.cinecast_version)
+  if (!this.cinecast_version) {
     this._Popcorn.listen("IriSP.PlayerWidget.AnnotateButton.clicked", 
-                          IriSP.wrap(this, this.handleAnnotateSignal));  
+                          IriSP.wrap(this, this.handleAnnotateSignal));
+    
+    // handle clicks on the cancel button too.
+    this.selector.find(".Ldt-createAnnotation-Minimize").click(IriSP.wrap(this, 
+      function() {
+        // we've got to simulate the pressing of the button because there's no
+        // other way to minimize the widget and show the widgets that were hidden
+        // same time
+        this._Popcorn.trigger("IriSP.PlayerWidget.AnnotateButton.clicked");
+      }
+    ));
+  }
 };
 
 /** handles clicks on the annotate button. Works only for the non-cinecast version */
@@ -2757,6 +2891,14 @@
     this._Popcorn.trigger("IriSP.SliceWidget.position", [left, width]);
     this._Popcorn.listen("IriSP.SliceWidget.zoneChange", IriSP.wrap(this, this.handleSliderChanges));
     this._Popcorn.trigger("IriSP.SliceWidget.show");
+    
+    this.selector.find(".Ldt-createAnnotation-Title").html(currentChapter.content.title);
+
+    this._currentcurrentChapter = currentChapter;
+    var beginTime = IriSP.msToTime(currentChapter.begin);
+    var endTime = IriSP.msToTime(currentChapter.end);
+    var timeTemplate = IriSP.templToHTML("- ({{begin}} - {{ end }})", {begin: beginTime, end: endTime });
+    this.selector.find(".Ldt-createAnnotation-TimeFrame").html(timeTemplate);
   }
 };
 
@@ -2782,6 +2924,20 @@
       }
     }
   }
+  
+  if (this.polemic_mode) {
+    /* Also go through the polemics to highlight the buttons */
+    for (var polemic in this.polemics) {
+      /* Add the active class to the button */
+      var classname = "Ldt-createAnnotation-polemic-" + this.polemics[polemic];
+      if (contents.indexOf(polemic) != -1) {        
+        this.selector.find("." + classname).addClass("Ldt-createAnnotation-polemic-active");
+      } else {
+        if (this.selector.find("." + classname).addClass("Ldt-createAnnotation-polemic-active"))
+          this.selector.find("." + classname).removeClass("Ldt-createAnnotation-polemic-active")
+      }
+    }
+  }
 };
 
 IriSP.createAnnotationWidget.prototype.showStartScreen = function() {
@@ -2802,7 +2958,7 @@
     this.selector.find(".Ldt-createAnnotation-Title").parent().show();      
   }
 
-  var url = document.location.href + "id=" + annotation.id;
+  var url = document.location.href + "#id=" + annotation.id;
   var twStatus = IriSP.mkTweetUrl(url);
   var gpStatus = IriSP.mkGplusUrl(url);
   var fbStatus = IriSP.mkFbUrl(url);