diff -r b3ee7d1b472a -r 64c2eaafe5e2 src/widgets/Annotation.js
--- a/src/widgets/Annotation.js Fri Jun 29 16:22:52 2012 +0200
+++ b/src/widgets/Annotation.js Thu Jul 05 19:08:13 2012 +0200
@@ -1,4 +1,4 @@
-// TODO: Open share links in a small window - Migrate Timeupdate functions to Extract
+// TODO: Migrate Timeupdate functions to Extract
IriSP.Widgets.Annotation = function(player, config) {
IriSP.Widgets.Widget.call(this, player, config);
@@ -11,8 +11,6 @@
IriSP.Widgets.Annotation.prototype.messages = {
fr: {
- share_: "Partager :",
- share_on: "Partager sur",
watching: "Je regarde ",
on_site: " sur ",
tags_: "Mots-clés :",
@@ -20,8 +18,6 @@
excerpt_from: "Extrait de :"
},
en: {
- share_: "Share:",
- share_on: "Share on",
watching: "I'm watching ",
on_site: " on ",
tags_: "Keywords:",
@@ -34,6 +30,7 @@
'
';
+ + '';
IriSP.Widgets.Annotation.prototype.defaults = {
annotation_type : "chap",
- start_minimized: false,
+ start_minimized: true,
show_top_border : false,
site_name : "Lignes de Temps"
}
IriSP.Widgets.Annotation.prototype.draw = function() {
this.renderTemplate();
+ this.insertSubwidget(this.$.find(".Ldt-Annotation-Social"), "socialWidget", { type: "Social" });
this.bindPopcorn("timeupdate","onTimeupdate");
this.bindPopcorn("IriSP.Annotation.hide","hide");
this.bindPopcorn("IriSP.Annotation.show","show");
@@ -102,7 +96,7 @@
return '' + _tag + '';
}).join("");
this.$.find(".Ldt-Annotation-Tags").html(_html);
- this.$.find(".Ldt-Annotation-Tags-Block").removeClass("Ldt-Annotation-NoTags");
+ this.$.find(".Ldt-Annotation-Tags-Block").removeClass("Ldt-Annotation-EmptyBlock");
/* Correct the empty tag bug */
this.$.find('.Ldt-Annotation-TagLabel').each(function() {
@@ -116,15 +110,15 @@
_this.player.popcorn.trigger("IriSP.search.triggeredSearch", IriSP.jQuery(this).text().replace(/(^\s+|\s+$)/g,''));
});
} else {
- this.$.find(".Ldt-Annotation-Tags-Block").hide();
+ this.$.find(".Ldt-Annotation-Tags-Block").addClass("Ldt-Annotation-EmptyBlock");
}
this.$.find(".Ldt-Annotation-Title").html(_annotation.title);
var _desc = _annotation.description.replace(/(^\s+|\s+$)/g,'');
if (_desc) {
- this.$.find(".Ldt-Annotation-Description-Block").show();
+ this.$.find(".Ldt-Annotation-Description-Block").removeClass("Ldt-Annotation-EmptyBlock");
this.$.find(".Ldt-Annotation-Description").html(_desc);
} else {
- this.$.find(".Ldt-Annotation-Description-Block").hide();
+ this.$.find(".Ldt-Annotation-Description-Block").addClass("Ldt-Annotation-EmptyBlock");
}
this.$.find(".Ldt-Annotation-Begin").html(_annotation.begin.toString());
this.$.find(".Ldt-Annotation-End").html(_annotation.end.toString());
@@ -136,9 +130,9 @@
} else {
this.$.find('.Ldt-Annotation-Inner').removeClass("Ldt-Annotation-isMashup");
}
- this.$.find(".Ldt-Annotation-Fb").attr("href", "http://www.facebook.com/share.php?" + IriSP.jQuery.param({ u: _url, t: _text }));
- this.$.find(".Ldt-Annotation-Twitter").attr("href", "https://twitter.com/intent/tweet?" + IriSP.jQuery.param({ url: _url, text: _text }));
- this.$.find(".Ldt-Annotation-Gplus").attr("href", "https://plusone.google.com/_/+1/confirm?" + IriSP.jQuery.param({ url: _url, title: _text }));
+ if (typeof this.socialWidget !== "undefined") {
+ this.socialWidget.updateUrls(_url, _text);
+ }
this.$.find(".Ldt-Annotation-Inner").removeClass("Ldt-Annotation-Empty");
}