src/widgets/CreateAnnotation.js
changeset 1069 2409cb4cebaf
parent 1068 7623f9af9272
child 1072 ac1eacb3aa33
--- a/src/widgets/CreateAnnotation.js	Fri Oct 02 11:27:17 2015 +0200
+++ b/src/widgets/CreateAnnotation.js	Mon Dec 28 15:50:04 2015 +0100
@@ -64,6 +64,7 @@
     pause_when_displaying: false,
     custom_send_button: false,
     custom_cancel_button: false,
+    custom_description_placeholder: false,
     preview_mode: false,
 };
 
@@ -137,12 +138,12 @@
     +   '<span title="{{l10n.out_tooltip}}" class="Ldt-CreateAnnotation-Control-Out">Out</span>'
     +   '<span title="{{l10n.play_tooltip}}" class="Ldt-CreateAnnotation-Control-Play">Play</span>'
     + '</div>{{/show_controls}}'
-    + '<textarea class="Ldt-CreateAnnotation-Description Ldt-TraceMe empty" placeholder="{{l10n.type_description}}"></textarea>'
+    + '<textarea class="Ldt-CreateAnnotation-Description Ldt-TraceMe empty" placeholder="{{#custom_description_placeholder}}{{custom_description_placeholder}}{{/custom_description_placeholder}}{{^custom_description_placeholder}}{{l10n.type_description}}{{/custom_description_placeholder}}"></textarea>'
     + '{{#show_creator_field}}<div class="Ldt-CreateAnnotation-Avatar"><img src="{{creator_avatar}}" title="{{creator_name}}"></img></div>{{/show_creator_field}}'
     + '<div class="Ldt-CreateAnnotation-SubmitArea Ldt-TraceMe">'
-    + '{{#preview_mode}}<input type="button" class="Ldt-CreateAnnotation-PreviewSubmit" title="{{l10n.preview_submit}}" value="{{#custom_send_button}}{{custom_send_button}}{{/custom_send_button}}{{^custom_send_button}}{{l10n.submit}}{{/custom_send_button}}" />{{/preview_mode}}'
-    + '{{^preview_mode}}<input type="submit" class="Ldt-CreateAnnotation-Submit" value="{{#custom_send_button}}{{custom_send_button}}{{/custom_send_button}}{{^custom_send_button}}{{l10n.submit}}{{/custom_send_button}}" />{{/preview_mode}}'
-    + '<input type="button" class="Ldt-CreateAnnotation-Cancel" value="{{#custom_cancel_button}}{{custom_cancel_button}}{{/custom_cancel_button}}{{^custom_cancel_button}}{{l10n.cancel}}{{/custom_cancel_button}}" />'
+    +  '{{#preview_mode}}<input type="button" class="Ldt-CreateAnnotation-PreviewSubmit" title="{{l10n.preview_submit}}" value="{{#custom_send_button}}{{custom_send_button}}{{/custom_send_button}}{{^custom_send_button}}{{l10n.submit}}{{/custom_send_button}}" />{{/preview_mode}}'
+    +  '{{^preview_mode}}<input type="submit" class="Ldt-CreateAnnotation-Submit" value="{{#custom_send_button}}{{custom_send_button}}{{/custom_send_button}}{{^custom_send_button}}{{l10n.submit}}{{/custom_send_button}}" />{{/preview_mode}}'
+    +   '<input type="button" class="Ldt-CreateAnnotation-Cancel" value="{{#custom_cancel_button}}{{custom_cancel_button}}{{/custom_cancel_button}}{{^custom_cancel_button}}{{l10n.cancel}}{{/custom_cancel_button}}" />'
     +   '<div class="Ldt-CreateAnnotation-Begin Ldt-CreateAnnotation-Times">00:00</div>'
     + '</div>'
     + '{{#show_mic_record}}<div class="Ldt-CreateAnnotation-RecBlock"><div class="Ldt-CreateAnnotation-RecLabel">Add voice annotation</div>'
@@ -235,7 +236,7 @@
                 show_arrow: this.show_arrow,
                 annotation_type: this.slice_annotation_type,
                 onBoundsChanged: function(_from, _to) {
-                    this.setBeginEnd(_from, _to);
+                    _this.setBeginEnd(_from, _to);
                 }
             },
             "slice"
@@ -379,14 +380,14 @@
         if (this.visible) {
             this.hide();
         } else {
-            var t = _this.media.getCurrentTime() || 0;
-            _this.setBeginEnd(t, t);
-            if (_this.slice_widget) {
-                _this.slice_widget.setBounds(_this.begin, _this.end);
+            var t = this.media.getCurrentTime() || 0;
+            this.setBeginEnd(t, t);
+            if (this.slice_widget) {
+                this.slice_widget.setBounds(this.begin, this.end);
             }
             this.show();
             // Set focus on textarea
-            _this.$.find(".Ldt-CreateAnnotation-Description").focus();
+            this.$.find(".Ldt-CreateAnnotation-Description").focus();
         }
     }
 };