diff -r b3ee7d1b472a -r 64c2eaafe5e2 src/widgets/CreateAnnotation.js --- a/src/widgets/CreateAnnotation.js Fri Jun 29 16:22:52 2012 +0200 +++ b/src/widgets/CreateAnnotation.js Thu Jul 05 19:08:13 2012 +0200 @@ -10,13 +10,14 @@ show_title_field : false, /* For the moment, titles can't be sent to ldtplatform */ show_creator_field : true, start_visible : true, - always_visible : true, + always_visible : false, sync_on_slice_widget : true, /* If false, syncs on current timecode */ takeover_arrow : false, - minimize_annotation_widget : false, + minimize_annotation_widget : true, creator_name : "", - creator_avatar : "https://si0.twimg.com/sticky/default_profile_images/default_profile_1_normal.png", + creator_avatar : "", tags : false, + tag_titles : false, pause_on_write : true, max_tags : 8, polemics : [{ @@ -91,11 +92,11 @@ IriSP.Widgets.CreateAnnotation.prototype.template = '
' + '
' - + '

{{#show_title_field}}{{/show_title_field}}' + + '

{{#show_title_field}}{{/show_title_field}}' + '{{^show_title_field}}{{l10n.no_title}} {{/show_title_field}}' + ' {{#sync_on_slice_widget}}{{l10n.from_time}} {{/sync_on_slice_widget}}{{^sync_on_slice_widget}}{{l10n.at_time}} {{/sync_on_slice_widget}} 00:00' - + '{{#sync_on_slice_widget}} {{l10n.to_time}} 00:00{{/sync_on_slice_widget}}

' - + '{{#show_creator_field}}

{{l10n.your_name_}}

{{/show_creator_field}}' + + '{{#sync_on_slice_widget}} {{l10n.to_time}} 00:00{{/sync_on_slice_widget}}' + + '{{#show_creator_field}}{{l10n.your_name_}} {{/show_creator_field}}' + '' + '
' + '' @@ -110,6 +111,20 @@ + '
'; IriSP.Widgets.CreateAnnotation.prototype.draw = function() { + var _this = this; + if (this.tag_titles && !this.tags) { + this.tags = IriSP._(this.tag_titles).map(function(_tag_title) { + var _tag, + _tags = _this.source.getTags().searchByTitle(_tag_title); + if (_tags.length) { + _tag = _tags[0]; + } else { + _tag = new IriSP.Model.Tag(false, _this.source); + _tag.title = _tag_title; + } + return _tag; + }); + } if (!this.tags) { this.tags = this.source.getTags() .sortBy(function (_tag) { @@ -121,7 +136,6 @@ }); // We have to use the map function because Mustache doesn't like our tags object } - var _this = this; this.renderTemplate(); this.$.find(".Ldt-CreateAnnotation-Close").click(function() { _this.hide();