Improved wording.

This commit is contained in:
Martin Edenhofer 2015-08-10 11:11:27 +02:00
parent 6cfaabfc40
commit 5442eb5762
3 changed files with 17 additions and 10 deletions

View file

@ -21,10 +21,13 @@
<td><label><input type="text" name="title" value="<%- @T('Feedback Form') %>" style="display: inline; width: auto;"/> <%- @T('Title of the form.') %></label></td>
</tr>
<tr>
<td><label><input type="text" name="submit" value="<%- @T('Submit') %>" style="display: inline; width: auto;"/> <%- @T('Name of submit button.') %></label></td>
<td><label><input type="text" name="messageTitle" value="" style="display: inline; width: auto;"/> <%- @T('Form headline.') %></label></td>
</tr>
<tr>
<td><label><input type="text" name="thank_you" value="<%- @T('Thank you for your inquiry!') %>" style="display: inline; width: auto;"/> <%- @T('Message after sending form.') %></label></td>
<td><label><input type="text" name="messageSubmit" value="<%- @T('Submit') %>" style="display: inline; width: auto;"/> <%- @T('Name of form submit button.') %></label></td>
</tr>
<tr>
<td><label><input type="text" name="messageThankYou" value="<%- @T('Thank you for your inquiry!') %>" style="display: inline; width: auto;"/> <%- @T('Message after sending form.') %></label></td>
</tr>
<tr>
<td><label><input type="checkbox" name="debug" value="true"/> <%- @T('Enable debugging for implementation.') %></label></td>

View file

@ -22,6 +22,10 @@
color: #a94442;
}
.zammad-form .js-thankyou {
text-align: center;
}
.modal {
position: fixed;
left: 0;

View file

@ -9,8 +9,9 @@
debug: false,
noCSS: false,
title: 'Zammad Form',
submit: 'Submit',
thank_you: 'Thank you for your inquiry!',
messageHeadline: '',
messageSubmit: 'Submit',
messageThankYou: 'Thank you for your inquiry!',
};
function Plugin( element, options ) {
@ -132,9 +133,6 @@
// ticket has been created
_this.thanks()
// rerender after 6 seconds
_this.render()
}).fail(function() {
alert('Faild to submit form!')
});
@ -182,7 +180,9 @@
var $element = $(element)
var $form = $element.find('form')
$form.append('<h2>' + this.options.title + '</h2>')
if (this.options.messageHeadline && this.options.messageHeadline != '') {
$form.append('<h2>' + this.options.messageHeadline + '</h2>')
}
$.each(this.attributes, function( index, value ) {
var item = $('<div class="form-group"><label>' + value.display + '</label></div>')
if (value.tag == 'input') {
@ -193,7 +193,7 @@
}
$form.append(item)
})
$form.append('<button type="submit" class="btn">' + this.options.submit + '</button')
$form.append('<button type="submit" class="btn">' + this.options.messageSubmit + '</button')
this.$modal = $element
this.$form = $form
@ -226,7 +226,7 @@
// thanks
Plugin.prototype.thanks = function(e) {
var thanks = $('<div>Thank you for your inquery!</div>')
var thanks = $('<div class="js-thankyou">' + this.options.messageThankYou + '</div>')
this.$form.html(thanks)
}