right: 0;
top: 0;
}
-#submenu a {
+/*#submenu a {
height: 1.6em;
color: #4d508a;
font-size: 0.9em;
font-weight: bold;
-}
+}*/
#rightcol {
position: relative;
z-index: 10;
}
-.markersdivButton{
+
+.roundBorder4{
+ /*padding: 0.3em 0.8em 0.8em 0.8em;
+ margin: 0 0 1.5em 1.5em;*/
+
+ -moz-border-radius: 4px 4px 4px 4px;
+ -webkit-border-radius: 4px 4px 4px 4px;
+ border-radius: 4px 4px 4px 4px;
+}
+.roundBorder6{
/*padding: 0.3em 0.8em 0.8em 0.8em;
margin: 0 0 1.5em 1.5em;*/
-webkit-border-radius: 6px 6px 6px 6px;
border-radius: 6px 6px 6px 6px;
}
+.roundBorder8{
+ /*padding: 0.3em 0.8em 0.8em 0.8em;
+ margin: 0 0 1.5em 1.5em;*/
+
+ -moz-border-radius: 8px 8px 8px 8px;
+ -webkit-border-radius: 8px 8px 8px 8px;
+ border-radius: 8px 8px 8px 8px;
+}
+.roundBorder10{
+ /*padding: 0.3em 0.8em 0.8em 0.8em;
+ margin: 0 0 1.5em 1.5em;*/
+
+ -moz-border-radius: 10px 10px 10px 10px;
+ -webkit-border-radius: 10px 10px 10px 10px;
+ border-radius: 10px 10px 10px 10px;
+}
.markersdivUneditable{
border: 0px !important;
font-style: italic;
}
.markersdivTopElement{
- vertical-align:middle;
+ /*vertical-align:middle;*/
}
.markersdivTitle{
font-weight:bold;
margin:0;
padding:0;
+ position:relative;
+ top:-0.5ex;
/*margin-right:margin*/
}
.markersdivEdit, .markersdivEdit:hover, .markersdivEdit:visited,
.markersdivEdit:link, .markersdivEdit:link:hover, .markersdivEdit:visited:hover{
font-weight:bold;
- border:1px dotted #333333;
float:right;
- color:#000;
+ color:#333;
background-image: url('/images/edit_marker.png');
background-repeat:no-repeat;
background-position: center left;
border:2px solid #666;
- height:1ex;
- padding:0px 1ex 2ex 3ex; /*top right bottom left*/
- font-size: 70%;
+ height:2.2ex;
+ width: 8.5ex;
+ /*padding:0px 1ex 2ex 3ex;*/ /*top right bottom left*/
+ font-size: 65%;
margin-left: 1ex;
margin-right:1ex;
position:relative;
- top:-0.5ex;
+ /*top:-0.5ex;*/
+}
+.markersdivEdit span{
+ position:absolute;top:-0.75ex;left:3ex;
}
.markersdivDelete{
border:0px;
border: 1px solid #aaaaaa;
margin-bottom: 1ex;
}
+
+
+.mediaitem_button, .mediaitem_button:hover, .mediaitem_button:visited,
+.mediaitem_button:link, .mediaitem_button:link:hover, .mediaitem_button:visited:hover{
+ padding:0.7ex 1ex 0.7ex 4ex; /*top right bottom left*/
+ border-top: 1px solid #DDD;
+ border-left: 1px solid #DDD;
+ border-bottom: 1px solid #666;
+ border-right: 1px solid #666;
+ background-color: #f9f9f9; /*#626262;*/
+ color:#444;
+ font-weight: bold;
+ background-repeat: no-repeat;
+ background-position: 1ex .5ex;
+
+
+}
+.mediaitem_button_edit{
+ background-image: url('/images/edit_page.png');
+
+ }
+.mediaitem_button_copy{
+ background-image: url('/images/copy_page.png');
+}
+.mediaitem_button_previous{
+ background-image: url('/images/previous.png');
+}
+.mediaitem_button_next{
+ background-image: url('/images/next.png');
+}
+.mediaitem_button_dublin_core{
+ background-image: url('/images/dublin_core.png');
+}
+.mediaitem_button_cancel{
+ background-image: url('/images/cancel.png');
+}
+.mediaitem_button_save{
+ background-image: url('/images/save.png');
+}
+.mediaitem_button_add{
+ background-image: url('/images/add.png');
+}
\ No newline at end of file
var divRemoved = this.cfg.divmarkers.splice(idx,1)[0]; //there is only one element removed
divRemoved.remove();
this.cfg.player.ruler.remove(idx);
- if(idx<this.cfg.divmarkers.length){
- //we might have removed the last index, in this case idx==this.cfg.divmarkers.length
- //no need to update and to enter this if
- this.updateIndices(idx);
- }
+ this.updateIndices(idx);
}
},
if(from===undefined || from==null){
from = 0;
}
+ var len = this.cfg.divmarkers.length-1;
+ if(from>len){
+ //it might happen when we remove the last element
+ //suppose [0,1,2], we remove [2] then we call
+ //updateIndices[2] but array till 1 (there is nothing to update)
+ return;
+ }
if(to==undefined || to ==null){
- to = this.cfg.divmarkers.length-1;
+ to = len;
}
if(to<from){
var tmp = to;
//edit button
this.e_editButton = $J('<a/>')
- .addClass('markersdivButton')
+ .addClass('roundBorder4')
.addClass('markersdivEdit')
.addClass('markersdivTopElement')
.attr('title','edit marker description')
.attr("href","#")
- .html('EDIT')
+ .html('<span>EDIT</span>')
//add all elements to header:
//ok button
this.e_okButton = $J('<a/>')
.attr('title','save marker description and offset')
- .addClass('markersdivButton')
+ .addClass('roundBorder6')
.addClass('markersdivSave')
.attr("href","#")
.html("OK");
.append(this.e_header)
.append(this.e_descriptionText)
.append(this.e_okButton)
- .addClass('markersdivButton')
+ .addClass('roundBorder8')
.addClass('markerdiv');
}
//all jQuery data associated with the removed elements.
//This method is useful when removed elements are to be reinserted into the DOM at a later time.
this.me.detach();
+ //note that we might have index!=this.markerIndex without the need to detach the div
+ //we leave this code to be sure, especially on loading
}else{
//div is not added: set description and title
this.e_descriptionText.val(marker.desc ? marker.desc : "");
tText.removeAttr('readonly').removeClass('markersdivUneditable').show();
okB.show();
$(this).hide();
+ tText.select();
return false; //avoid scrolling of the page on anchor click
});
var eB = this.e_editButton;
//if(marker.desc !== descriptionText.val()){ //strict equality needed. See note below
marker.desc = dText.val();
marker.title = tText.val();
- map.sendHTTP(marker);
- //TODO: this should be done IF send was succesful
+ map.sendHTTP(marker,
+
+ function(){
dText.attr('readonly','readonly').addClass('markersdivUneditable');
tText.attr('readonly','readonly').addClass('markersdivUneditable');
eB.show();
okB.hide();
+ },
+ true
+ );
//}
// func_fem.apply(klass,[marker,editModeSaved,editButton, descriptionText,
// descriptionLabel, okButton]);
//in other words, it is useful when we do not want to know if obj is already present
//in the map, but only WHERE WOULD be inserted obj in the map. obj can be a marker
//or an offset (time). In the latter case a dummy marker with that offset will be considered
- indexOf: function(obj){
- var idx = this.insertionIndex(obj);
- return idx<0 ? -idx-1 : idx;
- },
+ indexOf: function(obj){
+ var idx = this.insertionIndex(obj);
+ return idx<0 ? -idx-1 : idx;
+ },
each: function(callback) {
$J(this.markers).each(callback);
},
- length: function(){
- return this.markers ? this.markers.length : 0;
- },
+ // length: function(){
+ // return this.markers ? this.markers.length : 0;
+ // },
- sendHTTP: function(marker){
+ sendHTTP: function(marker, functionOnSuccess, showAlertOnError){
//itemid is the item (spund file) name
var sPath = window.location.pathname;
marker.id=this.uniqid(); //defined in core;
}
var method = isSaved ? "telemeta.update_marker" : "telemeta.add_marker";
- var data2send = '{"id":"jsonrpc", "params":[{"item_id":"'+ itemid+
- '", "public_id": "'+marker.id+'", "time": "'+marker.offset+
- '", "author": "'+marker.author+
- '", "title": "'+marker.title+
- '","description": "'+marker.desc+'"}], "method":"'+method+'","jsonrpc":"1.0"}';
-
+
+ var s = this.jsonify;
+ var data2send = '{"id":"jsonrpc", "params":[{"item_id":"'+ s(itemid)+
+ '", "public_id": "'+s(marker.id)+'", "time": "'+s(marker.offset)+
+ '", "author": "'+s(marker.author)+
+ '", "title": "'+s(marker.title)+
+ '","description": "'+s(marker.desc)+'"}], "method":"'+method+'","jsonrpc":"1.0"}';
$.ajax({
type: "POST",
if(!isSaved){
marker.isSaved = true;
}
+ if(functionOnSuccess){
+ functionOnSuccess();
+ }
+ },
+ error: function(jqXHR, textStatus, errorThrown){
+ if(showAlertOnError){
+ var details = "\n(no further info available)";
+ if(jqXHR) {
+ details="\nThe server responded witha status of "+jqXHR.status+" ("+
+ jqXHR.statusText+")\n\nDetails (request responseText):\n"+jqXHR.responseText;
+ }
+ alert("ERROR: Failed to save marker"+details);
+ }
}
});
+
+
},
+ jsonify: function(string){
+ var s = string;
+ if(typeof string == "string"){
+ s = string.replace(/\\/g,"\\\\")
+ .replace(/\n/g,"\\n")
+ .replace(/"/g,"\\\"");
+ }
+ return s;
+ },
removeHTTP: function(marker){
// //itemid is the item (spund file) name
elements.css('width', 'auto'); // for IE6
- if (!height)
+ if (!height){
height = 200;
+ }
var style = {
width: this.elements.wave.width(),
height: height
}
this._createPointer();
+ //draw markers
+ if (this.cfg.map) {
+ $J(this.markers).each(function(i, m) {
+ m.clear();
+ });
+ this.markers = new Array();
+ this.cfg.map.each(this.attach(function(i, m) {
+ this.markers.push(this._drawMarker(m, i));
+ }));
+ }
//this._drawMarkers();
},
add: function(marker, index){
this.markers.splice(index, 0, this._drawMarker(marker, index));
- //this.markers.push(this._drawMarker(marker, index));
+ //this.markers.push(this._drawMarker(marker, index));
},
// _onMapAdd2: function(e, data) {
},
_onDoubleClick: function(evt) {
- //if (this.cfg.map && CURRENT_USER_NAME) {
if (CURRENT_USER_NAME) {
var offset = (evt.pageX - this.container.offset().left)
/ this.width * this.duration;
{% block submenu %}
<div class="buttons">
{% if user.is_authenticated and perms.telemeta.add_mediacollection %}
- <button><a href="{% url telemeta-collection-add %}">Add</a></button>
+<!-- <button><a href="{% url telemeta-collection-add %}">Add</a></button>-->
+ <a href="{% url telemeta-collection-add %}" class="roundBorder6 mediaitem_button mediaitem_button_add">Add</a>
+
{% endif %}
</div>
{% endblock %}
<div>
{% if perms.telemeta.add_mediaitem %}
{% block tools %}
- <a href="{% url telemeta-item-detail item.public_id %}">
- <img src="images/edit_cancel.png" /></a>
+<!-- <a href="{% url telemeta-item-detail item.public_id %}">
+ <img src="images/edit_cancel.png" /></a>-->
+ <a href="{% url telemeta-item-detail item.public_id %}"
+ class="roundBorder6 mediaitem_button mediaitem_button_cancel">Cancel</a>
{% endblock tools %}
{% endif %}
{% block infos %}
<div class="infos">
- <form method="POST" action="">{% csrf_token %}
+ <form method="POST" id ="_addItemForm" action="">{% csrf_token %}
<table>
{% for field in form %}
{% if not field.html_name == "copied_from_item" %}
{% endfor %}
</table>
<div align="center">
- <a href="{% url telemeta-item-detail item.public_id %}">
+<!-- <a href="{% url telemeta-item-detail item.public_id %}">
<img src="images/edit_cancel.png" style="vertical-align:middle" /></a>
- <input type="image" src="images/save_changes.png" style="vertical-align:middle" value="save" />
+ <input type="image" src="images/save_changes.png" style="vertical-align:middle" value="save" />-->
+ <a href="{% url telemeta-item-detail item.public_id %}"
+ class="roundBorder6 mediaitem_button mediaitem_button_cancel">Cancel</a>
+<a href="#" class="roundBorder6 mediaitem_button mediaitem_button_save"
+ onclick="document.getElementById('_addItemForm').submit(); return false;">Save</a>
</div>
</form>
</div>
{% block submenu %}
<div>
{% block tools %}
- <a href="{% url telemeta-item-dublincore item.public_id %}">Dublin Core</a>
+ <!--<a href="{% url telemeta-item-dublincore item.public_id %}">Dublin Core</a>-->
+ <a href="{% url telemeta-item-dublincore item.public_id %}" class="roundBorder6 mediaitem_button mediaitem_button_dublin_core">Dublin Core</a>
{% if user.is_authenticated and perms.telemeta.change_mediaitem %}
+<<<<<<< TREE
+
+ <!--<a href="{% url telemeta-item-edit item.public_id %}"><img src="images/edit_page.png" style="vertical-align:middle" alt="EDIT" /></a>
+ <button><a href="{% url telemeta-item-copy item.public_id %}">Copy</a></button>-->
+ <a href="{% url telemeta-item-edit item.public_id %}" class="roundBorder6 mediaitem_button mediaitem_button_edit">Edit</a>
+ <a href="{% url telemeta-item-copy item.public_id %}" class="roundBorder6 mediaitem_button mediaitem_button_copy">Copy</a>
+
+
+=======
<a href="{% url telemeta-item-edit item.public_id %}"><img src="images/edit_page.png" style="vertical-align:middle" alt="EDIT" /></a>
<button><a href="{% url telemeta-item-copy item.public_id %}">Copy</a></button>
+>>>>>>> MERGE-SOURCE
{% endif %}
- <a href="{% url telemeta-item-detail previous %}"><img src="images/previous.png" style="vertical-align:middle" alt="PREVIOUS" /></a>
- <a href="{% url telemeta-item-detail next %}"><img src="images/next.png" style="vertical-align:middle" alt="NEXT" /></a>
+ <!--<a href="{% url telemeta-item-detail previous %}"><img src="images/previous.png" style="vertical-align:middle" alt="PREVIOUS" /></a>
+ <a href="{% url telemeta-item-detail next %}"><img src="images/next.png" style="vertical-align:middle" alt="NEXT" /></a>-->
+ <a href="{% url telemeta-item-detail previous %}" class="roundBorder6 mediaitem_button mediaitem_button_previous">Previous</a>
+ <a href="{% url telemeta-item-detail next %}" class="roundBorder6 mediaitem_button mediaitem_button_next">Next</a>
{% endblock tools %}
</div>
{% endblock %}
{% extends "telemeta/mediaitem_detail.html" %}
{% block tools %}
- <a href="{% url telemeta-item-detail item.public_id %}">
- <img src="images/edit_cancel.png" /></a>
+<!-- <a href="{% url telemeta-item-detail item.public_id %}">
+ <img src="images/edit_cancel.png" /></a>-->
+ <a href="{% url telemeta-item-detail item.public_id %}" class="roundBorder6 mediaitem_button mediaitem_button_cancel">Cancel</a>
{% endblock tools %}
{% block infos %}
<div class="infos">
- <form enctype="multipart/form-data" method="POST" action="">{% csrf_token %}
+ <form enctype="multipart/form-data" id="_editItemForm" method="POST" action="">{% csrf_token %}
<table>
{% for field in form %}
{% if not field.html_name == "copied_from_item" %}
{% endfor %}
</table>
<div align="center">
- <a href="{% url telemeta-item-detail item.public_id %}">
- <img src="images/edit_cancel.png" style="vertical-align:middle" /></a>
- <input type="image" src="images/save_changes.png" style="vertical-align:middle" value="save" />
+<!-- <a href="{% url telemeta-item-detail item.public_id %}">
+ <img src="images/edit_cancel.png" style="vertical-align:middle" /></a>-->
+ <a href="{% url telemeta-item-detail item.public_id %}"
+ class="roundBorder6 mediaitem_button mediaitem_button_cancel">Cancel</a>
+<a href="#" class="roundBorder6 mediaitem_button mediaitem_button_save"
+ onclick="document.getElementById('_editItemForm').submit(); return false;">Save</a>
+<!-- <input type="image" src="images/save_changes.png" style="vertical-align:middle" value="save" />-->
</div>
</form>
</div>
{% block submenu %}
<div class="buttons">
{% if user.is_authenticated and perms.telemeta.add_mediaitem %}
- <button><a href="{% url telemeta-item-add %}">Add</a></button>
+ <!-- <button><a href="{% url telemeta-item-add %}">Add</a></button>-->
+ <a href="{% url telemeta-item-add %}" class="roundBorder6 mediaitem_button mediaitem_button_add">Add</a>
{% endif %}
</div>
{% endblock %}