# HG changeset patch # User veltr # Date 1380640036 -7200 # Node ID 9eee31426156cce7ea470fabd942a49f476c0271 # Parent a4e00ed296f8a3b2955ad0679000f6f1de65c76c Upgrade metadataplayer diff -r a4e00ed296f8 -r 9eee31426156 src/ldt/ldt/static/ldt/metadataplayer/AdaptivePlayer.js --- a/src/ldt/ldt/static/ldt/metadataplayer/AdaptivePlayer.js Mon Sep 30 16:56:58 2013 +0200 +++ b/src/ldt/ldt/static/ldt/metadataplayer/AdaptivePlayer.js Tue Oct 01 17:07:16 2013 +0200 @@ -8,7 +8,7 @@ mime_type: "video/mp4", normal_player: "HtmlPlayer", fallback_player: "JwpPlayer" -} +}; IriSP.Widgets.AdaptivePlayer.prototype.draw = function() { @@ -30,4 +30,4 @@ this.insertSubwidget(this.$, _opts); -} \ No newline at end of file +}; \ No newline at end of file diff -r a4e00ed296f8 -r 9eee31426156 src/ldt/ldt/static/ldt/metadataplayer/Annotation.js --- a/src/ldt/ldt/static/ldt/metadataplayer/Annotation.js Mon Sep 30 16:56:58 2013 +0200 +++ b/src/ldt/ldt/static/ldt/metadataplayer/Annotation.js Tue Oct 01 17:07:16 2013 +0200 @@ -28,7 +28,7 @@ excerpt_from: "Excerpt from:", untitled: "Untitled segment" } -} +}; IriSP.Widgets.Annotation.prototype.template = '{{#show_arrow}}
{{/show_arrow}}' @@ -58,7 +58,7 @@ search_on_tag_click: true, show_social: true, show_annotation_type: false -} +}; IriSP.Widgets.Annotation.prototype.draw = function() { @@ -125,7 +125,7 @@ _this.$.find(".Ldt-Annotation-Creator").text(_annotation.creator); } if (_this.show_annotation_type) { - _this.$.find(".Ldt-Annotation-Type").text(_annotation.getAnnotationType().title) + _this.$.find(".Ldt-Annotation-Type").text(_annotation.getAnnotationType().title); } _this.$.find(".Ldt-Annotation-Begin").text(_annotation.begin.toString()); _this.$.find(".Ldt-Annotation-End").text(_annotation.end.toString()); @@ -179,7 +179,7 @@ this.$.find(".Ldt-Annotation-MaxMinButton").click(this.functionWrapper("toggleSize")); this.getWidgetAnnotations().forEach(function(_a) { _a.on("enter", function() { - drawAnnotation(_a) + drawAnnotation(_a); }); }); this.source.getAnnotations().on("found", highlightTitleAndDescription); @@ -193,26 +193,26 @@ uri: (typeof currentAnnotation.url !== "undefined" ? currentAnnotation.url : (document.location.href.replace(/#.*$/,'') + '#id=' + currentAnnotation.id)) - } + }; }); -} +}; IriSP.Widgets.Annotation.prototype.sendBounds = function() { this.player.trigger("Annotation.boundsChanged",this.bounds); -} +}; IriSP.Widgets.Annotation.prototype.drawAnnotation = function(_annotation) { this.lastAnnotation = _annotation.id; -} +}; IriSP.Widgets.Annotation.prototype.hide = function() { this.$.slideUp(); -} +}; IriSP.Widgets.Annotation.prototype.show = function() { this.$.slideDown(); -} +}; IriSP.Widgets.Annotation.prototype.toggleSize = function() { if (this.minimized) { @@ -220,14 +220,14 @@ } else { this.minimize(); } -} +}; IriSP.Widgets.Annotation.prototype.minimize = function() { this.minimized = true; this.$.find('.Ldt-Annotation-Inner').addClass("Ldt-Annotation-Minimized"); -} +}; IriSP.Widgets.Annotation.prototype.maximize = function() { this.minimized = false; this.$.find('.Ldt-Annotation-Inner').removeClass("Ldt-Annotation-Minimized"); -} \ No newline at end of file +}; \ No newline at end of file diff -r a4e00ed296f8 -r 9eee31426156 src/ldt/ldt/static/ldt/metadataplayer/AnnotationsList.js --- a/src/ldt/ldt/static/ldt/metadataplayer/AnnotationsList.js Mon Sep 30 16:56:58 2013 +0200 +++ b/src/ldt/ldt/static/ldt/metadataplayer/AnnotationsList.js Tue Oct 01 17:07:16 2013 +0200 @@ -53,7 +53,7 @@ voice_annotation: "Annotation Vocale", now_playing: "Lecture en cours..." } -} +}; IriSP.Widgets.AnnotationsList.prototype.template = '
' @@ -102,7 +102,7 @@ this.currentSource = this.player.loadMetadata(IriSP._.defaults({ "url" : _url }, this.metadata)); -} +}; IriSP.Widgets.AnnotationsList.prototype.ajaxMashup = function() { var _currentTime = this.media.getCurrentTime(); @@ -119,7 +119,7 @@ "url" : _url }, this.metadata)); } -} +}; IriSP.Widgets.AnnotationsList.prototype.refresh = function(_forceRedraw) { _forceRedraw = (typeof _forceRedraw !== "undefined" && _forceRedraw); @@ -146,7 +146,7 @@ /* Get the n annotations closest to current timecode */ _list = _list.sortBy(function(_annotation) { return Math.abs((_annotation.begin + _annotation.end) / 2 - _currentTime); - }).slice(0, this.limit_count) + }).slice(0, this.limit_count); } if (this.newest_first) { _list = _list.sortBy(function(_annotation) { @@ -233,10 +233,10 @@ height: 1, events: { onPause: function() { - _this.$.find(".Ldt-AnnotationsList-Play[data-annotation-id=" + _annotation.id + "]").text(_this.l10n.voice_annotation) + _this.$.find(".Ldt-AnnotationsList-Play[data-annotation-id=" + _annotation.id + "]").text(_this.l10n.voice_annotation); }, onPlay: function() { - _this.$.find(".Ldt-AnnotationsList-Play[data-annotation-id=" + _annotation.id + "]").text(_this.l10n.now_playing) + _this.$.find(".Ldt-AnnotationsList-Play[data-annotation-id=" + _annotation.id + "]").text(_this.l10n.now_playing); } } }); @@ -312,7 +312,7 @@ } } return _list.length; -} +}; IriSP.Widgets.AnnotationsList.prototype.draw = function() { @@ -372,7 +372,7 @@ if (this.refresh_interval) { window.setInterval(function() { - _this.currentSource.get() + _this.currentSource.get(); }, this.refresh_interval); } diff -r a4e00ed296f8 -r 9eee31426156 src/ldt/ldt/static/ldt/metadataplayer/Arrow.js --- a/src/ldt/ldt/static/ldt/metadataplayer/Arrow.js Mon Sep 30 16:56:58 2013 +0200 +++ b/src/ldt/ldt/static/ldt/metadataplayer/Arrow.js Tue Oct 01 17:07:16 2013 +0200 @@ -15,7 +15,7 @@ stroke_color: "#b7b7b7", stroke_width: 1.5, animation_speed: 20 -} +}; IriSP.Widgets.Arrow.prototype.draw = function() { this.height = this.arrow_height + this.base_height; @@ -33,7 +33,7 @@ fill: this.fill_url ? ( 'url(' + this.fill_url + ')' ) : this.fill_color }); this.moveToX(0); -} +}; IriSP.Widgets.Arrow.prototype.drawAt = function(_x) { _x = Math.max(0, Math.min(_x, this.width)); @@ -53,7 +53,7 @@ this.svgArrow.attr({ path: _d }); -} +}; IriSP.Widgets.Arrow.prototype.moveToX = function(_x) { this.targetX = Math.max(0, Math.min(_x, this.width)); @@ -61,14 +61,14 @@ this.animInterval = window.setInterval( this.functionWrapper("increment"), 40 - ) + ); } this.increment(); -} +}; IriSP.Widgets.Arrow.prototype.moveToTime = function(_t) { this.moveToX(this.width * _t / this.media.duration); -} +}; IriSP.Widgets.Arrow.prototype.increment = function() { if (typeof this.currentX === "undefined") { @@ -85,4 +85,4 @@ this.animInterval = undefined; } this.drawAt(this.currentX); -} +}; diff -r a4e00ed296f8 -r 9eee31426156 src/ldt/ldt/static/ldt/metadataplayer/AutoPlayer.js --- a/src/ldt/ldt/static/ldt/metadataplayer/AutoPlayer.js Mon Sep 30 16:56:58 2013 +0200 +++ b/src/ldt/ldt/static/ldt/metadataplayer/AutoPlayer.js Tue Oct 01 17:07:16 2013 +0200 @@ -6,7 +6,7 @@ IriSP.Widgets.AutoPlayer.prototype.defaults = { default_type: "JwpPlayer" -} +}; IriSP.Widgets.AutoPlayer.prototype.draw = function() { @@ -52,7 +52,7 @@ } if (typeof _opts.type === "undefined") { - _opts.type = this.default_type + _opts.type = this.default_type; } if (_opts.type === "AdaptivePlayer") { @@ -73,4 +73,4 @@ this.insertSubwidget(this.$, _opts); -} \ No newline at end of file +}; \ No newline at end of file diff -r a4e00ed296f8 -r 9eee31426156 src/ldt/ldt/static/ldt/metadataplayer/Controller.js --- a/src/ldt/ldt/static/ldt/metadataplayer/Controller.js Mon Sep 30 16:56:58 2013 +0200 +++ b/src/ldt/ldt/static/ldt/metadataplayer/Controller.js Tue Oct 01 17:07:16 2013 +0200 @@ -11,7 +11,7 @@ disable_annotate_btn: false, disable_search_btn: false, disable_ctrl_f: false -} +}; IriSP.Widgets.Controller.prototype.template = '
' @@ -225,7 +225,7 @@ .addClass("Ldt-Ctrl-Sound-Mute"); } else { _soundCtl.attr("title", this.l10n.mute) - .addClass(_vol < .5 ? "Ldt-Ctrl-Sound-Half" : "Ldt-Ctrl-Sound-Full" ) + .addClass(_vol < .5 ? "Ldt-Ctrl-Sound-Half" : "Ldt-Ctrl-Sound-Full" ); } this.$volumeBar.slider("value", _muted ? 0 : 100 * _vol); }; diff -r a4e00ed296f8 -r 9eee31426156 src/ldt/ldt/static/ldt/metadataplayer/CreateAnnotation.js --- a/src/ldt/ldt/static/ldt/metadataplayer/CreateAnnotation.js Mon Sep 30 16:56:58 2013 +0200 +++ b/src/ldt/ldt/static/ldt/metadataplayer/CreateAnnotation.js Tue Oct 01 17:07:16 2013 +0200 @@ -47,7 +47,7 @@ after_send_timeout: 0, close_after_send: false, tag_prefix: "#" -} +}; IriSP.Widgets.CreateAnnotation.prototype.messages = { en: { @@ -92,7 +92,7 @@ "polemic??": "Question", "polemic==": "Référence" } -} +}; IriSP.Widgets.CreateAnnotation.prototype.template = '{{#show_slice}}
{{/show_slice}}' @@ -247,7 +247,7 @@ this.onMdpEvent("CreateAnnotation.toggle","toggle"); this.$.find("form").submit(this.functionWrapper("onSubmit")); -} +}; IriSP.Widgets.CreateAnnotation.prototype.showScreen = function(_screenName) { this.$.find('.Ldt-CreateAnnotation-' + _screenName).show() @@ -272,7 +272,7 @@ if (this.minimize_annotation_widget) { this.player.trigger("Annotation.minimize"); } -} +}; IriSP.Widgets.CreateAnnotation.prototype.hide = function() { if (this.recorder) { @@ -285,7 +285,7 @@ this.player.trigger("Annotation.maximize"); } } -} +}; IriSP.Widgets.CreateAnnotation.prototype.toggle = function() { if (!this.always_visible) { @@ -295,7 +295,7 @@ this.show(); } } -} +}; IriSP.Widgets.CreateAnnotation.prototype.addKeyword = function(_keyword) { var _field = this.$.find(".Ldt-CreateAnnotation-Description"), @@ -307,13 +307,13 @@ ); _field.val(_contents.replace(/\s{2,}/g,' ').replace(/(^\s+|\s+$)/g,'')); this.onDescriptionChange(); -} +}; IriSP.Widgets.CreateAnnotation.prototype.pauseOnWrite = function() { if (this.pause_on_write && !this.media.getPaused()) { this.media.pause(); } -} +}; IriSP.Widgets.CreateAnnotation.prototype.onDescriptionChange = function() { var _field = this.$.find(".Ldt-CreateAnnotation-Description"), @@ -334,7 +334,7 @@ }); this.pauseOnWrite(); return !!_contents; -} +}; IriSP.Widgets.CreateAnnotation.prototype.onTitleChange = function() { var _field = this.$.find(".Ldt-CreateAnnotation-Title"), @@ -347,7 +347,7 @@ } this.pauseOnWrite(); return !!_contents; -} +}; IriSP.Widgets.CreateAnnotation.prototype.onCreatorChange = function() { @@ -361,7 +361,7 @@ } this.pauseOnWrite(); return !!_contents; -} +}; /* Fonction effectuant l'envoi des annotations */ IriSP.Widgets.CreateAnnotation.prototype.onSubmit = function() { @@ -484,5 +484,5 @@ this.showScreen('Wait'); return false; -} +}; diff -r a4e00ed296f8 -r 9eee31426156 src/ldt/ldt/static/ldt/metadataplayer/DailymotionPlayer.js --- a/src/ldt/ldt/static/ldt/metadataplayer/DailymotionPlayer.js Mon Sep 30 16:56:58 2013 +0200 +++ b/src/ldt/ldt/static/ldt/metadataplayer/DailymotionPlayer.js Tue Oct 01 17:07:16 2013 +0200 @@ -6,7 +6,7 @@ IriSP.Widgets.DailymotionPlayer.prototype.defaults = { aspect_ratio: 14/9 -} +}; IriSP.Widgets.DailymotionPlayer.prototype.draw = function() { @@ -30,35 +30,35 @@ _media.getCurrentTime = function() { return new IriSP.Model.Time(1000*_player.getCurrentTime()); - } + }; _media.getVolume = function() { return _player.getVolume() / 100; - } + }; _media.getPaused = function() { return _pauseState; - } + }; _media.getMuted = function() { return _player.isMuted(); - } + }; _media.setCurrentTime = function(_milliseconds) { _seekPause = _pauseState; return _player.seekTo(_milliseconds / 1000); - } + }; _media.setVolume = function(_vol) { return _player.setVolume(Math.floor(_vol*100)); - } + }; _media.mute = function() { return _player.mute(); - } + }; _media.unmute = function() { return _player.unMute(); - } + }; _media.play = function() { return _player.playVideo(); - } + }; _media.pause = function() { return _player.pauseVideo(); - } + }; _player.addEventListener("onStateChange", "onDailymotionStateChange"); _player.addEventListener("onVideoProgress", "onDailymotionVideoProgress"); @@ -66,7 +66,7 @@ _player.cueVideoByUrl(_this.video); _media.trigger("loadedmetadata"); - } + }; window.onDailymotionStateChange = function(_state) { switch(_state) { @@ -84,11 +84,11 @@ _media.trigger("seeked"); break; } - } + }; window.onDailymotionVideoProgress = function(_progress) { _media.trigger("timeupdate", new IriSP.Model.Time(_progress.mediaTime * 1000)); - } + }; var params = { "allowScriptAccess" : "always", @@ -101,4 +101,4 @@ swfobject.embedSWF("http://www.dailymotion.com/swf?chromeless=1&enableApi=1", this.container, this.width, this.height, "8", null, null, params, atts); -} \ No newline at end of file +}; \ No newline at end of file diff -r a4e00ed296f8 -r 9eee31426156 src/ldt/ldt/static/ldt/metadataplayer/HelloWorld.js --- a/src/ldt/ldt/static/ldt/metadataplayer/HelloWorld.js Mon Sep 30 16:56:58 2013 +0200 +++ b/src/ldt/ldt/static/ldt/metadataplayer/HelloWorld.js Tue Oct 01 17:07:16 2013 +0200 @@ -7,13 +7,13 @@ IriSP.Widgets.HelloWorld = function(player, config) { console.log("Calling IriSP.Widget's constructor from IriSP.HelloWorldWidget"); IriSP.Widgets.Widget.call(this, player, config); -} +}; IriSP.Widgets.HelloWorld.prototype = new IriSP.Widgets.Widget(); IriSP.Widgets.HelloWorld.prototype.defaults = { text: "world" -} +}; IriSP.Widgets.HelloWorld.prototype.template = '

