Add voice annotation
'
@@ -261,12 +261,15 @@
IriSP.Widgets.CreateAnnotation.prototype.show = function() {
this.visible = true;
this.showScreen('Main');
- this.$.find(".Ldt-CreateAnnotation-Description").val("").css("border-color", "#666666");
+ this.$.find(".Ldt-CreateAnnotation-Description").val("").css("border-color", "#666666").addClass("empty");
if (this.show_title_field) {
- this.$.find(".Ldt-CreateAnnotation-Title").val("").css("border-color", "#666666");
+ this.$.find(".Ldt-CreateAnnotation-Title").val("").css("border-color", "#666666").addClass("empty");
}
if (this.show_creator_field) {
this.$.find(".Ldt-CreateAnnotation-Creator").val(this.creator_name).css("border-color", "#666666");
+ if (!this.creator_name) {
+ this.$.find(".Ldt-CreateAnnotation-Creator").addClass("empty");
+ }
}
this.$.find(".Ldt-CreateAnnotation-TagLi, .Ldt-CreateAnnotation-PolemicLi").removeClass("selected");
this.$.slideDown();
@@ -320,6 +323,11 @@
var _field = this.$.find(".Ldt-CreateAnnotation-Description"),
_contents = _field.val();
_field.css("border-color", !!_contents ? "#666666" : "#ff0000");
+ if (!!_contents) {
+ _field.removeClass("empty");
+ } else {
+ _field.addClass("empty");
+ }
this.$.find(".Ldt-CreateAnnotation-TagLi, .Ldt-CreateAnnotation-PolemicLi").each(function() {
var _rx = IriSP.Model.regexpFromTextOrArray(IriSP.jQuery(this).text().replace(/(^\s+|\s+$)/g,''));
if (_contents.match(_rx)) {
@@ -336,6 +344,11 @@
var _field = this.$.find(".Ldt-CreateAnnotation-Title"),
_contents = _field.val();
_field.css("border-color", !!_contents ? "#666666" : "#ff0000");
+ if (!!_contents) {
+ _field.removeClass("empty");
+ } else {
+ _field.addClass("empty");
+ }
this.pauseOnWrite();
return !!_contents;
}
@@ -345,6 +358,11 @@
var _field = this.$.find(".Ldt-CreateAnnotation-Creator"),
_contents = _field.val();
_field.css("border-color", !!_contents ? "#666666" : "#ff0000");
+ if (!!_contents) {
+ _field.removeClass("empty");
+ } else {
+ _field.addClass("empty");
+ }
this.pauseOnWrite();
return !!_contents;
}
@@ -392,7 +410,6 @@
_annotation.description = this.$.find(".Ldt-CreateAnnotation-Description").val(); /* Champ description */
_annotation.setTags(this.$.find(".Ldt-CreateAnnotation-TagLi.selected")
.map(function() { return IriSP.jQuery(this).attr("tag-id")})); /*Liste des ids de tags */
-
if (this.audio_url) {
_annotation.audio = {
src: "mic",
@@ -400,14 +417,11 @@
href: this.audio_url
};
}
-
- /* Les données créateur/date de création sont envoyées non pas dans l'annotation, mais dans le projet */
if (this.show_creator_field) {
- _export.creator = this.$.find(".Ldt-CreateAnnotation-Creator").val();
+ _annotation.creator = this.$.find(".Ldt-CreateAnnotation-Creator").val();
} else {
- _export.creator = this.creator_name;
+ _annotation.creator = this.creator_name;
}
- _export.created = new Date();
_exportedAnnotations.push(_annotation); /* Ajout de l'annotation à la liste à exporter */
_export.addList("annotation",_exportedAnnotations); /* Ajout de la liste à exporter à l'objet Source */
@@ -425,7 +439,7 @@
function() {
_this.close_after_send
? _this.hide()
- : _this.showScreen("Main");
+ : _this.show();
},
_this.after_send_timeout
);