Added support for custom button texts
authordurandn
Fri, 18 Sep 2015 14:40:25 +0200
changeset 1050 0b287ecbc2cb
parent 1049 4e8b3df6e5be
child 1051 3820cf5fe29e
Added support for custom button texts
src/widgets/CreateAnnotation.js
--- a/src/widgets/CreateAnnotation.js	Fri Sep 18 14:39:45 2015 +0200
+++ b/src/widgets/CreateAnnotation.js	Fri Sep 18 14:40:25 2015 +0200
@@ -53,6 +53,8 @@
     close_after_send: false,
     tag_prefix: "#",
     pause_when_displaying: false,
+    custom_send_button: false,
+    custom_cancel_button: false,
 };
 
 IriSP.Widgets.CreateAnnotation.prototype.messages = {
@@ -114,8 +116,8 @@
     + '{{#show_creator_field}}{{l10n.your_name_}} <input class="Ldt-CreateAnnotation-Creator empty" value="{{creator_name}}" {{#creator_field_readonly}}readonly{{/creator_field_readonly}}/>{{/show_creator_field}}</h3>'
     + '<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}}" />'
-    + '<input type="button" class="Ldt-CreateAnnotation-Cancel" value="{{l10n.cancel}}" />'
+    + '<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}}" />'
+    + '<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}}" />'
     + '{{#show_mic_record}}<div class="Ldt-CreateAnnotation-RecBlock"><div class="Ldt-CreateAnnotation-RecLabel">Add voice annotation</div>'
     + '    <object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" width="220" height="160">'
     + '        <param name="movie" value="{{record_swf}}" />'