]> git.parisson.com Git - telemeta.git/commitdiff
added click on an image, still to implement transparent background for bug in IE
authorriccardo <riccardo@parisson.com>
Wed, 27 Apr 2011 14:32:02 +0000 (16:32 +0200)
committerriccardo <riccardo@parisson.com>
Wed, 27 Apr 2011 14:32:02 +0000 (16:32 +0200)
telemeta/htdocs/js/application.js
telemeta/htdocs/timeside/src/divmarker.js
telemeta/htdocs/timeside/src/player.js
telemeta/htdocs/timeside/src/ruler.js
telemeta/templates/telemeta_default/mediaitem_detail.html

index f42724762627dac526270109cec32ae17d227d1d..498cda736915b0eb1feca4eeb2e4401dd71fdd56 100644 (file)
@@ -447,7 +447,6 @@ var popup={
 \r
     //field must be a dictionary of label:defaultValues (both strings)\r
     //callbackOnOk is the callback to be executed on ok, if null ok will simply hide the dialog\r
-    //otherwise it must be a function accepting\r
     createDivDialog : function(field,callbackOnOk){\r
 \r
         var $J = this._cfg_.jQuery;\r
@@ -513,7 +512,6 @@ var popup={
         //popupDialog(element,table,onOk);\r
         return $J('<div/>').append(table).append(subdiv);\r
     }\r
-\r
 }\r
 \r
 /**\r
@@ -616,4 +614,399 @@ function consolelog(text){
             c.log(text);\r
         }\r
     }\r
-}
\ No newline at end of file
+}\r
+\r
+\r
+//var PopupClass=function(innerHTML,event){\r
+//    var $J = jQuery; //reference to jQuery\r
+//    var className = 'component'; //the optional div class name\r
+//    var div = $J('<div/>').css({  //create the div (the popup)\r
+//                position: 'absolute',\r
+//                overflow:'auto', //necessary to properly display the content\r
+//                display: 'none',\r
+//                zIndex:1000\r
+//            });\r
+//            if(className){\r
+//                div.addClass(className);\r
+//            };\r
+//\r
+//     if(content instanceof $J){\r
+//         div.append(content);\r
+//     }else{\r
+//         div.html(content);\r
+//     }\r
+//     //create the div shadow\r
+//     var divShadow = div.clone(false,false).empty().css({'zIndex':999,'borderColor':'#000','display':'none','backgroundColor':'#000'}).insertAfter(div);\r
+//     //append to the body\r
+//     var body = $J('body');\r
+//     body.append(div);\r
+//     divShadow.insertAfter(div);\r
+//     div = div.add(divShadow);\r
+//     //set the id\r
+//     var time = new Date().getTime();\r
+//     div.attr('id','popup_'+time);\r
+//     divShadow.attr('id','popupshadow_'+time);\r
+//     //make thid class a jQuery object:\r
+//     $J.extend(this,div);\r
+//     //override some methods:\r
+//     //\r
+//     //private function which binds/unbinds click and key events\r
+//     var toggleBind = function(element, callback){\r
+//            var clickNamespace = "click.popup__"+time;\r
+//            var keydownNamespace =  "keyup.popup__"+time;\r
+//            element.unbind(clickNamespace);\r
+//            element.unbind(keydownNamespace);\r
+//            if(callback){\r
+//                element.bind(clickNamespace, callback);\r
+//                element.bind(keydownNamespace,callback);\r
+//            }\r
+//        };\r
+//\r
+//     var doc = $J(document); //reference to the document\r
+//\r
+//     //hide:\r
+//     var hide = this.hide;\r
+//     this.hide = function(){\r
+//         toggleBind(doc);\r
+//     };\r
+//\r
+//     //remove:\r
+//     var me = this;\r
+//     var remove = this.remove;\r
+//     this.remove = function(){\r
+//         me.hide();\r
+//         remove.apply(me,arguments);\r
+//     };\r
+//\r
+//     //show:\r
+//     var shadowOffset = 5; //the shadow offset, change to increment/ decrement\r
+//     var show = this.show;\r
+//\r
+//     this.show = function(){\r
+//         place($J(me[0]),event);\r
+//         var position = $J(me[0]).offset();\r
+//         $J(me[1]).css({\r
+//                'top': (position.top + shadowOffset),\r
+//                'left': (position.left + shadowOffset),\r
+//                'width': div.outerWidth(true),\r
+//                'height': div.outerHeight(true)\r
+//            });\r
+//         toggleBind(doc, me.hide);\r
+//\r
+//         if(arguments.length>0){\r
+//             var oldCallback = arguments[arguments.length-1];\r
+//             arguments[arguments.length-1] = function(){\r
+//                 $J(me[1]).fadeTo(0,0.4,oldCallback);\r
+//             }\r
+//             show.apply(me, arguments);\r
+//         }else{\r
+//             show.apply(me);\r
+//             $J(me[1]).fadeTo(0,0.4);\r
+//         }\r
+//\r
+//     };\r
+//\r
+//\r
+//\r
+//\r
+//\r
+//    _cfg_:{\r
+//        jQuery:jQuery,\r
+//        div: function(){\r
+//            var div = this.jQuery('<div/>').css({ //this is _cfg_\r
+//                position: 'absolute',\r
+//                overflow:'auto', //necessary to properly display the content\r
+//                display: 'none',\r
+//                border: '1px solid #e1e1e1',\r
+//                zIndex:1000\r
+//            });\r
+//            if(this.className){\r
+//                div.addClass(this.className);\r
+//            }\r
+//            return div;\r
+//        },\r
+//        className: 'component',\r
+//        //        mouseDownNamespace : "mousedown.popup__",\r
+//        //        keyDownNamespace : "keydown.popup__",\r
+//\r
+//        //namespace: 'popup__', //used for namespaces when binding click to document\r
+//        handlersToRestore: [],\r
+//        event: null,\r
+//        divsToDelete:null,\r
+//        toggleBind: function(element, functionE){\r
+//            var clickNamespace = "click.popup__";\r
+//            var keydownNamespace =  "keyup.popup__";\r
+//            element.unbind(clickNamespace);\r
+//            element.unbind(keydownNamespace);\r
+//            if(functionE){\r
+//                element.bind(clickNamespace, functionE);\r
+//                element.bind(keydownNamespace,functionE);\r
+//            }\r
+//        }\r
+//    },\r
+//\r
+//    isShowing: function(){\r
+//        return this._cfg_.divsToDelete ? true : false;\r
+//    },\r
+//\r
+//\r
+//    hide: function(){\r
+//        var toggleBind = this._cfg_.toggleBind;\r
+//\r
+//        var $J = this._cfg_.jQuery;\r
+//\r
+//        toggleBind($J(document));\r
+//        if(this._cfg_.divsToDelete){\r
+//            for(var i=0; i < this._cfg_.divsToDelete.length; i++){\r
+//                this._cfg_.divsToDelete[i].empty().remove();\r
+//            }\r
+//        }\r
+//        if(this._cfg_.event && this._cfg_.handlersToRestore){\r
+//            var type = this._cfg_.event.type; //which should be the same as h.type below, without namespaces?\r
+//            var invokerElement = this._cfg_.event.target;\r
+//            if(invokerElement){\r
+//                var e = $J(invokerElement);\r
+//                toggleBind(e);\r
+//                if(type){\r
+//                    //e.unbind(type);\r
+//                    for(var i=0; i<this._cfg_.handlersToRestore.length; i++){\r
+//                        var h = this._cfg_.handlersToRestore[i];\r
+//                        var functionCode = h.handler;\r
+//                        var namespace = ""+h.namespace;\r
+//                        if(namespace.length>0){\r
+//                            namespace="."+namespace;\r
+//                        }\r
+//                        var what = h.type+ namespace;\r
+//                        e.bind(what, functionCode);\r
+//                    }\r
+//                }\r
+//            }\r
+//        }\r
+//        this._cfg_.event=null;\r
+//        this._cfg_.handlersToRestore=null;\r
+//    },\r
+//\r
+//    show:function(content, optionalEvent){\r
+//        consolelog("showing popup:"+optionalEvent);\r
+//        //if showing, hide\r
+//        if(this.isShowing()){\r
+//            this.hide();\r
+//        }\r
+//\r
+//        var $J = this._cfg_.jQuery;\r
+//        var div = this._cfg_.div();\r
+//        //toggleBind sets the functions to hiding/keep shown the popup when clicking or\r
+//        //using the keyboard keys\r
+//        var toggleBind = this._cfg_.toggleBind;\r
+//\r
+//        //remove the callback on invoker so that clicking on invoker does nothing\r
+//        //moreover, toggleBind on invoker so that clicking invoker doesn't hide the popup\r
+//        this.oldCallback = undefined;\r
+//        var oldHandlers=[];\r
+//        var invokerElement = optionalEvent && optionalEvent.target ? $J(optionalEvent.target) : undefined;\r
+//        if(invokerElement){\r
+//            optionalEvent.stopPropagation(); //othewrwise the popup hides immediately\r
+//            //cause the event is catched from the document click (added later, see below)\r
+//            // but apparently as soon as we add it it catches even the current event)\r
+//            var type = optionalEvent.type;\r
+//            var clickEvents =invokerElement.data("events")[type];\r
+//            $J.each(clickEvents, function(key, value) {\r
+//                oldHandlers.push(value);\r
+//            })\r
+//            invokerElement.unbind(type); //remove (temporarily) the binding to the event.\r
+//            //for instance, if we show the popup by clicking invoker, when the popup is shown do nothing\r
+//            //on clicking invoker until popup.hide is called\r
+//            toggleBind(invokerElement,function(e){ //add bindings to stop cancel the popup in case the invoker is clicked again\r
+//                e.stopPropagation();\r
+//                return false;\r
+//            });\r
+//        }\r
+//        //store the functions removed from invoker, if any, to restore them in this.hide\r
+//        this._cfg_.handlersToRestore = oldHandlers;\r
+//        this._cfg_.event = optionalEvent;\r
+//\r
+//        //toggleBind on each child of content so that clicking and pressing keys on\r
+//        //a child doesn't hide the popup\r
+//        var children = $J(content).find('*');\r
+//        $J(children).each(function(){\r
+//            toggleBind($(this),function(e){\r
+//                e.stopPropagation();\r
+//                return false;\r
+//            });\r
+//        });\r
+//        //showing\r
+//        var doc = $J(document);\r
+//        $J('body').append(div);\r
+//\r
+//        content.css('position','static'); //this is really important to place the content in the normal flow\r
+//        //within the div. static is the default\r
+//        content.show(); //in case the div is display:none\r
+//        div.append(content);\r
+//\r
+//        //positioning div: center of the screen if no invoker, below the invoker otherwise\r
+//        var wdow = $J(window); //reference the window object (doing it once speeds up a bit performances)\r
+//        var windowH = wdow.height();\r
+//        var windowW = wdow.width();\r
+//        var position = div.offset();\r
+//        var shadowOffset=5;\r
+//        var size = {\r
+//            width:div.outerWidth(true)+shadowOffset,\r
+//            height:div.outerHeight(true)+shadowOffset\r
+//        };\r
+//        if(invokerElement){\r
+//            position = invokerElement.offset();\r
+//            position.top+=  invokerElement.outerHeight(true);\r
+//        }else{\r
+//            position.top = wdow.scrollTop()+ (windowH-size.height)/2;\r
+//            position.left = wdow.scrollLeft()+(windowW-size.width)/2;\r
+//        }\r
+//        //position div. This must be done immediately cause here below we want to get the div  offset\r
+//        //(div position in absolute - ie, document's - coordinates)\r
+//        div.css({\r
+//            'top': position.top,\r
+//            'left': position.left,\r
+//            'right': 'auto', //in case right has been set by some css class rule\r
+//            'bottom': 'auto' //see above...\r
+//        });\r
+//        //set the maximum size\r
+//        //due to overflow:auto a scrollbar will automatically appear\r
+//        var max = Math.max; //reference max immediately (speeds up performances a bit)\r
+//        var maxSize = {\r
+//            width: max(20,windowW +  wdow.scrollLeft() -position.left-shadowOffset),\r
+//            height: max(20, (windowH + wdow.scrollTop() -position.top- shadowOffset))\r
+//        }\r
+//        //position div and size:\r
+//        var divPadding = {\r
+//            left: div.outerWidth()-div.width(),\r
+//            top:div.outerHeight()-div.height()\r
+//        }; //setting width on a div means the width(),\r
+//        //but calculations here are made according to outerWidth(true), so we need this variable (se below)\r
+//\r
+//        //the shadow in the background will be created according to the actual div size\r
+//        //However, since we do not specify neither width nor height, the calculation of the div size\r
+//        //works if maxWidth and maxHeight do set a width and height. In order to do so, they\r
+//        //must be lower or equal to the actual div width and height. That's why the "min" here below:'\r
+//        div.css({\r
+//            'maxWidth': Math.min(div.width(), maxSize.width-divPadding.left),\r
+//            'maxHeight': Math.min(div.height(), maxSize.height-divPadding.top)\r
+//        });\r
+//\r
+//        //last thing: if invoker element exist, set width at least invoker element width\r
+//        if(invokerElement){\r
+//            var iEw = invokerElement.outerWidth(); //no margins considered\r
+//            if(iEw<maxSize.width && iEw>div.outerWidth()){\r
+//                div.css({\r
+//                    'minWidth':iEw-divPadding.left\r
+//                });\r
+//            }\r
+//        }\r
+//        //now we can build the divShadow\r
+//        var divShadow = div.clone(false,false).empty().css({'zIndex':999,'borderColor':'#000','display':'none','backgroundColor':'#000'}).insertAfter(div);\r
+//        //store the divs to be removed\r
+//        this._cfg_.divsToDelete = [div,divShadow];\r
+//        //add a listener to the document. If one of the content children is clicked/keypressed,\r
+//        //we won't come here. Otherwise hide popup\r
+//        var me = this;\r
+//        var hide = this.hide;\r
+//        toggleBind(doc,function(e){\r
+//            hide.apply(me);\r
+//            e.stopPropagation();\r
+//        });\r
+//        div.show(300, function(){ //basically in between fast (200) and slow (600)\r
+//            //position div shadow:\r
+//            divShadow.show();\r
+//            consolelog(div.outerHeight(true)+" "+div.outerHeight(false));\r
+//            consolelog(divShadow.outerHeight(true)+" "+divShadow.outerHeight(false));\r
+//\r
+//            //set focus to the first input component, if any. Otherwise try with anchors, otherwise do nothing\r
+//            var inputs = $J(div).find(':input');\r
+//            if(inputs && inputs[0]){\r
+//                inputs[0].focus();\r
+//            }else{\r
+//                inputs = $J(div).find('a');\r
+//                if(inputs && inputs[0]){\r
+//                    inputs[0].focus();\r
+//                }\r
+//            }\r
+//\r
+//            divShadow.fadeTo(0,0.4, function(){\r
+//                divShadow.css({\r
+//                'top': (position.top+shadowOffset),\r
+//                'left': (position.left+shadowOffset),\r
+//                'width': div.outerWidth(true),\r
+//                'height': div.outerHeight(true)\r
+//            });\r
+//\r
+//            });\r
+//        });\r
+//        return false; //to avoid scrolling if we clicked on an anchor\r
+//    },\r
+//\r
+//    //field must be a dictionary of label:defaultValues (both strings)\r
+//    //callbackOnOk is the callback to be executed on ok, if null ok will simply hide the dialog\r
+//    createDivDialog : function(field,callbackOnOk){\r
+//\r
+//        var $J = this._cfg_.jQuery;\r
+//        var table = $J('<table/>');\r
+//        var fieldElms = {};\r
+//        for(var label in field){\r
+//            var input = $('<input/>')\r
+//            .attr('type','text').val(field[label]).attr("name",label);\r
+//            table.append($J('<tr/>')\r
+//                .append($J('<td/>').html(label))\r
+//                .append($J('<td/>').append(input)));\r
+//            fieldElms[label]=input;\r
+//        }\r
+//\r
+//        var p = this;\r
+//        var onCancel= function(){\r
+//            p.hide();\r
+//            return false;\r
+//        };\r
+//\r
+//        var onOk= function(){\r
+//            if(callbackOnOk){\r
+//                var ret = {};\r
+//                var inputs = table.find("input");\r
+//                $J.each(inputs, function(key,value){\r
+//                    var v = $J(value);\r
+//                    ret[v.attr('name')] = v.val();\r
+//                });\r
+//                callbackOnOk(ret);\r
+//                return false;\r
+//            }else{\r
+//                return onCancel();\r
+//            }\r
+//        };\r
+//        var subdiv = $J('<div/>').css({\r
+//            'padding':'1ex',\r
+//            'float':'right'\r
+//        }).\r
+//        append(\r
+//            $J('<a/>').\r
+//            html('Ok').\r
+//            addClass('component_icon').\r
+//            addClass('button').\r
+//            addClass('icon_ok').\r
+//            attr('href','#').\r
+//            click(function(){\r
+//                return onOk();\r
+//            })\r
+//            );\r
+//        if(callbackOnOk){\r
+//            subdiv.append(\r
+//                $J('<a/>').\r
+//                html('Cancel').\r
+//                addClass('component_icon').\r
+//                addClass('button').\r
+//                addClass('icon_cancel').\r
+//                attr('href','#').\r
+//                click(function(){\r
+//                    return onCancel();\r
+//                })\r
+//                );\r
+//        }\r
+//        //popupDialog(element,table,onOk);\r
+//        return $J('<div/>').append(table).append(subdiv);\r
+//    }\r
+//}
\ No newline at end of file
index 98e293d0383be55a3f7ae2faf5d69c5460653ef8..72f0178faec9e730f6e78ece911ed9ef309ff938 100644 (file)
@@ -133,7 +133,7 @@ var MarkerMapDiv = TimesideArray.extend({
     setFocus: function(index,value){
         this.each(function(i,div){
             if(i==index && value){
-                div.css('backgroundColor','#f5cf23'); //'#efc823'
+                div.css('backgroundColor','#E65911'); //'#f5cf23'
             }else{
                 div.css('backgroundColor','');
             }
index f522475973e28d7e2f041e611fd9ffa72e82abcb..b342756023bc84eab163c805c80e15e65c480d18 100644 (file)
@@ -82,7 +82,10 @@ var Player = TimesideClass.extend({
             var map = player.getMarkerMap();
             var indexToShow = map.insertionIndex(player.getSoundPosition());
             
-            var mydiv = this.$J('<div/>').addClass('markerDiv').css({'position':'absolute','zIndex':1000});
+            var mydiv = this.$J('<div/>').addClass('markerDiv').css({
+                'position':'absolute',
+                'zIndex':1000
+            });
 
             var ruler = player.getRuler();
             
@@ -234,18 +237,10 @@ var Player = TimesideClass.extend({
         //        });
         var me=this;
         //attaching event to the image. Note that attaching an event to a transparent div is buggy in IE
-//        if($J.browser.msie){
-//
-//        }
-        consolelog('ope');
-        consolelog(jQueryObjs.find('.ts-image').length);
-        jQueryObjs.find('.ts-image').click(function(event){
-            alert('g');
-            consolelog(event);
-            
-//            me.setSoundPosition( me.getSoundDuration()/$J(this).width());
-        });
-
+        //        if($J.browser.msie){
+        //
+        //        }
+       
 
         var rewind_ = this.rewind;
         var forward_ = this.forward;
@@ -324,6 +319,18 @@ var Player = TimesideClass.extend({
             return false;
         });
 
+        //binds click for the pointer: TODO: change this way of getting the tsviweer!!!!
+        var v = $J('#player').find('.ts-viewer');
+        v.unbind('click').click(function(evt){
+            var w = v.width();
+            var x = evt.pageX - v.offset().left; //using absolute coordinates allows us to
+            //avoid checking whether or not we are clicking on a vertical marker line, on a subdiv etcetera
+            var sd = me.getSoundDuration();
+            me.setSoundPosition(sd*x/w);
+            ruler.movePointer(ruler.toSoundPosition(x));
+        });
+       
+
         //finally, load markers and bind events for markers (see method below):
         this.loadMarkers(isInteractive);
         
@@ -377,10 +384,10 @@ var Player = TimesideClass.extend({
     getImageUrl: function(){
         return this.$J('#visualizer_id').get(0).value;
     },
-    refreshImage: function(optionalImgTagElm){
+    refreshImage: function(optionalImgJQueryElm){
         var image;
-        if(optionalImgTagElm){
-            image = optionalImgTagElm;
+        if(optionalImgJQueryElm){
+            image = optionalImgJQueryElm;
         }else{
             image = this.getElements().find('.ts-image');
         }
@@ -487,6 +494,7 @@ var Player = TimesideClass.extend({
         
     loadMarkers: function(isInteractive_){
         //ruler.bind('markermoved',this.markerMoved,this);
+        var $J = this.$J; //reference to jQuery
 
         var itemId = ITEM_PUBLIC_ID;
 
@@ -526,9 +534,13 @@ var Player = TimesideClass.extend({
             //
             //add binding to the setMarker button (html anchor):
             var setMarkerButton = player.getElements().find('.ts-set-marker');
+            var tab = $J('#tab_markers');
             if(setMarkerButton){
                 if(isInteractive_){
                     setMarkerButton.show().attr('href','#').unbind('click').bind('click', function(){
+                        if(tab && tab.length){
+                            tab.trigger('click');
+                        }
                         map.add(player.getSoundPosition());
                         return false;
                     });
@@ -599,8 +611,8 @@ var Player = TimesideClass.extend({
             //                    setUpPlayerTabs([jQuery('#tab_analysis'), jQuery('#tab_markers')],
             //                    [jQuery('#analyzer_div_id'), jQuery('#markers_div_id')], tabIndex,
             //                    'tab_selected','tab_unselected');
-            setUpPlayerTabs(jQuery('#tab_analysis').add(jQuery('#tab_markers')),
-                [jQuery('#analyzer_div_id'), jQuery('#markers_div_id')], tabIndex,
+            setUpPlayerTabs($J('#tab_analysis').add($J('#tab_markers')),
+                [$J('#analyzer_div_id'), $J('#markers_div_id')], tabIndex,
                 'tab_selected','tab_unselected');
         };
         json([itemId],"telemeta.get_markers", onSuccess);
index 0cad033858c016df70ae353591132eb8d4b8ce1b..34250a5a3f23bad66666ff71782bf415b8c2abf4 100644 (file)
@@ -381,8 +381,8 @@ var Ruler = TimesideArray.extend({
             //note that setText is called BEFORE move as move must have the proper label width
             this.each(indexIfMarker, function(i,rulermarker){
                 rulermarker.setIndex(i,i!=indexIfMarker);
-                //rulermarker.setIndex.apply(rulermarker, [i,i!=indexIfMarker]); //update label width only if it is not this marker added
-                //as for this marker we update the position below (move)
+            //rulermarker.setIndex.apply(rulermarker, [i,i!=indexIfMarker]); //update label width only if it is not this marker added
+            //as for this marker we update the position below (move)
             });
             this.debug('added marker at index '+indexIfMarker+' offset: '+markerObjOrOffset.offset);
         }else{
@@ -394,6 +394,13 @@ var Ruler = TimesideArray.extend({
        
         //pointer.setText(markerClass== 'pointer' ? this.makeTimeLabel(0) : this.length);
 
+        //click on labels stop propagating. Always:
+        var lbl = pointer.getLabel();
+        lbl.bind('click', function(evt){
+            evt.stopPropagation();
+            return false;
+        });
+
         //if there are no events to associate, return it.
         if(!isMovable){
             return pointer;
@@ -402,7 +409,6 @@ var Ruler = TimesideArray.extend({
         //namespace for jquery event:
         var eventId = 'markerclicked';
         var doc = $J(document);
-        var lbl = pointer.getLabel();
         
         var me = this;
 
@@ -411,8 +417,12 @@ var Ruler = TimesideArray.extend({
             ismovingpointer = value;
         }
         //TODO: this method below private, but how to let him see in the bind below???
-        this.setPointerMovingFromMouse = function(value){setmovingpointer(value);}
-        this.isPointerMovingFromMouse = function(){ return ismovingpointer;};
+        this.setPointerMovingFromMouse = function(value){
+            setmovingpointer(value);
+        }
+        this.isPointerMovingFromMouse = function(){
+            return ismovingpointer;
+        };
         //functions to set if we are moving the pointer (for player when playing)
 
         lbl.bind('mousedown.'+eventId,function(evt) {
@@ -424,7 +434,7 @@ var Ruler = TimesideArray.extend({
             var startX = evt.pageX; //lbl.position().left-container.position().left;
             var startPos = lbl.position().left+lbl.width()/2;
             
-            evt.stopPropagation(); //dont notify the ruler;
+            evt.stopPropagation(); //dont notify the ruler or other elements;
             var newPos = startPos;
             doc.bind('mousemove.'+eventId, function(evt){
                 var x = evt.pageX; 
@@ -437,23 +447,24 @@ var Ruler = TimesideArray.extend({
                 return false;
                 
             });
-            lbl.bind('click.'+eventId, function(){
-                return false;
-            }); //to avoid scrolling
+            //to avoid scrolling
             //TODO: what happens if the user releases the mouse OUTSIDE the browser????
             var mouseup = function(evt_){
                 doc.unbind('mousemove.'+eventId);
                 doc.unbind('mouseup.'+eventId);
                 evt_.stopPropagation();
-                //TODO: fire event marker moved (with the class name)
+                if(markerClass=='pointer'){
+                    me.setPointerMovingFromMouse(false);
+                }
+                if(newPos == startPos){
+                    consolelog('NOT MOVED!!!!');
+                    return false;
+                }
                 var data = {
                     'markerElement':pointer,
                     'soundPosition': me.toSoundPosition.apply(me,[newPos]),
                     'markerClass':markerClass
                 };
-                if(markerClass=='pointer'){
-                    me.setPointerMovingFromMouse(false);
-                }
                 me.fire('markermoved',data);
                 return false;
             };
index 12ddabdfa16b561556b85146274f7c9af21d2c93..6c6111edd24b64b71f19dc2378fa73dcb23feb78 100644 (file)
@@ -34,7 +34,7 @@
         var anchor = jQuery('#_add_to_playlist');
         if(anchor.length){
             anchor.click(function(evtObj_){
-                p.showPopupAddToPlaylist(evtObj_,'item','{{item.public_id}}','item added to selected playlist');return false;
+                p.showPopupAddToPlaylist(evtObj_,'item','{{item.public_id}}',gettext('item added to selected playlist'));return false;
             });
         }
         {% endif %}