--- a/src/js/serializers/ldt_annotate.js Fri Oct 26 15:51:05 2012 +0200
+++ b/src/js/serializers/ldt_annotate.js Fri Oct 26 18:37:55 2012 +0200
@@ -11,7 +11,8 @@
begin: _data.begin.milliseconds,
end: _data.end.milliseconds,
content: {
- data: _data.description,
+ description: _data.description,
+ title: _data.title,
audio: _data.audio
},
tags: _data.getTagTexts(),
@@ -43,8 +44,8 @@
_source.addList('annotation', new IriSP.Model.List(_source.directory));
IriSP._(_data.objects).each(function(_anndata) {
var _ann = new IriSP.Model.Annotation(_anndata.id, _source);
- _ann.description = _anndata.content.data || "";
- _ann.title = "";
+ _ann.description = _anndata.content.description || "";
+ _ann.title = _anndata.content.title || "";
_ann.creator = _anndata.meta.creator || "";
_ann.created = new Date(_anndata.meta.created);
_ann.setMedia(_anndata.media, _source);
--- a/src/widgets/CreateAnnotation.css Fri Oct 26 15:51:05 2012 +0200
+++ b/src/widgets/CreateAnnotation.css Fri Oct 26 18:37:55 2012 +0200
@@ -34,6 +34,11 @@
border-radius: 2px;
}
+.Ldt-CreateAnnotation-Title.empty, .Ldt-CreateAnnotation-Creator.empty {
+ font-style: italic;
+ color: #90b0d0;
+}
+
.Ldt-CreateAnnotation-Times {
color: #ff3b77
}
@@ -67,6 +72,10 @@
border-radius: 2px;
}
+.Ldt-CreateAnnotation-Description.empty {
+ font-style: italic; color: #999999;
+}
+
.Ldt-CreateAnnotation-Avatar {
float: right;
width: 48px;
--- a/src/widgets/CreateAnnotation.js Fri Oct 26 15:51:05 2012 +0200
+++ b/src/widgets/CreateAnnotation.js Fri Oct 26 18:37:55 2012 +0200
@@ -7,7 +7,7 @@
IriSP.Widgets.CreateAnnotation.prototype = new IriSP.Widgets.Widget();
IriSP.Widgets.CreateAnnotation.prototype.defaults = {
- show_title_field : false, /* For the moment, titles can't be sent to ldtplatform */
+ show_title_field : true,
show_creator_field : true,
start_visible : true,
always_visible : false,
@@ -106,12 +106,12 @@
+ '{{^show_slice}}{{#show_arrow}}<div class="Ldt-CreateAnnotation-Arrow"></div>{{/show_arrow}}{{/show_slice}}'
+ '<div class="Ldt-CreateAnnotation"><div class="Ldt-CreateAnnotation-Inner">'
+ '<form class="Ldt-CreateAnnotation-Screen Ldt-CreateAnnotation-Main">'
- + '<h3><span class="Ldt-CreateAnnotation-h3Left">{{#show_title_field}}<input class="Ldt-CreateAnnotation-Title" placeholder="{{l10n.type_title}}" />{{/show_title_field}}'
+ + '<h3><span class="Ldt-CreateAnnotation-h3Left">{{#show_title_field}}<input class="Ldt-CreateAnnotation-Title empty" placeholder="{{l10n.type_title}}" />{{/show_title_field}}'
+ '{{^show_title_field}}<span class="Ldt-CreateAnnotation-NoTitle">{{l10n.no_title}} </span>{{/show_title_field}}'
- + ' <span class="Ldt-CreateAnnotation-Times">{{#show_slice}}{{l10n.from_time}} {{/show_slice}}{{^show_slice}}{{l10n.at_time}} {{/show_slice}} <span class="Ldt-CreateAnnotation-Begin">00:00</span>'
+ + '<span class="Ldt-CreateAnnotation-Times"> {{#show_slice}}{{l10n.from_time}} {{/show_slice}}{{^show_slice}}{{l10n.at_time}} {{/show_slice}} <span class="Ldt-CreateAnnotation-Begin">00:00</span>'
+ '{{#show_slice}} {{l10n.to_time}} <span class="Ldt-CreateAnnotation-End">{{end}}</span>{{/show_slice}}</span></span>'
- + '{{#show_creator_field}}{{l10n.your_name_}} <input class="Ldt-CreateAnnotation-Creator" value="{{creator_name}}" /></h3>{{/show_creator_field}}'
- + '<textarea class="Ldt-CreateAnnotation-Description" placeholder="{{l10n.type_description}}"></textarea>'
+ + '{{#show_creator_field}}{{l10n.your_name_}} <input class="Ldt-CreateAnnotation-Creator empty" value="{{creator_name}}" /></h3>{{/show_creator_field}}'
+ + '<textarea class="Ldt-CreateAnnotation-Description empty" placeholder="{{l10n.type_description}}"></textarea>'
+ '<div class="Ldt-CreateAnnotation-Avatar"><img src="{{creator_avatar}}" title="{{creator_name}}"></img></div>'
+ '<input type="submit" class="Ldt-CreateAnnotation-Submit" value="{{l10n.submit}}" />'
+ '{{#show_mic_record}}<div class="Ldt-CreateAnnotation-RecBlock"><div class="Ldt-CreateAnnotation-RecLabel">Add voice annotation</div>'
@@ -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;
}
@@ -421,7 +439,7 @@
function() {
_this.close_after_send
? _this.hide()
- : _this.showScreen("Main");
+ : _this.show();
},
_this.after_send_timeout
);
--- a/src/widgets/Slice.js Fri Oct 26 15:51:05 2012 +0200
+++ b/src/widgets/Slice.js Fri Oct 26 18:37:55 2012 +0200
@@ -48,7 +48,7 @@
},
start: function() {
_this.sliding = true;
- if (!_this.media.getPaused) {
+ if (!_this.media.getPaused()) {
_this.media.pause();
}
_currentTime = _this.media.getCurrentTime();