{{l10n.Hello}} {{text}}

Looks like we have {{source.contents.annotation.length}} annotations in this feed

'; @@ -25,9 +25,9 @@ "en" : { "Hello" : "Hello," } -} +}; IriSP.Widgets.HelloWorld.prototype.draw = function() { this.renderTemplate(); console.log("HelloWorldWidget was drawn"); -} \ No newline at end of file +}; \ No newline at end of file diff -r a4e00ed296f8 -r 9eee31426156 src/ldt/ldt/static/ldt/metadataplayer/HtmlPlayer.js --- a/src/ldt/ldt/static/ldt/metadataplayer/HtmlPlayer.js Mon Sep 30 16:56:58 2013 +0200 +++ b/src/ldt/ldt/static/ldt/metadataplayer/HtmlPlayer.js Tue Oct 01 17:07:16 2013 +0200 @@ -6,10 +6,10 @@ IriSP.Widgets.HtmlPlayer.prototype.defaults = { -} +}; IriSP.Widgets.HtmlPlayer.prototype.draw = function() { IriSP.htmlPlayer(this.media, this.$, this); -} \ No newline at end of file +}; \ No newline at end of file diff -r a4e00ed296f8 -r 9eee31426156 src/ldt/ldt/static/ldt/metadataplayer/JwpPlayer.js --- a/src/ldt/ldt/static/ldt/metadataplayer/JwpPlayer.js Mon Sep 30 16:56:58 2013 +0200 +++ b/src/ldt/ldt/static/ldt/metadataplayer/JwpPlayer.js Tue Oct 01 17:07:16 2013 +0200 @@ -5,7 +5,7 @@ IriSP.Widgets.JwpPlayer.prototype = new IriSP.Widgets.Widget(); IriSP.Widgets.JwpPlayer.prototype.defaults = { -} +}; IriSP.Widgets.JwpPlayer.prototype.draw = function() { @@ -113,10 +113,10 @@ _media.volume = _event.volume / 100; _media.trigger("volumechange"); } - } + }; _player = _player.setup(_opts); this.jwplayer = _player; -} \ No newline at end of file +}; \ No newline at end of file diff -r a4e00ed296f8 -r 9eee31426156 src/ldt/ldt/static/ldt/metadataplayer/KnowledgeConcierge.js --- a/src/ldt/ldt/static/ldt/metadataplayer/KnowledgeConcierge.js Mon Sep 30 16:56:58 2013 +0200 +++ b/src/ldt/ldt/static/ldt/metadataplayer/KnowledgeConcierge.js Tue Oct 01 17:07:16 2013 +0200 @@ -14,7 +14,7 @@ use_word_boundaries: false, related_data_type: 'json', // SET TO "jsonp" FOR CROSS-DOMAIN OPERATION related_count: 8, -} +}; IriSP.Widgets.KnowledgeConcierge.prototype.messages = { "fr": { @@ -29,7 +29,7 @@ for_keywords_: "for keyword(s):", no_matching_videos: "No matching videos" } -} +}; IriSP.Widgets.KnowledgeConcierge.prototype.template = '
' @@ -55,7 +55,7 @@ height: _canvasHeight }); var _this = this, - _pjsfiles = IriSP._(this.sketch_files).map(function(_f) { return _this.sketch_path + "/" + _f }), + _pjsfiles = IriSP._(this.sketch_files).map(function(_f) { return _this.sketch_path + "/" + _f; }), _selectedText = "", currentNodesList = "", relatedCache = {}, @@ -83,7 +83,7 @@ description: media.description.replace(/(\n|\r|\r\n)/mg,' ').replace(/(^.{120,140})[\s].+$/m,'$1…'), duration: new IriSP.Model.Time(media.duration).toString(), escaped_keyword: encodeURIComponent(keywords.split(",")[0]) - } + }; _html += Mustache.to_html(relatedTemplate, _tmpldata); if (i % 2) { _html += '
'; @@ -164,7 +164,7 @@ .value(); renderRelated(); } - }) + }); } else { renderRelated(); } @@ -291,7 +291,7 @@ triggerSearch(); } } - } + }; var uselessfuncts = [ "selectnode", "selectedge", "topicnode","group_shapes", "allbackup", "allretrieve", "new_topic", "pedia", "set_mode", @@ -325,9 +325,9 @@ if (keywmatch) { this.player.on("widgets-loaded", function() { triggerSearch(decodeURIComponent(keywmatch[1])); - }) + }); } bindJavascript(); -} +}; diff -r a4e00ed296f8 -r 9eee31426156 src/ldt/ldt/static/ldt/metadataplayer/LdtPlayer-core.js --- a/src/ldt/ldt/static/ldt/metadataplayer/LdtPlayer-core.js Mon Sep 30 16:56:58 2013 +0200 +++ b/src/ldt/ldt/static/ldt/metadataplayer/LdtPlayer-core.js Tue Oct 01 17:07:16 2013 +0200 @@ -32,12 +32,16 @@ if (typeof window.IriSP === "undefined") { window.IriSP = { - VERSION: "0.3.1" + VERSION: "0.3.2" }; } -if (typeof IriSP.jQuery === "undefined" && typeof window.jQuery !== "undefined" && parseFloat(window.jQuery().jquery) >= 1.7) { - IriSP.jQuery = window.jQuery; +if (typeof IriSP.jQuery === "undefined" && typeof window.jQuery !== "undefined") { + var jvp = window.jQuery().jquery.split("."), + jv = 100 * parseInt(jvp[0]) + parseInt(jvp[1]); + if (jv > 170) { + IriSP.jQuery = window.jQuery; + } } if (typeof IriSP._ === "undefined" && typeof window._ !== "undefined" && parseFloat(window._.VERSION) >= 1.4) { @@ -59,7 +63,7 @@ if (typeof IriSP.libFiles.inDefaultDir[lib] == "string") { return IriSP.libFiles.defaultDir + '/' + IriSP.libFiles.inDefaultDir[lib]; } -} +}; IriSP._cssCache = []; @@ -103,10 +107,10 @@ } addToList(/(https?:\/\/)?[\w\d\-]+\.[\w\d\-]+\S+/gm, function(matches) { - return '' + return ''; }, ''); addToList(/@([\d\w]{1,15})/gm, function(matches) { - return '' + return ''; }, ''); addToList(/\*[^*]+\*/gm, '', ''); addToList(/[\n\r]+/gm, '', '
'); @@ -118,7 +122,7 @@ positions = IriSP._(positions) .chain() .uniq() - .sortBy(function(p) { return parseInt(p) }) + .sortBy(function(p) { return parseInt(p); }) .value(); var res = "", lastIndex = 0; @@ -172,9 +176,9 @@ var _this = this, noop = (function() {}); IriSP._(properties).each(function(p) { - _this[p] = noop + _this[p] = noop; }); -} +}; /* js is where data is stored in a standard form, whatever the serializer */ @@ -231,7 +235,7 @@ isLocalURL = Model.isLocalURL = function(url) { var matches = url.match(/^(\w+:)\/\/([^/]+)/); if (matches) { - return(matches[1] === document.location.protocol && matches[2] === document.location.host) + return(matches[1] === document.location.protocol && matches[2] === document.location.host); } return true; }, @@ -258,7 +262,7 @@ fullTextRegexps = Model.fullTextRegexps = function(_text) { var remsrc = "[\\" + removeChars.join("\\") + "]", remrx = new RegExp(remsrc,"gm"), - txt = _text.toLowerCase().replace(remrx,"") + txt = _text.toLowerCase().replace(remrx,""), res = [], charsrx = ns._(charsub).map(function(c) { return new RegExp(c); @@ -308,7 +312,7 @@ + pad(2, d.getUTCDate())+'T' + pad(2, d.getUTCHours())+':' + pad(2, d.getUTCMinutes())+':' - + pad(2, d.getUTCSeconds())+'Z' + + pad(2, d.getUTCSeconds())+'Z' ; }; /* @@ -331,7 +335,7 @@ _element.found = undefined; }); _this.trigger("search-cleared"); - }) + }); }; List.prototype = new Array(); @@ -349,7 +353,7 @@ ns._(this).forEach(function(_value, _key) { _callback(_value, _key, _this); }); - } + }; }; if (typeof Array.prototype.map === "undefined") { @@ -358,7 +362,7 @@ return ns._(this).map(function(_value, _key) { return _callback(_value, _key, _this); }); - } + }; }; List.prototype.pluck = function(_key) { @@ -438,9 +442,9 @@ } this.searching = true; this.trigger("search", _text); - var rxsource = fullTextRegexps(_text) - rgxp = new RegExp(rxsource,"im"), - this.regexp = new RegExp(rxsource,"gim"); + var rxsource = fullTextRegexps(_text), + rgxp = new RegExp(rxsource,"im"); + this.regexp = new RegExp(rxsource,"gim"); var res = this.filter(function(_element, _k) { var titlematch = rgxp.test(_element.title), descmatch = rgxp.test(_element.description), @@ -460,7 +464,7 @@ }; List.prototype.addId = function(_id) { - var _el = this.directory.getElement(_id) + var _el = this.directory.getElement(_id); if (!this.hasId(_id) && typeof _el !== "undefined") { this.idIndex.push(_id); Array.prototype.push.call(this, _el); @@ -593,7 +597,7 @@ minutes : (Math.floor(_totalSeconds / 60) % 60), seconds : _totalSeconds % 60, milliseconds: this.milliseconds % 1000 - } + }; }; Time.prototype.add = function(_milliseconds) { @@ -608,11 +612,11 @@ var _hms = this.getHMS(), _res = ''; if (_hms.hours) { - _res += _hms.hours + ':' + _res += _hms.hours + ':'; } _res += pad(2, _hms.minutes) + ':' + pad(2, _hms.seconds); if (showCs) { - _res += "." + Math.floor(_hms.milliseconds / 100) + _res += "." + Math.floor(_hms.milliseconds / 100); } return _res; }; @@ -650,7 +654,7 @@ Reference.prototype.isOrHasId = function(_idRef) { if (this.isList) { - return (ns._(this.id).indexOf(_idRef) !== -1) + return (ns._(this.id).indexOf(_idRef) !== -1); } else { return (this.id == _idRef); } @@ -662,7 +666,7 @@ this.elementType = 'element'; this.title = ""; this.description = ""; - this.__events = {} + this.__events = {}; if (typeof _source === "undefined") { return; } @@ -744,14 +748,14 @@ this.on("timeupdate", function(_time) { _this.currentTime = _time; _this.getAnnotations().filter(function(_a) { - return (_a.end <= _time || _a.begin > _time) && _a.playing + return (_a.end <= _time || _a.begin > _time) && _a.playing; }).forEach(function(_a) { _a.playing = false; _a.trigger("leave"); _this.trigger("leave-annotation",_a); }); _this.getAnnotations().filter(function(_a) { - return _a.begin <= _time && _a.end > _time && !_a.playing + return _a.begin <= _time && _a.end > _time && !_a.playing; }).forEach(function(_a) { _a.playing = true; _a.trigger("enter"); @@ -834,7 +838,7 @@ return ns._(_annTypes).indexOf(_annotation.getAnnotationType().id) !== -1; }); } else { - return new List(this.source.directory) + return new List(this.source.directory); } }; @@ -930,7 +934,7 @@ }; Annotation.prototype.getDuration = function() { - return new Time(this.end.milliseconds - this.begin.milliseconds) + return new Time(this.end.milliseconds - this.begin.milliseconds); }; /* */ @@ -997,7 +1001,7 @@ this._updateTimes = function() { _this.updateTimes(); _this.trigger("change"); - } + }; this.on("add", this._updateTimes); this.on("remove", this._updateTimes); }; @@ -1086,19 +1090,19 @@ Mashup.prototype.hasAnnotation = function(_annotation) { return !!ns._(this.segments).find(function(_s) { - return _s.annotation === _annotation + return _s.annotation === _annotation; }); }; Mashup.prototype.getAnnotation = function(_annotation) { return ns._(this.segments).find(function(_s) { - return _s.annotation === _annotation + return _s.annotation === _annotation; }); }; Mashup.prototype.getAnnotationById = function(_id) { return ns._(this.segments).find(function(_s) { - return _s.annotation.id === _id + return _s.annotation.id === _id; }); }; @@ -1117,8 +1121,8 @@ Mashup.prototype.getMedias = function() { var medias = new List(this.source.directory); this.segments.forEach(function(_annotation) { - medias.push(_annotation.getMedia()) - }) + medias.push(_annotation.getMedia()); + }); return medias; }; @@ -1129,7 +1133,7 @@ return ns._(_annTypes).indexOf(_annotation.getAnnotationType().id) !== -1; }); } else { - return new List(this.source.directory) + return new List(this.source.directory); } }; @@ -1163,7 +1167,7 @@ var _this = this; ns._(_config).forEach(function(_v, _k) { _this[_k] = _v; - }) + }); this.callbackQueue = []; this.contents = {}; this.get(); @@ -1197,7 +1201,7 @@ var _this = this; ns._(this.contents).forEach(function(_value, _key) { _callback.call(_this, _value, _key); - }) + }); }; Source.prototype.getElement = function(_elId) { @@ -1270,7 +1274,7 @@ _annTypes = this.getAnnotationTypes(_global).searchByTitle(_title); _annTypes.forEach(function(_annType) { _res.addElements(_annType.getAnnotations(_global)); - }) + }); return _res; }; @@ -1466,7 +1470,7 @@ getVolume(); media.trigger("loadedmetadata"); media.trigger("volumechange"); - }) + }); videoEl.on("timeupdate", function() { media.trigger("timeupdate", new IriSP.Model.Time(1000*mediaEl.currentTime)); @@ -1475,7 +1479,7 @@ videoEl.on("volumechange", function() { getVolume(); media.trigger("volumechange"); - }) + }); videoEl.on("play", function() { media.trigger("play"); @@ -1495,7 +1499,40 @@ }; -/* LDT Platform Serializer */ +/* START contentapi-serializer.js */ + +if (typeof IriSP.serializers === "undefined") { + IriSP.serializers = {}; +} + +IriSP.serializers.content = { + deSerialize : function(_data, _source) { + var _medialist = new IriSP.Model.List(_source.directory); + + function deserializeObject(_m, i) { + var _media = new IriSP.Model.Media(_m.iri_id, _source); + _media.video = _m.media_url; + _media.title = _m.title; + _media.description = _m.description; + _media.setDuration(_m.duration); + _media.thumbnail = _m.image; + _media.color = IriSP.vizcolors[i % IriSP.vizcolors.length]; + _media.keywords = _m.tags; + _medialist.push(_media); + } + + if (typeof _data.objects !== "undefined") { + IriSP._(_data.objects).each(deserializeObject); + } else { + deserializeObject(_data, 0); + } + + _source.addList("media", _medialist); + } +}; + +/* END contentapi-serializer.js */ +/* Start ldt-serializer.js */ if (typeof IriSP.serializers === "undefined") { IriSP.serializers = {}; @@ -1541,7 +1578,7 @@ "dc:contributor" : _data.contributor || _source.contributor || _data.creator || _source.creator, "dc:duration" : _data.duration.milliseconds } - } + }; _dest.medias.push(_res); var _list = { id: IriSP.Model.getUID(), @@ -1574,9 +1611,9 @@ }).map(function(_at) { return { "id-ref": _at.id - } + }; }) - } + }; _dest.lists.push(_list); _dest.views[0].contents.push(_data.id); } @@ -1602,7 +1639,7 @@ "dc:creator" : _data.creator || _source.creator, "dc:contributor" : _data.contributor || _source.contributor || _data.creator || _source.creator, } - } + }; _dest.tags.push(_res); } }, @@ -1623,7 +1660,7 @@ "dc:modified" : IriSP.Model.dateToIso(_data.modified || _source.modified), "dc:creator" : _data.creator || _source.creator, "dc:contributor" : _data.contributor || _source.contributor || _data.creator || _source.creator, - } + }; _dest["annotation-types"].push(_res); _dest.views[0].annotation_types.push(_data.id); } @@ -1694,18 +1731,18 @@ "dc:contributor" : _data.contributor || _source.contributor || _data.creator || _source.creator, // project : _source.projectId } - } + }; if (_source.regenerateTags) { _res.tags = IriSP._(_data.keywords).map(function(_kw) { return { "id-ref": _source.__keywords[_kw.toLowerCase()].id - } + }; }); } else { _res.tags = IriSP._(_data.tag.id).map(function(_id) { return { "id-ref" : _id - } + }; }); } _res.content.title = _data.title || _res.content.title || ""; @@ -1740,7 +1777,7 @@ return _annotation.annotation.id; }), id: _data.id - } + }; _dest.lists.push(_res); } } @@ -1780,13 +1817,13 @@ id: IriSP.Model.getUID(), title: kw, regenerated: true - } + }; } }); }); IriSP._(_source.__keywords).each(function(kw) { _this.types.tag.serializer(kw, _source, _res); - }) + }); } _source.forEach(function(_list, _typename) { if (typeof _this.types[_typename] !== "undefined") { @@ -1863,7 +1900,7 @@ created: _data.created, creator: _data.creator } - } + }; }, deserializeAnnotation : function(_anndata, _source) { var _ann = new IriSP.Model.Annotation(_anndata.id, _source); @@ -1914,7 +1951,46 @@ } }; -/* End ldt_annotate serializer *//* Start of defaults.js */ +/* End ldt_annotate serializer *//* START segmentapi-serializer.js */ + +if (typeof IriSP.serializers === "undefined") { + IriSP.serializers = {}; +} + +IriSP.serializers.segmentapi = { + deSerialize : function(_data, _source) { + var _annotationlist = new IriSP.Model.List(_source.directory), + _medialist = new IriSP.Model.List(_source.directory); + _source.addList("media", _medialist); + + function deserializeObject(_s) { + var _ann = new IriSP.Model.Annotation(_s.element_id, _source), + _media = _source.getElement(_s.iri_id); + if (!_media) { + _media = new IriSP.Model.Media(_s.iri_id, _source); + _source.getMedias().push(_media); + } + _ann.setMedia(_s.iri_id); + _ann.title = _s.title; + _ann.description = _s.abstract; + _ann.begin = new IriSP.Model.Time(_s.start_ts); + _ann.end = new IriSP.Model.Time(_s.start_ts + _s.duration); + _ann.keywords = (_s.tags ? _s.tags.split(",") : []); + _ann.project_id = _s.project_id; + _annotationlist.push(_ann); + } + + if (typeof _data.objects !== "undefined") { + IriSP._(_data.objects).each(deserializeObject); + } else { + deserializeObject(_data); + } + _source.addList("annotation", _annotationlist); + } +}; + +/* END segmentapi-serializer.js */ +/* Start of defaults.js */ IriSP.language = 'en'; @@ -2156,7 +2232,7 @@ return; } var isloaded = !ns._(_this.widgets).any(function(w) { - return !(w && w.isLoaded()) + return !(w && w.isLoaded()); }); if (isloaded) { _this.widgetsLoaded = true; @@ -2316,7 +2392,7 @@ } else { var _mediaopts = { is_mashup: _this.is_mashup || false - } + }; _this.media = _this.source.getCurrentMedia(_mediaopts); } @@ -2363,9 +2439,9 @@ if (typeof _function !== "undefined") { return function() { return _function.apply(_this, Array.prototype.slice.call(arguments, 0)); - } + }; } else { - console.log("Error, Unknown function IriSP.Widgets." + this.type + "." + _name) + console.log("Error, Unknown function IriSP.Widgets." + this.type + "." + _name); } }; diff -r a4e00ed296f8 -r 9eee31426156 src/ldt/ldt/static/ldt/metadataplayer/MediaList.js --- a/src/ldt/ldt/static/ldt/metadataplayer/MediaList.js Mon Sep 30 16:56:58 2013 +0200 +++ b/src/ldt/ldt/static/ldt/metadataplayer/MediaList.js Tue Oct 01 17:07:16 2013 +0200 @@ -16,7 +16,7 @@ all_media: "All videos", other_media: "Other videos" } -} +}; IriSP.Widgets.MediaList.prototype.defaults = { default_thumbnail : "http://ldt.iri.centrepompidou.fr/static/site/ldt/css/imgs/video_sequence.png", @@ -54,7 +54,7 @@ this.player.trigger("search.noMatchFound"); } } -} +}; IriSP.Widgets.MediaList.prototype.draw = function() { this.$.addClass("Ldt-MediaListWidget") @@ -63,7 +63,7 @@ if (typeof this.media.getMedias === "function") { this.media.on("enter-annotation", function(_a) { _this.redraw(_a.getMedia()); - }) + }); } this.redraw(); }; @@ -81,9 +81,9 @@ left: _scale * _annotation.begin, width: _scale * (_annotation.end - _annotation.begin), color: ( typeof _annotation.color !== "undefined" && _annotation.color ? _annotation.color : _this.default_color ) - } - }) -} + }; + }); +}; IriSP.Widgets.MediaList.prototype.redraw = function(_media) { if (typeof _media !== "undefined") { @@ -121,7 +121,7 @@ title: _media.title, description: _media.description, segments: _this.getSegments(_media) - }) + }); }).join(""); this.$.find('.Ldt-MediaList-OtherList').html(_html); } else { diff -r a4e00ed296f8 -r 9eee31426156 src/ldt/ldt/static/ldt/metadataplayer/Mediafragment.js --- a/src/ldt/ldt/static/ldt/metadataplayer/Mediafragment.js Mon Sep 30 16:56:58 2013 +0200 +++ b/src/ldt/ldt/static/ldt/metadataplayer/Mediafragment.js Tue Oct 01 17:07:16 2013 +0200 @@ -9,11 +9,11 @@ if (/^#/.test(_msg.data)) { _this.setWindowHash(_msg.data); } - }) + }); }; this.onMdpEvent("Mediafragment.setHashToAnnotation","setHashToAnnotation"); this.blocked = false; -} +}; IriSP.Widgets.Mediafragment.prototype = new IriSP.Widgets.Widget(); @@ -23,14 +23,14 @@ this.getWidgetAnnotations().forEach(function(_annotation) { _annotation.on("click", function() { _this.setHashToAnnotation(_annotation.id); - }) + }); }); if (this.media.loadedMetadata) { this.goToHash(); } else { this.onMediaEvent("loadedmetadata","goToHash"); } -} +}; IriSP.Widgets.Mediafragment.prototype.setWindowHash = function(_hash) { if (typeof window.history !== "undefined" && typeof window.history.replaceState !== "undefined") { @@ -38,7 +38,7 @@ } else { document.location.hash = _hash; } -} +}; IriSP.Widgets.Mediafragment.prototype.getLastHash = function() { var _tab = document.location.hash.replace(/^#/,'').split('&'); @@ -49,7 +49,7 @@ _tab.push(this.last_hash_key + '=' + this.last_hash_value); } return '#' + _tab.join('&'); -} +}; IriSP.Widgets.Mediafragment.prototype.goToHash = function() { if (document.location.hash !== this.getLastHash()) { @@ -72,15 +72,15 @@ } } } -} +}; IriSP.Widgets.Mediafragment.prototype.setHashToAnnotation = function(_annotationId) { this.setHash( 'id', _annotationId ); -} +}; IriSP.Widgets.Mediafragment.prototype.setHashToTime = function() { this.setHash( 't', this.media.getCurrentTime().getSeconds() ); -} +}; IriSP.Widgets.Mediafragment.prototype.setHash = function(_key, _value) { if (!this.blocked && (this.last_hash_key !== _key || this.last_hash_value !== _value)) { @@ -89,11 +89,11 @@ var _hash = this.getLastHash(); this.setWindowHash(_hash); if (window.parent !== window) { - window.parent.postMessage(_hash,"*") + window.parent.postMessage(_hash,"*"); } this.block(); } -} +}; IriSP.Widgets.Mediafragment.prototype.unblock = function() { if (typeof this.blockTimeout !== "undefined") { @@ -101,7 +101,7 @@ } this.blockTimeout = undefined; this.blocked = false; -} +}; IriSP.Widgets.Mediafragment.prototype.block = function() { if (typeof this.blockTimeout !== "undefined") { @@ -109,4 +109,4 @@ } this.blocked = true; this.blockTimeout = window.setTimeout(this.functionWrapper("unblock"), 1500); -} +}; diff -r a4e00ed296f8 -r 9eee31426156 src/ldt/ldt/static/ldt/metadataplayer/MultiSegments.js --- a/src/ldt/ldt/static/ldt/metadataplayer/MultiSegments.js Mon Sep 30 16:56:58 2013 +0200 +++ b/src/ldt/ldt/static/ldt/metadataplayer/MultiSegments.js Tue Oct 01 17:07:16 2013 +0200 @@ -9,7 +9,7 @@ annotation_start_minimized: true, annotation_show_annotation_type: true, show_all: false -} +}; IriSP.Widgets.MultiSegments.prototype.draw = function() { var _this = this, @@ -24,7 +24,7 @@ if (/^annotation_/.test(_k)) { annotationopts[_k.replace(/^annotation_/,"")] = _v; } - }) + }); this.source.getAnnotationTypes().forEach(function(_anntype) { var segments = _anntype.getAnnotations().filter(function(_ann) { return _ann.getDuration() > 0; @@ -54,7 +54,7 @@ this.annotationWidget.slideDown(); } } - } + }; line.segmentWidget @@ -96,7 +96,7 @@ lines.push(line); } }); - var _annotationWidgets = _this.$.find(".Ldt-MultiSegments-Annotation") + var _annotationWidgets = _this.$.find(".Ldt-MultiSegments-Annotation"); function checkVisibilities(_time) { if (!_this.show_all && currentLine && !currentLine.hasSegmentsNow()) { @@ -119,4 +119,4 @@ } this.onMediaEvent("timeupdate", checkVisibilities); -} \ No newline at end of file +}; \ No newline at end of file diff -r a4e00ed296f8 -r 9eee31426156 src/ldt/ldt/static/ldt/metadataplayer/PopcornPlayer.js --- a/src/ldt/ldt/static/ldt/metadataplayer/PopcornPlayer.js Mon Sep 30 16:56:58 2013 +0200 +++ b/src/ldt/ldt/static/ldt/metadataplayer/PopcornPlayer.js Tue Oct 01 17:07:16 2013 +0200 @@ -7,7 +7,7 @@ /* A Popcorn-based player for HTML5 Video, Youtube and Vimeo */ IriSP.Widgets.PopcornPlayer.prototype.defaults = { -} +}; IriSP.Widgets.PopcornPlayer.prototype.draw = function() { @@ -112,7 +112,7 @@ getVolume(); _media.trigger("loadedmetadata"); _media.trigger("volumechange"); - }) + }); _popcorn.on("timeupdate", function() { _media.trigger("timeupdate", new IriSP.Model.Time(1000*_popcorn.currentTime())); @@ -121,7 +121,7 @@ _popcorn.on("volumechange", function() { getVolume(); _media.trigger("volumechange"); - }) + }); _popcorn.on("play", function() { _media.trigger("play"); @@ -135,4 +135,4 @@ _media.trigger("seeked"); }); -} \ No newline at end of file +}; \ No newline at end of file diff -r a4e00ed296f8 -r 9eee31426156 src/ldt/ldt/static/ldt/metadataplayer/Segments.js --- a/src/ldt/ldt/static/ldt/metadataplayer/Segments.js Mon Sep 30 16:56:58 2013 +0200 +++ b/src/ldt/ldt/static/ldt/metadataplayer/Segments.js Tue Oct 01 17:07:16 2013 +0200 @@ -23,7 +23,7 @@ IriSP.Widgets.Segments.prototype.annotationTemplate = '
' + + 'style="top:{{top}}px; height:{{height}}px; left:{{left}}px; width:{{width}}px; background:{{medcolor}}" data-base-color="{{color}}" data-low-color="{{lowcolor}}" data-medium-color="{{medcolor}}">
'; IriSP.Widgets.Segments.prototype.draw = function() { @@ -58,7 +58,7 @@ _fulltext = _annotation.title + ( _annotation.description ? ( '
' + _annotation.description ) : '' ), line = IriSP._(lines).find(function(line) { return !IriSP._(line.annotations).find(function(a) { - return a.begin < _annotation.end && a.end > _annotation.begin + return a.begin < _annotation.end && a.end > _annotation.begin; }); }); if (!line) { @@ -165,11 +165,11 @@ _segment.css("background", _segment.attr("data-medium-color")).removeClass("found"); }); }); -} +}; IriSP.Widgets.Segments.prototype.onTimeupdate = function(_time) { var _x = Math.floor( this.width * _time / this.media.duration); this.$.find('.Ldt-Segments-Position').css({ left: _x + "px" - }) -} \ No newline at end of file + }); +}; \ No newline at end of file diff -r a4e00ed296f8 -r 9eee31426156 src/ldt/ldt/static/ldt/metadataplayer/Slice.js --- a/src/ldt/ldt/static/ldt/metadataplayer/Slice.js Mon Sep 30 16:56:58 2013 +0200 +++ b/src/ldt/ldt/static/ldt/metadataplayer/Slice.js Tue Oct 01 17:07:16 2013 +0200 @@ -15,7 +15,7 @@ IriSP.Widgets.Slice.prototype.template = '
' - + '{{#show_arrow}}
{{/show_arrow}}' + + '{{#show_arrow}}
{{/show_arrow}}'; IriSP.Widgets.Slice.prototype.draw = function() { @@ -40,7 +40,7 @@ max: this.max, change: function(event, ui) { if (_this.arrow) { - _this.arrow.moveToTime((ui.values[0]+ui.values[1])/2) + _this.arrow.moveToTime((ui.values[0]+ui.values[1])/2); } if (_this.onBoundsChanged) { _this.onBoundsChanged(ui.values[0],ui.values[1]); @@ -74,8 +74,8 @@ IriSP.Widgets.Slice.prototype.show = function() { this.$slider.show(); -} +}; IriSP.Widgets.Slice.prototype.hide = function() { this.$slider.hide(); -} +}; diff -r a4e00ed296f8 -r 9eee31426156 src/ldt/ldt/static/ldt/metadataplayer/Slider.js --- a/src/ldt/ldt/static/ldt/metadataplayer/Slider.js Mon Sep 30 16:56:58 2013 +0200 +++ b/src/ldt/ldt/static/ldt/metadataplayer/Slider.js Tue Oct 01 17:07:16 2013 +0200 @@ -16,7 +16,7 @@ }; IriSP.Widgets.Slider.prototype.template = - '
00:00
' + '
00:00
'; IriSP.Widgets.Slider.prototype.draw = function() { @@ -69,7 +69,7 @@ IriSP.Widgets.Slider.prototype.onTimeupdate = function(_time) { this.$slider.slider("value",_time); this.player.trigger("Arrow.updatePosition",{widget: this.type, time: _time}); -} +}; IriSP.Widgets.Slider.prototype.onMouseover = function() { if (this.minimize_timeout) { @@ -82,7 +82,7 @@ this.maximized = true; } } -} +}; IriSP.Widgets.Slider.prototype.onMouseout = function() { this.$time.hide(); @@ -100,7 +100,7 @@ _this.timeoutId = false; }, this.minimize_timeout); } -} +}; IriSP.Widgets.Slider.prototype.animateToHeight = function(_height) { this.$slider.stop().animate( @@ -115,19 +115,19 @@ function() { IriSP.jQuery(this).css("overflow","visible"); }); -} +}; IriSP.Widgets.Slider.prototype.calculateSliderCss = function(_size) { return { height: _size + "px", "margin-top": (this.minimized_height - _size) + "px" }; -} +}; IriSP.Widgets.Slider.prototype.calculateHandleCss = function(_size) { return { height: (2 + _size) + "px", width: (2 + _size) + "px", "margin-left": -Math.ceil(2 + _size / 2) + "px" - } -} \ No newline at end of file + }; +}; \ No newline at end of file diff -r a4e00ed296f8 -r 9eee31426156 src/ldt/ldt/static/ldt/metadataplayer/Slideshare.js --- a/src/ldt/ldt/static/ldt/metadataplayer/Slideshare.js Mon Sep 30 16:56:58 2013 +0200 +++ b/src/ldt/ldt/static/ldt/metadataplayer/Slideshare.js Tue Oct 01 17:07:16 2013 +0200 @@ -2,14 +2,14 @@ IriSP.Widgets.Slideshare = function(player, config) { IriSP.Widgets.Widget.call(this, player, config); -} +}; IriSP.Widgets.Slideshare.prototype = new IriSP.Widgets.Widget(); IriSP.Widgets.Slideshare.prototype.defaults = { annotation_type: "slide", sync: true, -} +}; IriSP.Widgets.Slideshare.prototype.messages = { fr: { @@ -18,7 +18,7 @@ en: { slides_ : "Slides" } -} +}; IriSP.Widgets.Slideshare.prototype.template = '

{{l10n.slides_}}


'; @@ -35,7 +35,7 @@ var _id = IriSP.Model.getUID(), _params = { allowScriptAccess: "always" - } + }, _atts = { id: _id }, @@ -69,7 +69,7 @@ _embedObject = null, _oembedCache = {}, _lastEmbedded = "", - _this = this + _this = this, $container = this.$.find(".Ldt-SlideShare-Container"); this.embed_width = this.embed_width || $container.innerWidth(); @@ -111,7 +111,7 @@ } _lastPres = _presentation; - }) - }) + }); + }); } -} +}; diff -r a4e00ed296f8 -r 9eee31426156 src/ldt/ldt/static/ldt/metadataplayer/Social.js --- a/src/ldt/ldt/static/ldt/metadataplayer/Social.js Mon Sep 30 16:56:58 2013 +0200 +++ b/src/ldt/ldt/static/ldt/metadataplayer/Social.js Tue Oct 01 17:07:16 2013 +0200 @@ -3,7 +3,7 @@ IriSP.Widgets.Social = function(player, config) { IriSP.Widgets.Widget.call(this, player, config); ZeroClipboard.setMoviePath( IriSP.getLib('zeroClipboardSwf') ); -} +}; IriSP.Widgets.Social.prototype = new IriSP.Widgets.Widget(); @@ -15,7 +15,7 @@ show_fb: true, show_gplus: true, show_mail: true -} +}; IriSP.Widgets.Social.prototype.template = '{{#show_url}}
' @@ -38,7 +38,7 @@ share_link: "Share hypertext link", copy: "Copy" } -} +}; IriSP.Widgets.Social.prototype.draw = function() { this.renderTemplate(); @@ -63,7 +63,7 @@ return false; }); this.updateUrls(this.url, this.text); -} +}; IriSP.Widgets.Social.prototype.toggleCopy = function() { var _pop = this.$.find(".Ldt-Social-UrlPop"); @@ -85,7 +85,7 @@ } else { this.clip.hide(); } -} +}; IriSP.Widgets.Social.prototype.updateUrls = function(_url, _text) { this.url = _url; @@ -94,4 +94,4 @@ this.$.find(".Ldt-Social-Twitter").attr("href", "https://twitter.com/intent/tweet?" + IriSP.jQuery.param({ url: _url, text: _text })); this.$.find(".Ldt-Social-Gplus").attr("href", "https://plus.google.com/share?" + IriSP.jQuery.param({ url: _url, title: _text })); this.$.find(".Ldt-Social-Mail").attr("href", "mailto:?" + IriSP.jQuery.param({ subject: _text, body: _text + ": " + _url })); -} +}; diff -r a4e00ed296f8 -r 9eee31426156 src/ldt/ldt/static/ldt/metadataplayer/Sparkline.js --- a/src/ldt/ldt/static/ldt/metadataplayer/Sparkline.js Mon Sep 30 16:56:58 2013 +0200 +++ b/src/ldt/ldt/static/ldt/metadataplayer/Sparkline.js Tue Oct 01 17:07:16 2013 +0200 @@ -48,7 +48,7 @@ _d = IriSP._(_y).reduce(function(_memo, _v, _k) { return _memo + ( _k ? 'C' + (_k * _width) + ' ' + _y[_k - 1] + ' ' + (_k * _width) + ' ' + _v + ' ' + ((_k + .5) * _width) + ' ' + _v - : 'M0 ' + _v + 'L' + (.5*_width) + ' ' + _v ) + : 'M0 ' + _v + 'L' + (.5*_width) + ' ' + _v ); },'') + 'L' + this.width + ' ' + _y[_y.length - 1], _d2 = _d + 'L' + this.width + ' ' + this.height + 'L0 ' + this.height; @@ -78,7 +78,7 @@ }); this.onMediaEvent("timeupdate","onTimeupdate"); -} +}; IriSP.Widgets.Sparkline.prototype.onTimeupdate = function(_time) { var _x = Math.floor( this.width * _time / this.media.duration); @@ -88,4 +88,4 @@ this.ligneProgress.attr({ "path" : "M" + _x + " 0L" + _x + " " + this.height }); -} +}; diff -r a4e00ed296f8 -r 9eee31426156 src/ldt/ldt/static/ldt/metadataplayer/Tagcloud.js --- a/src/ldt/ldt/static/ldt/metadataplayer/Tagcloud.js Mon Sep 30 16:56:58 2013 +0200 +++ b/src/ldt/ldt/static/ldt/metadataplayer/Tagcloud.js Tue Oct 01 17:07:16 2013 +0200 @@ -1,7 +1,7 @@ IriSP.Widgets.Tagcloud = function(player, config) { IriSP.Widgets.Widget.call(this, player, config); this.stopwords = IriSP._.uniq([].concat(this.custom_stopwords).concat(this.stopword_lists[this.stopword_language])); -} +}; IriSP.Widgets.Tagcloud.prototype = new IriSP.Widgets.Widget(); @@ -22,7 +22,7 @@ segment_annotation_type: false, min_font_size: 10, max_font_size: 26 -} +}; IriSP.Widgets.Tagcloud.prototype.stopword_lists = { "fr" : [ @@ -36,7 +36,7 @@ 'get', 'here', 'http', 'like', 'more', 'one', 'our', 'she', 'that', 'the', 'their', 'then', 'there', 'they', 'this', 'very', 'what', 'when', 'where', 'who', 'why', 'will', 'with', 'www', 'you', 'your' ] -} +}; IriSP.Widgets.Tagcloud.prototype.draw = function() { @@ -45,12 +45,12 @@ this.source.getAnnotationsByTypeTitle(this.segment_annotation_type).forEach(function(_a) { _a.on("enter", function() { _this.redraw(_a.begin, _a.end); - }) + }); }); } else { this.redraw(); } -} +}; IriSP.Widgets.Tagcloud.prototype.redraw = function(_from, _to) { var _urlRegExp = /https?:\/\/[0-9a-zA-Z\.%\/-_]+/g, @@ -62,7 +62,7 @@ if (typeof _from !== "undefined" && typeof _to !== "undefined") { _annotations = _annotations.filter(function(_annotation) { return _annotation.begin >= _from && _annotation.end <= _to; - }) + }); } _annotations.forEach(function(_annotation) { @@ -76,7 +76,7 @@ if (IriSP._(_this.stopwords).indexOf(_word) == -1 && (!_this.exclude_pattern || !_this.exclude_pattern.test(_word))) { _words[_word] = 1 + (_words[_word] || 0); } - }) + }); }); _words = IriSP._(_words) .chain() @@ -84,7 +84,7 @@ return { "word" : _k, "count" : _v - } + }; }) .filter(function(_v) { return _v.count > 2; @@ -109,7 +109,7 @@ }); this.source.getAnnotations().on("search", this.functionWrapper("onSearch")); this.source.getAnnotations().on("search-cleared", this.functionWrapper("onSearch")); -} +}; IriSP.Widgets.Tagcloud.prototype.onSearch = function(searchString) { searchString = typeof searchString !== "undefined" ? searchString : ''; @@ -125,4 +125,4 @@ _el.html(_txt); } }); -} +}; diff -r a4e00ed296f8 -r 9eee31426156 src/ldt/ldt/static/ldt/metadataplayer/Trace.js --- a/src/ldt/ldt/static/ldt/metadataplayer/Trace.js Mon Sep 30 16:56:58 2013 +0200 +++ b/src/ldt/ldt/static/ldt/metadataplayer/Trace.js Tue Oct 01 17:07:16 2013 +0200 @@ -1,7 +1,7 @@ IriSP.Widgets.Trace = function(player, config) { IriSP.Widgets.Widget.call(this, player, config); -} +}; IriSP.Widgets.Trace.prototype = new IriSP.Widgets.Widget(); @@ -13,7 +13,7 @@ default_subject: "IRI", tracer: null, extend: false -} +}; IriSP.Widgets.Trace.prototype.draw = function() { if (typeof window.tracemanager === "undefined") { @@ -37,7 +37,7 @@ IriSP._(_medialisteners).each(function(_ms, _listener) { var _f = function(_arg) { _this.eventHandler(_listener, _arg); - } + }; if (_ms) { _f = IriSP._.throttle(_f, _ms); } @@ -47,7 +47,7 @@ IriSP._(_annlisteners).each(function(_ms, _listener) { var _f = function(_arg) { _this.eventHandler(_listener, _arg); - } + }; if (_ms) { _f = IriSP._.throttle(_f, _ms); } @@ -93,15 +93,15 @@ } _this.eventHandler('UIEvent', _data); }); -} +}; IriSP.Widgets.Trace.prototype.eventHandler = function(_listener, _arg) { var _traceName = 'Mdp_'; if (typeof _arg == "string" || typeof _arg == "number") { - _arg = { "value" : _arg } + _arg = { "value" : _arg }; } if (typeof _arg == "undefined") { - _arg = {} + _arg = {}; } switch(_listener) { case 'UIEvent': @@ -127,4 +127,4 @@ if (this.js_console && typeof window.console !== "undefined" && typeof console.log !== "undefined") { console.log("tracer.trace('" + _traceName + "', " + JSON.stringify(_arg) + ");"); } -} \ No newline at end of file +}; \ No newline at end of file diff -r a4e00ed296f8 -r 9eee31426156 src/ldt/ldt/static/ldt/metadataplayer/Tweet.js --- a/src/ldt/ldt/static/ldt/metadataplayer/Tweet.js Mon Sep 30 16:56:58 2013 +0200 +++ b/src/ldt/ldt/static/ldt/metadataplayer/Tweet.js Tue Oct 01 17:07:16 2013 +0200 @@ -27,7 +27,7 @@ ], annotation_type: "tweet", pin_at_start: false -} +}; IriSP.Widgets.Tweet.prototype.messages = { "fr": { @@ -50,7 +50,7 @@ video_time: "Video time: ", show_original: "Show original" } -} +}; IriSP.Widgets.Tweet.prototype.template = '
' @@ -71,7 +71,7 @@ var _this = this; this.$.find(".Ldt-Tweet-Pin").click(function() { _this.pinned = !_this.pinned; - var _el = IriSP.jQuery(this) + var _el = IriSP.jQuery(this); if (_this.pinned) { _el.addClass("active").attr("title",_this.l10n.dont_keep_visible); _this.cancelTimeout(); @@ -89,7 +89,7 @@ _this.show(_annotation); }); }); -} +}; IriSP.Widgets.Tweet.prototype.show = function(_tweet) { if (typeof _tweet !== "undefined" && typeof _tweet.source !== "undefined") { @@ -97,7 +97,7 @@ [ /#(\w+)/gm, function(matches) { - return '' + return ''; }, '' ] @@ -147,22 +147,22 @@ } else { this.hide(); } -} +}; IriSP.Widgets.Tweet.prototype.hide = function() { this.player.trigger("Annotation.maximize"); this.$.slideUp(); this.cancelTimeout(); -} +}; IriSP.Widgets.Tweet.prototype.cancelTimeout = function() { if (typeof this.hide_timer !== "undefined") { window.clearTimeout(this.hide_timer); this.hide_timer = undefined; } -} +}; IriSP.Widgets.Tweet.prototype.hideTimeout = function() { this.cancelTimeout(); this.hide_timer = window.setTimeout(this.functionWrapper("hide"), this.hide_timeout); -} +};