background-image: url('/images/cancel.png');
}
.mediaitem_button_save{
- color:#6A0307 !important;
+ /*color:#6A0307 !important;*/
background-image: url('/images/save.png');
}
.mediaitem_button_add{
}\r
if(from != to){\r
var elm = this.splice(from,1)[0];\r
- this.markers.splice(to,0,elm);\r
+ this.splice(to,0,elm);\r
return to;\r
}\r
return from;\r
// }
this.cfg.divmarkers.move(from,to);
this.cfg.player.ruler.markers.move(from,to);
-// this.cfg.player.ruler.move(from,to);
-// var m = this.cfg.divmarkers.splice(from,1)[0]; //remove
-// this.cfg.divmarkers.splice(to,0,m); //add
- this.updateIndices(from,to);
+// realIndex might not be equal to to
+ this.updateIndices(from,data.newIndex);
},
//called whenever a marker is added to the ruler BUT NOT in the map
if(from===undefined || from==null){
from = 0;
}
- if(from>this.cfg.divmarkers.length){
+ var len = this.cfg.divmarkers.length-1;
+ if(from>len){
return;
}
if(to==undefined || to ==null){
- to = this.cfg.divmarkers.length-1;
+ to = len;
}
if(to<from){
var tmp = to;
move: function(markerIndex, newOffset){
var newIndex = this.indexOf(newOffset);
- newIndex = this.markers.move(markerIndex,newIndex);
+ var realIndex = this.markers.move(markerIndex,newIndex);
- var marker = this.markers[newIndex];
+ var marker = this.markers[realIndex];
marker.offset = newOffset;
marker.isSaved = marker.isEditable ? false : true;
this.fire('moved', {
fromIndex: markerIndex,
- toIndex: newIndex
+ toIndex: newIndex,
+ newIndex: realIndex
});
// var newIndex = this.indexOf(newOffset);
//see http://stackoverflow.com/questions/4809157/i-need-to-pass-a-json-object-to-a-javascript-ajax-method-for-a-wcf-call-how-can
// var data2send = '{"id":"jsonrpc", "params":[{"item_id":"'+ itemid+'", "public_id": "'+marker.id+'", "time": "'+
// marker.offset+'","description": "'+marker.desc+'"}], "method":"telemeta.add_marker","jsonrpc":"1.0"}';
-
- var isSaved = marker.id !== undefined;
+
+ var id = marker.id;
+ var isSaved = id !== undefined;
if(!isSaved){
- marker.id=this.uniqid(); //defined in core;
+ id=this.uniqid(); //defined in core;
}
var method = isSaved ? "telemeta.update_marker" : "telemeta.add_marker";
offset = "0.0";
}
var data2send = '{"id":"jsonrpc", "params":[{"item_id":"'+ s(itemid)+
- '", "public_id": "'+s(marker.id)+'", "time": "'+s(offset)+
+ '", "public_id": "'+s(id)+'", "time": "'+s(offset)+
'", "author": "'+s(marker.author)+
'", "title": "'+s(marker.title)+
'","description": "'+s(marker.desc)+'"}], "method":"'+method+'","jsonrpc":"1.0"}';
data: data2send,
success: function(){
if(!isSaved){
+ marker.id=id;
marker.isSaved = true;
}
if(functionOnSuccess){
{% block submenu %}
<div>
{% block tools %}
- <a href="{% url telemeta-collections %}">
- <img src="images/edit_cancel.png" style="vertical-align:middle" /></a>
+<!-- <a href="{% url telemeta-collections %}">
+ <img src="images/edit_cancel.png" style="vertical-align:middle" /></a>-->
+<a href="{% url telemeta-collections %}" class="mediaitem_button mediaitem_button_cancel">Cancel</a>
{% endblock tools %}
</div>
{% endblock %}
{% block infos %}
<div class="infos">
- <form method="POST" action="">{% csrf_token %}
+ <form method="POST" id ="_addCollectionForm" 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-collections %}">
+<!-- <a href="{% url telemeta-collections %}">
<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-collections %}" class="mediaitem_button mediaitem_button_cancel">Cancel</a>
+ <a href="#" class="mediaitem_button mediaitem_button_save"
+ onclick="document.getElementById('_addCollectionForm').submit(); return false;">Save</a>
</div>
</form>
</div>
{% block submenu %}
<div>
- <a href="{% url telemeta-collection-dublincore collection.public_id %}">Dublin Core</a>
+ <!--<a href="{% url telemeta-collection-dublincore collection.public_id %}">Dublin Core</a>-->
+ <a href="{% url telemeta-collection-dublincore collection.public_id %}" class="mediaitem_button mediaitem_button_dublin_core">Dublin Core</a>
{% if user.is_authenticated and perms.telemeta.change_mediacollection %}
{% block tools %}
- <a href="{% url telemeta-collection-edit collection.public_id %}">
+ <!-- <a href="{% url telemeta-collection-edit collection.public_id %}">
<img src="images/edit_page.png" alt="EDIT" style="vertical-align:middle" /></a>
- <button><a href="{% url telemeta-collection-copy collection.public_id %}">Copy</a></button>
+ <button><a href="{% url telemeta-collection-copy collection.public_id %}">Copy</a></button>-->
+
+ <a href="{% url telemeta-collection-edit collection.public_id %}" class="mediaitem_button mediaitem_button_edit">Edit</a>
+ <a href="{% url telemeta-collection-copy collection.public_id %}" class="mediaitem_button mediaitem_button_copy">Copy</a>
{% endblock tools %}
{% endif %}
{% extends "telemeta/collection_detail.html" %}
{% block tools %}
- <a href="{% url telemeta-collection-detail collection.public_id %}">
- <img src="images/edit_cancel.png" style="vertical-align:middle" /></a>
+<!-- <a href="{% url telemeta-collection-detail collection.public_id %}">
+ <img src="images/edit_cancel.png" style="vertical-align:middle" /></a>-->
+ <a href="{% url telemeta-collection-detail collection.public_id %}">Cancel</a>
{% endblock %}
{% block infos %}
<div class="infos">
- <form method="POST" action="">{% csrf_token %}
+ <form method="POST" id="_editCollectionForm" 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-collection-detail collection.public_id %}">
+<!-- <a href="{% url telemeta-collection-detail collection.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-collection-detail collection.public_id %}">Cancel</a>
+ <a href="#" class="mediaitem_button mediaitem_button_save"
+ onclick="document.getElementById('_editCollectionForm').submit(); return false;">Save</a>
</div>
</form>
</div>
<div class="buttons">
{% if user.is_authenticated and perms.telemeta.add_mediacollection %}
<!-- <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>
+ <a href="{% url telemeta-collection-add %}" class="mediaitem_button mediaitem_button_add">Add</a>
{% endif %}
</div>
<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 %}"
- class="roundBorder6 mediaitem_button mediaitem_button_cancel">Cancel</a>
-<a href="#" class="roundBorder6 mediaitem_button mediaitem_button_save"
+ class="mediaitem_button mediaitem_button_cancel">Cancel</a>
+<a href="#" class="mediaitem_button mediaitem_button_save"
onclick="document.getElementById('_addItemForm').submit(); return false;">Save</a>
</div>
</form>
<div>
{% if user.is_authenticated and 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 %}">Cancel</a>
{% endblock tools %}
{% endif %}
</div>
{% block infos %}
<div class="infos">
- <form enctype="multipart/form-data" method="POST" action="">{% csrf_token %}
+ <form enctype="multipart/form-data" id="_mediaItemCopyForm" 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 %}">
+<!-- <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 %}">Cancel</a>
+ <a href="#" class="mediaitem_button mediaitem_button_save"
+ onclick="document.getElementById('_mediaItemCopyForm').submit(); return false;">Save</a>
</div>
</form>
</div>
{% 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 %}" class="mediaitem_button mediaitem_button_cancel">Cancel</a>
+ <a href="{% url telemeta-item-detail item.public_id %}" class="mediaitem_button mediaitem_button_cancel">Cancel</a>
{% endblock tools %}
{% block infos %}
{% 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="mediaitem_button mediaitem_button_add">Add</a>
{% endif %}
</div>
{% endblock %}