]> git.parisson.com Git - telemeta.git/commitdiff
fixed ruler height and folds anchor background images (incremented 1px)
authorriccardo <riccardo@parisson.com>
Wed, 25 May 2011 14:50:31 +0000 (16:50 +0200)
committerriccardo <riccardo@parisson.com>
Wed, 25 May 2011 14:50:31 +0000 (16:50 +0200)
telemeta/htdocs/css/telemeta.css
telemeta/htdocs/js/application.js
telemeta/htdocs/timeside/js/playerLoader.js
telemeta/htdocs/timeside/js/ruler.js

index ad62bc1a540473d1b128a849628412570ecae882..c60e47bb38dd656ebbfd152d55ec07946a643b60 100644 (file)
@@ -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 */
index decd3cfde7698aa4f71ea46785807eec83b9fe4c..da317ff4f0df070e57d8fb8884a60ca4d66363d4 100644 (file)
@@ -46,7 +46,7 @@ jQuery(document).ready(function() {
 });\r
 \r
 /**\r
- *function inherited from old code, never touched. Guess fixes the left data table, if any\r
+ *function inherited from old code, never touched. Guess fixes the click on the left data table, if any\r
  */\r
 function foldInfoBlocks() {\r
     var $J = jQuery;\r
@@ -54,6 +54,7 @@ function foldInfoBlocks() {
     extra.find('.folded dl, .folded table').css('display', 'none');\r
     extra.find('a').click(function() {\r
         $J(this).parents('.extraInfos').children().toggleClass('folded').find('dl, table').toggle(100);\r
+        //toggle toggles the visibility of elements\r
         return false;\r
     });\r
 }\r
index 89a21a9e42443a9f937a51844318e16b5e4e0c78..131d7fb169b37307c1b9fddd70ea7a84e58ee5ea 100644 (file)
@@ -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;
-
-           
         });
     };
 
index a5c6459ab234514ca7832e266f54a00ef9b28ea5..611e30f32b95fca43ec85dc8581b402ad5ecf377 100644 (file)
@@ -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('<span/>').html('00000'); //typical timelabel should be '00:00', with '00000' we assure a bit of extra safety space
-        rulerContainer.append(firstSpan);
+        var firstSpan = $J('<span/>').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 <labels.length;i++){
                 var span = (i==0 ? firstSpan : $J('<span/>'));
                 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<tickCount+1; j++){
                 var k = i+j;
                 var x = (k*tickWidth);
-                //consolelog(k+') = '+x+' ; '+i+' * '+sectionWidth+' + '+j+' * '+tickWidth);
-                //if(x<w){
                 var y = (j==tickCount ? 0 : tickAtHalfSectionWidthHigher && j==(tickCount)/2 ? .5*h : .75*h);
                 var baseline = ' L '+x+' '+h_1;
                 path[k] = baseline;
                 path[k] += ' L '+x+' '+y;
                 path[k] += baseline;
-            //}
             }
         }
         var labels = new Array(sectionNums);
         for(i=0; i<sectionNums; i++){
-            labels[i] = [makeTimeLabel(sectionDuration*i),fontMargin+i*sectionWidth];
+            labels[i] = [makeTimeLabel(sectionDuration*i),fontLeftMargin+i*sectionWidth];
         }
         return {
             'path': path.join('')+' z',