# HG changeset patch
# User veltr
# Date 1341508093 -7200
# Node ID 64c2eaafe5e26be9a1c101b4d77d648d810bfb93
# Parent b3ee7d1b472a4e9df6fdc242d40eafbe5767e507
Modifications for LDT-Platform
diff -r b3ee7d1b472a -r 64c2eaafe5e2 assets/psd/socialbuttons.psd
Binary file assets/psd/socialbuttons.psd has changed
diff -r b3ee7d1b472a -r 64c2eaafe5e2 sbin/build/compil.sh
--- a/sbin/build/compil.sh Fri Jun 29 16:22:52 2012 +0200
+++ b/sbin/build/compil.sh Thu Jul 05 19:08:13 2012 +0200
@@ -1,4 +1,5 @@
#!/bin/sh
sh ../res/ant/bin/ant -f client.xml
-cp ../../build/LdtPlayer-core.js ../../test/metadataplayer/LdtPlayer-core.js
+cp ../../build/LdtPlayer-core.js ../../test/metadataplayer
+cp -R ../../src/css/* ../../test/metadataplayer
cp -R ../../src/widgets/* ../../test/metadataplayer
\ No newline at end of file
diff -r b3ee7d1b472a -r 64c2eaafe5e2 src/css/LdtPlayer-core.css
--- a/src/css/LdtPlayer-core.css Fri Jun 29 16:22:52 2012 +0200
+++ b/src/css/LdtPlayer-core.css Thu Jul 05 19:08:13 2012 +0200
@@ -12,4 +12,4 @@
/* font-family: Arial, Helvetica, sans-serif; */
color: black;
font-size: 12px;
-}
+}
\ No newline at end of file
diff -r b3ee7d1b472a -r 64c2eaafe5e2 src/js/init.js
--- a/src/js/init.js Fri Jun 29 16:22:52 2012 +0200
+++ b/src/js/init.js Thu Jul 05 19:08:13 2012 +0200
@@ -130,9 +130,9 @@
IriSP.Metadataplayer.prototype.onVideoDataLoaded = function() {
- /* Getting video URL from metadata if it's not in the player config options */
+ /* Setting default media from metadata */
- if (typeof this.videoData !== "undefined" && typeof this.config.player.video === "undefined") {
+ if (typeof this.videoData !== "undefined") {
var _media;
@@ -158,11 +158,12 @@
this.videoData.currentMedia = _media;
- if (typeof _media !== "undefined" && typeof _media.video !== "undefined") {
+ /* Getting video URL from metadata if it's not in the player config options */
+
+ if (typeof _media !== "undefined" && typeof _media.video !== "undefined" && typeof this.config.player.video === "undefined") {
this.config.player.video = _media.video;
- if (typeof _media.streamer !== "undefined") {
+ if (typeof this.config.player.streamer == "undefined" && typeof _media.streamer !== "undefined") {
this.config.player.streamer = _media.streamer;
- this.config.player.video = _media.video.replace(_media.streamer,'');
}
}
@@ -235,8 +236,12 @@
var opts = IriSP.jQuery.extend({}, this.config.player);
delete opts.container;
delete opts.type;
+ if (typeof opts.streamer !== "undefined") {
+ opts.video = opts.video.replace(opts.streamer,"");
+ }
opts.file = opts.video;
delete opts.video;
+ delete opts.metadata;
if(!opts.hasOwnProperty("flashplayer")) {
opts.flashplayer = IriSP.getLib("jwPlayerSWF");
diff -r b3ee7d1b472a -r 64c2eaafe5e2 src/js/players/player.jwplayer.js
--- a/src/js/players/player.jwplayer.js Fri Jun 29 16:22:52 2012 +0200
+++ b/src/js/players/player.jwplayer.js Thu Jul 05 19:08:13 2012 +0200
@@ -5,18 +5,25 @@
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 */
+
+ if (options.autostart) {
+ this.media.paused = false;
+ this.trigger("play");
+ }
var _player = jwplayer(this.container),
- _this = this;
+ _this = this,
+ _seekPause = false;
/* Définition des fonctions de l'API - */
this.playerFns = {
play: function() { return _player.play(true); },
pause: function() { return _player.pause(true); },
getPosition: function() { return _player.getPosition(); },
- seek: function(pos) { return _player.seek(pos); },
+ seek: function(pos) {
+ _seekPause = _this.media.paused;
+ return _player.seek(pos);
+ },
getMute: function() { return _player.getMute() },
setMute: function(p) { return _player.setMute(p); },
getVolume: function() { return _player.getVolume() / 100; },
@@ -28,15 +35,22 @@
_this.trigger("loadedmetadata");
},
onTime: function() {
- if (_this.media.paused && _player.getState() === "PLAYING") {
- _this.media.paused = false;
- _this.trigger("play");
+ if (_seekPause) {
+ _player.pause(true);
+ _seekPause = false;
+ } else {
+ if (_this.media.paused && _player.getState() === "PLAYING") {
+ _this.media.paused = false;
+ _this.trigger("play");
+ }
}
_this.trigger("timeupdate");
},
onPlay: function() {
- _this.media.paused = false;
- _this.trigger("play");
+ if (!_seekPause) {
+ _this.media.paused = false;
+ _this.trigger("play");
+ }
},
onPause: function() {
_this.media.paused = true;
diff -r b3ee7d1b472a -r 64c2eaafe5e2 src/js/serializers/ldt_annotate.js
--- a/src/js/serializers/ldt_annotate.js Fri Jun 29 16:22:52 2012 +0200
+++ b/src/js/serializers/ldt_annotate.js Thu Jul 05 19:08:13 2012 +0200
@@ -52,7 +52,7 @@
var _anndata = _data.annotations[0],
_ann = new IriSP.Model.Annotation(_anndata.id, _source);
_ann.description = _anndata.content.data || "";
- _ann.title = _data.creator;
+ _ann.title = _data.creator || "";
_ann.created = new Date(_data.meta.created);
_ann.setMedia(_anndata.media, _source);
var _anntypes = _source.getAnnotationTypes(true).searchByTitle(_anndata.type_title);
diff -r b3ee7d1b472a -r 64c2eaafe5e2 src/js/widgets.js
--- a/src/js/widgets.js Fri Jun 29 16:22:52 2012 +0200
+++ b/src/js/widgets.js Thu Jul 05 19:08:13 2012 +0200
@@ -54,18 +54,6 @@
this.$ = IriSP.jQuery('#' + this.container);
this.$.addClass("Ldt-TraceMe Ldt-Widget").attr("widget-type", _type);
- /* Does the widget require other widgets ? */
- if (typeof this.requires !== "undefined") {
- for (var _i = 0; _i < this.requires.length; _i++) {
- var _subconfig = this.requires[_i];
- _subconfig.container = IriSP._.uniqueId(this.container + '_' + _subconfig.type + '_');
- this.$.append(IriSP.jQuery('
').attr("id",_subconfig.container));
- this.player.loadWidget(_subconfig, function(_widget) {
- _this[_subconfig.type.replace(/^./,function(_s){return _s.toLowerCase();})] = _widget
- });
- }
- }
-
this.l10n = (
typeof this.messages[IriSP.language] !== "undefined"
? this.messages[IriSP.language]
@@ -120,6 +108,19 @@
});
}
+IriSP.Widgets.Widget.prototype.insertSubwidget = function(_selector, _propname, _widgetoptions) {
+ var _id = _selector.attr("id"),
+ _this = this;
+ if (typeof _id == "undefined") {
+ _id = IriSP._.uniqueId(this.container + '_sub_widget_' + _widgetoptions.type);
+ _selector.attr("id", _id);
+ }
+ _widgetoptions.container = _id;
+ _this.player.loadWidget(_widgetoptions, function(_widget) {
+ _this[_propname] = _widget;
+ });
+}
+
/**
* This method responsible of drawing a widget on screen.
*/
diff -r b3ee7d1b472a -r 64c2eaafe5e2 src/widgets/Annotation.css
--- a/src/widgets/Annotation.css Fri Jun 29 16:22:52 2012 +0200
+++ b/src/widgets/Annotation.css Thu Jul 05 19:08:13 2012 +0200
@@ -28,7 +28,12 @@
}
.Ldt-Annotation-MaxMinButton {
- float: right; margin: 5px 5px 0; width: 17px; height: 17px; background: url(img/widget-control.png); background-position: 0 -51px; cursor: hand;
+ float: right; margin: 5px 5px 0; width: 17px; height: 17px;
+ background: url(img/widget-control.png); background-position: 0 -51px; cursor: pointer;
+}
+
+.Ldt-Annotation-Social {
+ float: right;
}
.Ldt-Annotation-MaxMinButton:hover {
@@ -67,34 +72,6 @@
margin: 5px 0 0 90px; clear: right;
}
-.Ldt-Annotation-Share {
- display: inline-block; width: 24px; height: 24px; margin: 2px 0 0 2px; background: url(img/socialbuttons.png);
-}
-
-.Ldt-Annotation-Twitter {
- background-position: 0 0;
-}
-
-.Ldt-Annotation-Twitter:hover {
- background-position: 0 -24px;
-}
-
-.Ldt-Annotation-Fb {
- background-position: -24px 0;
-}
-
-.Ldt-Annotation-Fb:hover {
- background-position: -24px -24px;
-}
-
-.Ldt-Annotation-Gplus {
- background-position: -48px 0;
-}
-
-.Ldt-Annotation-Gplus:hover {
- background-position: -48px -24px;
-}
-
.Ldt-Annotation-Tags-Block {
font-size: 12px;
}
@@ -138,3 +115,7 @@
display: none;
}
+.Ldt-Annotation-EmptyBlock {
+ display: none;
+}
+
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");
}
diff -r b3ee7d1b472a -r 64c2eaafe5e2 src/widgets/AnnotationsList.css
--- a/src/widgets/AnnotationsList.css Fri Jun 29 16:22:52 2012 +0200
+++ b/src/widgets/AnnotationsList.css Thu Jul 05 19:08:13 2012 +0200
@@ -21,7 +21,7 @@
min-height: 60px;
}
.Ldt-AnnotationsList-li:hover {
- background: url(img/pinstripe-grey.png);
+ background: url(img/pinstripe-grey.png) !important;
}
.Ldt-AnnotationsList-highlight {
background: #F7268E;
@@ -59,7 +59,7 @@
p.Ldt-AnnotationsList-Description {
margin: 2px 0 2px 82px;
font-size: 12px;
- color: #666666;
+ color: #333333;
}
ul.Ldt-AnnotationsList-Tags {
list-style: none;
diff -r b3ee7d1b472a -r 64c2eaafe5e2 src/widgets/AnnotationsList.js
--- a/src/widgets/AnnotationsList.js Fri Jun 29 16:22:52 2012 +0200
+++ b/src/widgets/AnnotationsList.js Thu Jul 05 19:08:13 2012 +0200
@@ -27,14 +27,27 @@
annotation_type : false,
refresh_interval : 0,
limit_count : 10,
- newest_first : false
+ newest_first : false,
+ polemics : [{
+ keyword: "++",
+ background_color: "#c9ecc6"
+ },{
+ keyword: "--",
+ background_color: "#f9c5c6"
+ },{
+ keyword: "??",
+ background_color: "#cec5f9"
+ },{
+ keyword: "==",
+ background_color: "#f9f4c6"
+ }]
};
IriSP.Widgets.AnnotationsList.prototype.template =
'