From 5e321e201066f76d1072da4f33301fad865aacac Mon Sep 17 00:00:00 2001 From: riccardo Date: Wed, 25 May 2011 16:50:31 +0200 Subject: [PATCH] fixed ruler height and folds anchor background images (incremented 1px) --- telemeta/htdocs/css/telemeta.css | 4 ++-- telemeta/htdocs/js/application.js | 3 ++- telemeta/htdocs/timeside/js/playerLoader.js | 5 ----- telemeta/htdocs/timeside/js/ruler.js | 19 +++++++++++-------- 4 files changed, 15 insertions(+), 16 deletions(-) diff --git a/telemeta/htdocs/css/telemeta.css b/telemeta/htdocs/css/telemeta.css index ad62bc1a..c60e47bb 100644 --- a/telemeta/htdocs/css/telemeta.css +++ b/telemeta/htdocs/css/telemeta.css @@ -642,7 +642,7 @@ dl.dublincore dd.caption { text-decoration: none; margin: 0; background: #fff url(more.png) no-repeat left top; - background-position: 0 -17px; + background-position: 0 -16px; padding-bottom: 2px; padding-left: 16px; border-bottom: none !important; @@ -658,7 +658,7 @@ dl.dublincore dd.caption { border-bottom: none; } .extraInfos .folded h4 a { - background-position: 0 0px; + background-position: 0 1px; } /* Pagination */ diff --git a/telemeta/htdocs/js/application.js b/telemeta/htdocs/js/application.js index decd3cfd..da317ff4 100644 --- a/telemeta/htdocs/js/application.js +++ b/telemeta/htdocs/js/application.js @@ -46,7 +46,7 @@ jQuery(document).ready(function() { }); /** - *function inherited from old code, never touched. Guess fixes the left data table, if any + *function inherited from old code, never touched. Guess fixes the click on the left data table, if any */ function foldInfoBlocks() { var $J = jQuery; @@ -54,6 +54,7 @@ function foldInfoBlocks() { extra.find('.folded dl, .folded table').css('display', 'none'); extra.find('a').click(function() { $J(this).parents('.extraInfos').children().toggleClass('folded').find('dl, table').toggle(100); + //toggle toggles the visibility of elements return false; }); } diff --git a/telemeta/htdocs/timeside/js/playerLoader.js b/telemeta/htdocs/timeside/js/playerLoader.js index 89a21a9e..131d7fb1 100644 --- a/telemeta/htdocs/timeside/js/playerLoader.js +++ b/telemeta/htdocs/timeside/js/playerLoader.js @@ -176,16 +176,11 @@ function loadPlayer(analizerUrl, soundUrl, itemId, visualizers, currentUserName, //3) assing a binding to the player maximization button: $J('#player_maximized .toggle, #player_minimized .toggle').click(function() { togglePlayerMaximization(); - //alert(this); - //this.blur(); return false; }); } p.setupInterface(cbckAtEnd); - player = p; - - }); }; diff --git a/telemeta/htdocs/timeside/js/ruler.js b/telemeta/htdocs/timeside/js/ruler.js index a5c6459a..611e30f3 100644 --- a/telemeta/htdocs/timeside/js/ruler.js +++ b/telemeta/htdocs/timeside/js/ruler.js @@ -80,10 +80,15 @@ var Ruler = TimesideArray.extend({ rulerContainer.find(':not(a.ts-pointer,a.ts-marker,a.ts-pointer>*,a.ts-marker>*)').remove(); //calculate h with an artifice: create a span (that will be reused later) with the "standard" label - var firstSpan = $J('').html('00000'); //typical timelabel should be '00:00', with '00000' we assure a bit of extra safety space - rulerContainer.append(firstSpan); + var firstSpan = $J('').css({ + 'display':'block', + 'position':'absolute' + }).html('00000'); //typical timelabel should be '00:00', with '00000' we assure a bit of extra safety space + //note also that display and position must be set as below to calculate the proper outerHeight + rulerContainer.append(firstSpan); //to calculate height, element must be in the document, append it var verticalMargin = 1; var h = 2*(verticalMargin+firstSpan.outerHeight()); + var obj = this.calculateRulerElements(rulerContainer.width(),h,firstSpan.outerWidth()); var paper = Raphael(rulerContainer[0], rulerContainer.width(), h); @@ -92,7 +97,6 @@ var Ruler = TimesideArray.extend({ var labels = obj.labels; if(labels){ - for(var i=0; i ')); span.html(labels[i][0]).css({ @@ -139,7 +143,9 @@ var Ruler = TimesideArray.extend({ var duration = this.getSoundDuration(); - var fontMargin = 0; + var fontLeftMargin = 2; //should be eual or greater to the ruler stroke width, so that + //the labels are not overlapping the vertical ruler lines + timeLabelWidth+=fontLeftMargin; var timeLabelDuration = timeLabelWidth*duration/w; @@ -174,19 +180,16 @@ var Ruler = TimesideArray.extend({ for(var j=1; j