# HG changeset patch # User veltr # Date 1357746600 -3600 # Node ID fb4d0566ab199183526f1115f862a25ccdcbccb6 # Parent 07d4049eec01fe44968dbe15d630fa4d2032cd9f Bugfixes, Segment list now moves when changing segments diff -r 07d4049eec01 -r fb4d0566ab19 integration/content.html --- a/integration/content.html Mon Jan 07 15:54:47 2013 +0100 +++ b/integration/content.html Wed Jan 09 16:50:00 2013 +0100 @@ -27,29 +27,10 @@ post_annotation : "testdata/post-test.php", tag_page : "tag.html?tag=__TAG__" }; - if (typeof window.localStorage !== "undefined" && window.localStorage.getItem !== "undefined") { - var res = window.localStorage.getItem("resolution") || "SD"; - } else { - var res = "SD"; - } - IriSP.video_url_transform = function(url) { - return url.replace(/[SH]D(\.[a-z0-9]+)$/,res + "$1"); - } $(function() { IriSP.contentplayer({ project_url: "http://theend-integ.ftinfo.fr/theend/ldt/cljson/id/" + project }); - - $(".sdhdgroup").addClass(res); - - $(".sdhdbtn").click(function() { - var newres = $(this).attr("title"); - if (res !== newres) { - window.localStorage.setItem("resolution", newres); - document.location.reload(); - } - return false; - }); }); @@ -123,6 +104,18 @@ + +
+
+ +
+ diff -r 07d4049eec01 -r fb4d0566ab19 integration/css/theend.css --- a/integration/css/theend.css Mon Jan 07 15:54:47 2013 +0100 +++ b/integration/css/theend.css Wed Jan 09 16:50:00 2013 +0100 @@ -535,3 +535,51 @@ max-width: 210px; max-height: 500px; } + +/* LIGHTBOX */ + +.lightBoxWrap { + display: none; z-index: 100; +} + +.lightBoxWrap, .lightBoxBg { + position: absolute; top: 0; left: 0; right: 0; bottom: 0; +} + +.lightBoxBg { + background: black; opacity: .8; +} + +.lightBox { + position: absolute; top: 120px; left: 120px; right: 120px; bottom: 120px; +} + +.lightBoxScroll { + position: absolute; top: 30px; left: 0; right: 0; bottom: 0; overflow: auto; +} + +.lightBox h3 { + color: #FFFFFF; font-family: "arial_black", sans-serif; + font-size: 18px; text-align: center; margin: 3px 0; +} + +a.lightBoxClose { + float: right; font-size: 24px; color: #ACACAC; + font-family: "arial_black", sans-serif; +} + +a.lightBoxClose:hover { + color: #FFFFFF; +} + +.lightBoxScroll { + color: #ACACAC; +} + +.lightBoxScroll p, .lightBoxScroll h4 { + font-size: 14px; margin: 1em 0; +} + +.lightBoxScroll h4 { + font-weight: bold; +} diff -r 07d4049eec01 -r fb4d0566ab19 integration/home.html --- a/integration/home.html Mon Jan 07 15:54:47 2013 +0100 +++ b/integration/home.html Wed Jan 09 16:50:00 2013 +0100 @@ -44,7 +44,18 @@
- + +
+
+ +
+ diff -r 07d4049eec01 -r fb4d0566ab19 integration/js/contentplayer.js --- a/integration/js/contentplayer.js Mon Jan 07 15:54:47 2013 +0100 +++ b/integration/js/contentplayer.js Wed Jan 09 16:50:00 2013 +0100 @@ -12,6 +12,15 @@ seqCount; var ratio = 2.37; + + if (typeof window.localStorage !== "undefined" && window.localStorage.getItem !== "undefined") { + var resolution = window.localStorage.getItem("resolution") || "SD"; + } else { + var resolution = "SD"; + } + var video_url_transform = function(url) { + return url.replace(/[SH]D(\.[a-z0-9]+)$/,resolution + "$1"); + } function resizeVideo() { var currentwidth = $(window).width(), @@ -62,7 +71,11 @@ function resizeSegmentDrag() { var segmentdelta = segmentdragout.width() - segmentdragin.width(); - segmentdragin.draggable("option","containment",segmentdelta < 0 ? [ segmentdelta - 20, 0, 20, 0 ] : "parent") + segmentdragin.draggable("option","containment",segmentdelta < 0 ? [ segmentdelta - 20, 0, 20, 0 ] : "parent"); + if (segmentdelta < 0 && currentSegment && $("#title_sequence li").length) { + var x = $("#title_sequence li[data-segment-id='" + currentSegment.id + "']").offset().left - segmentdragin.offset().left; + segmentdragin.css("left", Math.max(segmentdelta - 20, Math.min( 20, 36 - x))) + } } segmentdragin.draggable({ @@ -93,10 +106,10 @@ tagsdragin = tagsdragout.find("ul") tagsdragging = false; - function resizeTagsDrag() { + function resizeTagsDrag(toRight) { var tagsdelta = tagsdragout.width() - tagsdragin.width(); tagsdragin.draggable("option","containment",tagsdelta < 0 ? [ tagsdelta - 20, 0, 20, 0 ] : "parent"); - tagsdragin.css("left",Math.floor(tagsdelta/2)); + tagsdragin.css("left",(toRight && tagsdelta < 0) ? tagsdelta - 20 : Math.floor(tagsdelta/2)); } tagsdragin.draggable({ @@ -196,7 +209,7 @@ success: function(_data) { var n = 1 + (segmentAtPost.__tags[_tagvalue] || 0) segmentAtPost.__tags[_tagvalue] = n; - showCurrentTags(); + showCurrentTags(_tagvalue); }, error: function(_xhr, _error, _thrown) { console.log("Error when sending annotation", _thrown); @@ -248,6 +261,7 @@ showCurrentTags(); $("#title_sequence li").removeClass("here"); $("#title_sequence li[data-segment-id='" + s.id + "']").addClass("here"); + resizeSegmentDrag(); }); }); @@ -257,28 +271,41 @@ currentMedia.play(); }); - function showCurrentTags() { + function showCurrentTags(tagToShow) { var vals = _(currentSegment.__tags).values(), max = Math.max.apply(Math, vals), min = Math.min(max - 1, Math.min.apply(Math, vals)), - b = 160 / (max - min); - var html = _(currentSegment.__tags) - .chain() - .map(function(v, k) { - var c = Math.floor( 95 + (v - min) * b ); - return '
  • ' - + k - + '
  • ' - }) - .shuffle() - .value() - .join(""); + + tag.label + + ' '; + }, + ""); tagsdragin.html(html); - resizeTagsDrag(); + resizeTagsDrag(!!tagToShow); } function addMedia(media) { @@ -288,11 +315,8 @@ media.has_player = true; media.loaded = false; media.paused = true; - var videourl = media.video; - if (typeof IriSP.video_url_transform === "function") { - videourl = IriSP.video_url_transform(media.video); - } - var videoid = "video_" + media.id, + var videourl = video_url_transform(media.video), + videoid = "video_" + media.id, videoEl = $('