]> git.parisson.com Git - telemeta.git/commitdiff
fixed popup bug and some code missing ";"
authorriccardo <riccardo@parisson.com>
Wed, 22 Jun 2011 11:43:03 +0000 (13:43 +0200)
committerriccardo <riccardo@parisson.com>
Wed, 22 Jun 2011 11:43:03 +0000 (13:43 +0200)
telemeta/htdocs/js/playerLoader.js
telemeta/htdocs/js/popupdiv.js
telemeta/htdocs/timeside/js/player.js
telemeta/htdocs/timeside/js/rulermarker.js

index 9343a9a946a4cd1652fc143ae5e39555be19aae1..5c39d49aa5a36f3a2b8297bcb5d1c585df96722e 100644 (file)
@@ -362,12 +362,12 @@ function loadPlayer(analizerUrl, soundUrl, soundImgSize, itemId, visualizers, cu
                         var confirmExit = function(){
                             var markerUnsaved=0;
                             map.each(function(i,marker){
-                                if(!marker.isSavedOnServer){
+                                if(!marker.isSavedOnServer || marker.isEditable){
                                     markerUnsaved++;
                                 }
                             });
                             if(markerUnsaved>0){
-                                return gettrans('there is at least one unsaved marker') +' ('+ markerUnsaved+ '). '+
+                                return gettrans('there are unsaved or modified markers') +' ('+ markerUnsaved+ '). '+
                                 gettrans('If you exit the page you will loose your changes');
                             }
 
@@ -382,7 +382,7 @@ function loadPlayer(analizerUrl, soundUrl, soundImgSize, itemId, visualizers, cu
                         //a number N means: popup stays maximum N seconds on the screen
                         if(POPUP_TIMEOUT){
                             var popupdiv = new PopupDiv({
-                                focusable: true,
+                                //focusable: false,
                                 titleClass: 'markersdivTitle',
                                 //showClose:true,
 
index 4784fa95741a90f8fd8d845cd379c6590142e1cb..fde0afd6cb793ae9499de8f771c82177fe8072a4 100644 (file)
@@ -1011,17 +1011,18 @@ function PopupDiv() {
             'top':bounds.y+'px'\r
         });\r
 \r
-    //        var topDiv =subdivs.eq(0);\r
-    //        var centralDiv = subdivs.eq(1);\r
-    //        var bottomDiv = subdivs.eq(2);\r
-    //        console.log('presize');\r
-    //        console.log('width: '+ topDiv.width()+' css-minWidth: ' +topDiv.css('minWidth')+' css-width: ' +topDiv.css('width')+' css-maxWidth: ' +topDiv.css('maxWidth'));\r
-    //        console.log('width: '+centralDiv.width()+' css-minWidth: ' +centralDiv.css('minWidth')+' css-width: ' +centralDiv.css('width')+' css-maxWidth: ' +centralDiv.css('maxWidth'));\r
-    //        console.log('width: '+bottomDiv.width()+' css-minWidth: ' +bottomDiv.css('minWidth')+' css-width: ' +bottomDiv.css('width')+' css-maxWidth: ' +bottomDiv.css('maxWidth'));\r
-    //        console.log(' ' );\r
+//            var topDiv =subdivs.eq(0);\r
+//            var centralDiv = subdivs.eq(1);\r
+//            var bottomDiv = subdivs.eq(2);\r
+//            console.log('presize');\r
+//            console.log('width: '+ topDiv.width()+' css-minWidth: ' +topDiv.css('minWidth')+' css-width: ' +topDiv.css('width')+' css-maxWidth: ' +topDiv.css('maxWidth'));\r
+//            console.log('width: '+centralDiv.width()+' css-minWidth: ' +centralDiv.css('minWidth')+' css-width: ' +centralDiv.css('width')+' css-maxWidth: ' +centralDiv.css('maxWidth'));\r
+//            console.log('width: '+bottomDiv.width()+' css-minWidth: ' +bottomDiv.css('minWidth')+' css-width: ' +bottomDiv.css('width')+' css-maxWidth: ' +bottomDiv.css('maxWidth'));\r
+//            console.log(' ' );\r
     };\r
     \r
     p.postSizeFcn = function(){\r
+        \r
         //set title and close button to span whole width, if necessary\r
         //closeButton.outerWidth should be zero if this.showClose = false\r
         //titleInput.outerWidth(true) should be equal to titleInput.width(), as margins borders and padding are zero, however we want to calculate it safely\r
@@ -1041,28 +1042,19 @@ function PopupDiv() {
         var maxWidth = div.width();\r
         var width = centralDiv.outerWidth(true);\r
             \r
-        if(maxHeight<=0 || maxWidth<=0){\r
-            //centralDiv.hide();\r
-            return;\r
-        }\r
         \r
-        //        if(maxHeight<height){\r
-        //            centralDiv.css('maxHeight',maxHeight+'px');\r
-        //        }\r
+        \r
+        \r
 \r
         //setting centralDiv maxHeight is buggy and not the same behaviour in all browsers\r
         //so we set a height, which will be reset in preSizeFcn\r
-        centralDiv.css('height',maxHeight+'px');\r
+        if(maxHeight>0){\r
+            centralDiv.css('height',maxHeight+'px');\r
+        }\r
         //same for width\r
-        centralDiv.css('width',maxWidth+'px');\r
+        //centralDiv.css('width',maxWidth+'px');\r
 \r
-        //TODO: check padding margins border or set them to zero in preSizeFcn!!!!!!\r
-\r
-\r
-        //        centralDiv.css('width',maxWidth+'px');\r
-        //        if(maxWidth<width){\r
-        //            centralDiv.css('maxWidth',maxWidth+'px');\r
-        //        }\r
+        \r
 \r
         //to be put AT THE END otherwise bug in IE7\r
         centralDiv.css('overflow','auto');\r
@@ -1074,16 +1066,14 @@ function PopupDiv() {
         //centralDiv.css('height',maxHeight);\r
         //}\r
 \r
-        //last thing: the subelements width property seems to be handles in different ways across browsers:\r
-        //in preSizeFcn, we set a width to auto. Curiously, when resizing the parent div (this.getDiv()), subelements are assigned\r
-        //a specified width property\r
-        //IE does what it is expected (werird enogh...), ie sets a maxWidth and\r
+        \r
+\r
+//                console.log('postsize');\r
+//                console.log('width: '+ topDiv.width()+' css-minWidth: ' +topDiv.css('minWidth')+' css-width: ' +topDiv.css('width')+' css-maxWidth: ' +topDiv.css('maxWidth'));\r
+//                console.log('width: '+centralDiv.width()+' css-minWidth: ' +centralDiv.css('minWidth')+' css-width: ' +centralDiv.css('width')+' css-maxWidth: ' +centralDiv.css('maxWidth'));\r
+//                console.log('width: '+bottomDiv.width()+' css-minWidth: ' +bottomDiv.css('minWidth')+' css-width: ' +bottomDiv.css('width')+' css-maxWidth: ' +bottomDiv.css('maxWidth'));\r
+//                console.log(' ' );\r
 \r
-        //        console.log('postsize');\r
-        //        console.log('width: '+ topDiv.width()+' css-minWidth: ' +topDiv.css('minWidth')+' css-width: ' +topDiv.css('width')+' css-maxWidth: ' +topDiv.css('maxWidth'));\r
-        //        console.log('width: '+centralDiv.width()+' css-minWidth: ' +centralDiv.css('minWidth')+' css-width: ' +centralDiv.css('width')+' css-maxWidth: ' +centralDiv.css('maxWidth'));\r
-        //        console.log('width: '+bottomDiv.width()+' css-minWidth: ' +bottomDiv.css('minWidth')+' css-width: ' +bottomDiv.css('width')+' css-maxWidth: ' +bottomDiv.css('maxWidth'));\r
-        //        console.log(' ' );\r
         if(this.isClickElement(this.invoker)){\r
             this.placeAsPopup();\r
         }else{\r
index 763f538d0bf1f3a01ad1bc9dc46080a6031e3675..45131f9f8c1f7a3f8aa3c35867099f8756126f79 100644 (file)
@@ -92,7 +92,7 @@ Timeside.classes.Player = Timeside.classes.TimesideClass.extend({
         var map = new Timeside.classes.MarkerMap();
         this.getMarkerMap = function(){
             return map;
-        }
+        };
 
         var canAddMarkers = false;
         if(newMarkerCallback){
@@ -262,7 +262,7 @@ Timeside.classes.Player = Timeside.classes.TimesideClass.extend({
         //var ruler = new Timeside.classes.Ruler(viewer, this.getSoundDuration());
         this.getRuler = function(){
             return ruler;
-        }
+        };
         //bind mouse events:
         ruler.bind('rulermarkermouseevent', function(data){
            var idx = data.index;
@@ -632,7 +632,7 @@ Timeside.classes.Player = Timeside.classes.TimesideClass.extend({
             var style = {
                 width: wave.width(),
                 height: height
-            }
+            };
             elements.css(style);
             elements.css('position','absolute');
 
index fc1825f34dfb8fcdf2e7cf7354b8992282629d9e..ae0cd88e5c487e5df7bd8324f0625f6a6e21af1b 100644 (file)
@@ -69,21 +69,21 @@ Timeside.classes.RulerMarker = Timeside.classes.TimesideClass.extend({
         };
         this.getIndex = function(){
             return index;
-        }
+        };
 
         //end=======================================================
         //creating public methods:
         this.getLabel = function(){
             return label;
-        }
+        };
 
 
         this.getRulerWidth = function(){
             return rulerDiv.width();
-        }
+        };
         this.getWaveHeight = function(){
             return waveImgDiv.height();
-        }
+        };
 
         this.positionInPixels = 0;
         this.positionAsViewerRatio = 0;
@@ -99,7 +99,7 @@ Timeside.classes.RulerMarker = Timeside.classes.TimesideClass.extend({
             path.setAttributeNS(null,'class',canvasClass);
             this.moveCanvas = function(pixelOffset){
                 canvas.setAttributeNS( null, "transform", "translate("+pixelOffset+",0)");
-            }
+            };
             this.jQueryCanvas = $J(canvas);
         }else{
             canvas = this.createCanvasVml(waveImgDiv, arrowBaselineWidth);
@@ -109,7 +109,7 @@ Timeside.classes.RulerMarker = Timeside.classes.TimesideClass.extend({
             this.moveCanvas = function(pixelOffset){
                 //for some reason, coordinates inside the VML object are stored by raphael with a zoom of 10:
                 this.jQueryCanvas.css('left',(10*pixelOffset)+'px');
-            }
+            };
             //apparently, when resizing the markers loose their attributes. Therefore:
             var r = this.refreshPosition; //reference to current refreshPosition
             this.refreshPosition = function(){