From: riccardo Date: Mon, 21 Feb 2011 18:11:20 +0000 (+0100) Subject: Added all div marker images. Note that the images were edited in external program... X-Git-Tag: 1.1~435 X-Git-Url: https://git.parisson.com/?a=commitdiff_plain;h=158c24ae9f1f8017d6159f1c06102343a174cd9b;p=telemeta.git Added all div marker images. Note that the images were edited in external program in order to exploit pngs transparent background capabilities: this lets the pngs to be independent from future potential div background changes (actually, this kind of editing should be done for all pngs in the page). Implemented the edit button and consequent hiding/showing of the marker description textarea. Added the label showing the marker description (for which a caomputation of the available size is required: this part is still to be terminated) --- diff --git a/telemeta/htdocs/images/del_marker.png b/telemeta/htdocs/images/del_marker.png index c91aae4d..5055a0f4 100644 Binary files a/telemeta/htdocs/images/del_marker.png and b/telemeta/htdocs/images/del_marker.png differ diff --git a/telemeta/htdocs/images/edit_marker.png b/telemeta/htdocs/images/edit_marker.png index f42e78bc..b40bbae4 100644 Binary files a/telemeta/htdocs/images/edit_marker.png and b/telemeta/htdocs/images/edit_marker.png differ diff --git a/telemeta/htdocs/images/marker_ok_green.png b/telemeta/htdocs/images/marker_ok_green.png index 4df84eed..be467ce0 100644 Binary files a/telemeta/htdocs/images/marker_ok_green.png and b/telemeta/htdocs/images/marker_ok_green.png differ diff --git a/telemeta/htdocs/images/marker_tiny.png b/telemeta/htdocs/images/marker_tiny.png index ab057922..925ec14c 100644 Binary files a/telemeta/htdocs/images/marker_tiny.png and b/telemeta/htdocs/images/marker_tiny.png differ diff --git a/telemeta/htdocs/timeside/src/controller.js b/telemeta/htdocs/timeside/src/controller.js index f7d13f0c..fcb05b78 100644 --- a/telemeta/htdocs/timeside/src/controller.js +++ b/telemeta/htdocs/timeside/src/controller.js @@ -24,9 +24,6 @@ TimeSide(function($N) { }, _setupPlayer: function() { -// if (this.cfg.player && !$N.isInstanceOf(this.cfg.player, 'Player')) { -// this.cfg.player = new $N.Player(this.cfg.player); -// } this.attach(this.updateMarkersDiv); this.cfg.player .setSoundProvider(this.cfg.soundProvider) diff --git a/telemeta/htdocs/timeside/src/markermap.js b/telemeta/htdocs/timeside/src/markermap.js index 30776e96..fac52f0d 100644 --- a/telemeta/htdocs/timeside/src/markermap.js +++ b/telemeta/htdocs/timeside/src/markermap.js @@ -1,7 +1,7 @@ /** * TimeSide - Web Audio Components * Copyright (c) 2008-2009 Samalyse - * Author: Olivier Guilyardi + * Author: Olivier Guilyardi and Riccardo Zaccarelli * License: GNU General Public License version 2.0 */ @@ -60,7 +60,7 @@ TimeSide(function($N, $J) { this.add(marker); }, - //this function adds a new marker. It is actually + add: function(marker) { var idx = this.insertionIndex(marker); //adding the div @@ -77,8 +77,9 @@ TimeSide(function($N, $J) { return marker; }, - - + //remove must have this class as argument (klass) as we cannot access this class with the keyword 'this': + //the latter, when remove is called from within + //a click function refers to the current document remove: function(klass, marker) { if (marker) { if(!(klass)){ @@ -90,9 +91,7 @@ TimeSide(function($N, $J) { klass.fire('remove', { marker: marker }); - // var i1= Math.min(oldIndex,newIndex); - // var i2= Math.max(oldIndex,newIndex); - //var mrks = this.markers; + klass.fireRefreshLabels(i,klass.markers.length); klass.removeHTTP(marker); @@ -163,7 +162,7 @@ TimeSide(function($N, $J) { }); //update label element this.markers[i].div['labelIndex'].html(i+1) - // $($( this.markers[i].div.children()[0] ).children()[0]).html(i+1); + // $($( this.markers[i].div.children()[0] ).children()[0]).html(i+1); } }, @@ -191,12 +190,7 @@ TimeSide(function($N, $J) { var l = m.length; var ret = {}; if(div){ - //var textWithFocus; - //div.style.display = "block"; - //var doc = document; - - - var text, timeSpan, closeAnchor, ok, header; + var text, timeSpan, closeAnchor, ok, header, editAnchor, textShort; //creating marker, see marker.js @@ -205,8 +199,14 @@ TimeSide(function($N, $J) { var label = $J('') .css({ color:'#fff', - backgroundColor:'#009', - width: '2em', + //backgroundColor:'#009', + backgroundImage:'url("/images/marker_tiny.png")', + backgroundRepeat:'no-repeat', + backgroundPosition:'center center', + fontSize: '60%', + fontWeight:'bold', + display:'inline-block', + width:'3ex', textAlign: 'center' //,fontFamily: 'monospace' }) @@ -215,13 +215,18 @@ TimeSide(function($N, $J) { timeSpan = $J('') .css({ - marginLeft:'1ex' - }); + marginLeft:'1ex', + marginRight:'1ex' + }) + .html(this.formatMarkerOffset(marker.offset)); + ret['labelOffset']=timeSpan; - closeAnchor = $J('') - .attr("type","submit") - .attr("value","x") + closeAnchor = $J('') + .attr("href","#") + .append($J('').attr("src","/images/del_marker.png").css({ + width:'1em' + })) .css({ //fontFamily: 'monospace', fontWeight:'bold', @@ -231,129 +236,56 @@ TimeSide(function($N, $J) { }); ret['submitCancel']=closeAnchor; - header = $J('
') - .append(label) - .append(timeSpan) - .append(closeAnchor); - - text = $J('