nodebb-plugin-simple-contact 1.1.5 → 1.2.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +1 -1
- package/public/templates/contact.tpl +44 -41
package/package.json
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
<div class="row text-center" style="display:flex; justify-content:center; align-items:center;">
|
|
1
|
+
<div class="row text-center" style="display:flex; justify-content:center; align-items:center;"> [cite: 1]
|
|
2
2
|
<div class="col-lg-8 col-lg-offset-2" style="margin-top:20px;">
|
|
3
3
|
<div class="panel panel-default shadow-sm" style="border-radius:14px; border:none;">
|
|
4
4
|
|
|
@@ -8,35 +8,35 @@
|
|
|
8
8
|
|
|
9
9
|
<div class="panel-body text-center" style="background:#fafafa; padding:20px 25px;">
|
|
10
10
|
|
|
11
|
-
<form id="contact-form" role="form" style="max-width:600px; margin:0 auto;">
|
|
11
|
+
<form id="contact-form" role="form" style="max-width:600px; margin:0 auto;"> [cite: 2]
|
|
12
12
|
|
|
13
13
|
<div class="form-group" style="margin-bottom:16px;">
|
|
14
|
-
<label for="fullName" style="font-weight:600; display:block; margin-bottom:6px;">שם מלא *</label>
|
|
15
|
-
<input type="text" class="form-control" id="fullName" name="fullName" required style="border-radius:10px; padding:10px;">
|
|
14
|
+
<label for="fullName" style="font-weight:600; display:block; margin-bottom:6px;">שם מלא *</label> [cite: 2]
|
|
15
|
+
<input type="text" class="form-control" id="fullName" name="fullName" required style="border-radius:10px; padding:10px;"> [cite: 3]
|
|
16
16
|
</div>
|
|
17
17
|
|
|
18
|
-
<div class="form-group" style="margin-bottom:16px;">
|
|
19
|
-
<label for="username" style="font-weight:600; display:block; margin-bottom:6px;">שם משתמש בפורום</label>
|
|
20
|
-
<input type="text" class="form-control" id="username" name="username" style="border-radius:10px; padding:10px;">
|
|
18
|
+
<div class="form-group" id="username-group" style="margin-bottom:16px;"> [cite: 4]
|
|
19
|
+
<label for="username" style="font-weight:600; display:block; margin-bottom:6px;">שם משתמש בפורום</label> [cite: 4]
|
|
20
|
+
<input type="text" class="form-control" id="username" name="username" style="border-radius:10px; padding:10px;"> [cite: 5]
|
|
21
21
|
</div>
|
|
22
22
|
|
|
23
23
|
<div class="form-group" style="margin-bottom:16px;">
|
|
24
|
-
<label for="email" style="font-weight:600; display:block; margin-bottom:6px;">כתובת מייל *</label>
|
|
25
|
-
<input type="email" class="form-control" id="email" name="email" required style="border-radius:10px; padding:10px;">
|
|
24
|
+
<label for="email" style="font-weight:600; display:block; margin-bottom:6px;">כתובת מייל *</label> [cite: 6]
|
|
25
|
+
<input type="email" class="form-control" id="email" name="email" required style="border-radius:10px; padding:10px;"> [cite: 7]
|
|
26
26
|
</div>
|
|
27
27
|
|
|
28
28
|
<div class="form-group" style="margin-bottom:20px;">
|
|
29
|
-
<label for="content" style="font-weight:600; display:block; margin-bottom:6px;">תוכן הפנייה *</label>
|
|
30
|
-
<textarea class="form-control" id="content" name="content" rows="6" required style="border-radius:10px; padding:10px;"></textarea>
|
|
29
|
+
<label for="content" style="font-weight:600; display:block; margin-bottom:6px;">תוכן הפנייה *</label> [cite: 8]
|
|
30
|
+
<textarea class="form-control" id="content" name="content" rows="6" required style="border-radius:10px; padding:10px;"></textarea> [cite: 9]
|
|
31
31
|
</div>
|
|
32
32
|
|
|
33
|
-
<button type="submit" class="btn btn-primary btn-block" id="submit-btn" style="border-radius:22px; font-weight:600; padding:12px; margin-top:10px;">
|
|
33
|
+
<button type="submit" class="btn btn-primary btn-block" id="submit-btn" style="border-radius:22px; font-weight:600; padding:12px; margin-top:10px;"> [cite: 10]
|
|
34
34
|
שלח פנייה
|
|
35
35
|
</button>
|
|
36
36
|
|
|
37
37
|
</form>
|
|
38
38
|
|
|
39
|
-
<div id="contact-alert" class="alert text-center" style="display:none; margin-top:20px; border-radius:10px;"></div>
|
|
39
|
+
<div id="contact-alert" class="alert text-center" style="display:none; margin-top:20px; border-radius:10px;"></div> [cite: 11]
|
|
40
40
|
|
|
41
41
|
</div>
|
|
42
42
|
</div>
|
|
@@ -46,59 +46,62 @@
|
|
|
46
46
|
<script>
|
|
47
47
|
(function() {
|
|
48
48
|
function initContactForm($) {
|
|
49
|
-
var form = $('#contact-form');
|
|
50
|
-
var btn = $('#submit-btn');
|
|
51
|
-
var alertBox = $('#contact-alert');
|
|
49
|
+
var form = $('#contact-form'); [cite: 12]
|
|
50
|
+
var btn = $('#submit-btn'); [cite: 12]
|
|
51
|
+
var alertBox = $('#contact-alert'); [cite: 12]
|
|
52
|
+
|
|
53
|
+
if (app.user && app.user.uid > 0) {
|
|
54
|
+
$('#username-group').hide();
|
|
55
|
+
}
|
|
52
56
|
|
|
53
57
|
form.off('submit').on('submit', function(e) {
|
|
54
58
|
e.preventDefault();
|
|
55
59
|
|
|
56
|
-
btn.prop('disabled', true).text('שולח...');
|
|
57
|
-
alertBox.hide().removeClass('alert-success alert-danger');
|
|
60
|
+
btn.prop('disabled', true).text('שולח...'); [cite: 12]
|
|
61
|
+
alertBox.hide().removeClass('alert-success alert-danger'); [cite: 12]
|
|
58
62
|
|
|
59
63
|
var formData = {
|
|
60
|
-
fullName: form.find('#fullName').val(),
|
|
61
|
-
username: form.find('#username').val(),
|
|
62
|
-
email: form.find('#email').val(),
|
|
63
|
-
content: form.find('#content').val(),
|
|
64
|
-
_csrf: config.csrf_token
|
|
64
|
+
fullName: form.find('#fullName').val(), [cite: 13]
|
|
65
|
+
username: (app.user && app.user.uid > 0) ? app.user.username : form.find('#username').val(),
|
|
66
|
+
email: form.find('#email').val(), [cite: 13]
|
|
67
|
+
content: form.find('#content').val(), [cite: 13]
|
|
68
|
+
_csrf: config.csrf_token [cite: 13]
|
|
65
69
|
};
|
|
66
70
|
|
|
67
71
|
$.ajax({
|
|
68
|
-
url: config.relative_path + '/api/contact/send',
|
|
69
|
-
type: 'POST',
|
|
70
|
-
data: formData,
|
|
72
|
+
url: config.relative_path + '/api/contact/send', [cite: 14]
|
|
73
|
+
type: 'POST', [cite: 14]
|
|
74
|
+
data: formData, [cite: 14]
|
|
71
75
|
success: function(response) {
|
|
72
|
-
alertBox.addClass('alert-success').text(response.message || 'הפנייה נשלחה בהצלחה').fadeIn();
|
|
73
|
-
form[0].reset();
|
|
74
|
-
btn.text('שלח פנייה');
|
|
76
|
+
alertBox.addClass('alert-success').text(response.message || 'הפנייה נשלחה בהצלחה').fadeIn(); [cite: 15]
|
|
77
|
+
form[0].reset(); [cite: 15]
|
|
78
|
+
btn.text('שלח פנייה'); [cite: 15]
|
|
75
79
|
},
|
|
76
80
|
error: function(xhr) {
|
|
77
|
-
var msg = (xhr.responseJSON && xhr.responseJSON.error) ? xhr.responseJSON.error : 'אירעה שגיאה בשליחה';
|
|
78
|
-
alertBox.addClass('alert-danger').text(msg).fadeIn();
|
|
81
|
+
var msg = (xhr.responseJSON && xhr.responseJSON.error) ? xhr.responseJSON.error : 'אירעה שגיאה בשליחה'; [cite: 16]
|
|
82
|
+
alertBox.addClass('alert-danger').text(msg).fadeIn(); [cite: 16]
|
|
79
83
|
},
|
|
80
84
|
complete: function() {
|
|
81
|
-
btn.prop('disabled', false).text('שלח פנייה');
|
|
85
|
+
btn.prop('disabled', false).text('שלח פנייה'); [cite: 17]
|
|
82
86
|
}
|
|
83
87
|
});
|
|
84
88
|
});
|
|
85
|
-
}
|
|
89
|
+
} [cite: 18]
|
|
86
90
|
|
|
87
91
|
function safeBoot() {
|
|
88
|
-
if (typeof jQuery === 'undefined') {
|
|
89
|
-
setTimeout(safeBoot, 50);
|
|
90
|
-
return;
|
|
92
|
+
if (typeof jQuery === 'undefined' || typeof app === 'undefined') { [cite: 19]
|
|
93
|
+
setTimeout(safeBoot, 50); [cite: 19]
|
|
94
|
+
return; [cite: 19]
|
|
91
95
|
}
|
|
92
96
|
var $ = jQuery;
|
|
93
|
-
initContactForm($);
|
|
94
|
-
|
|
95
|
-
$(window).off('action:ajaxify.end.contact').on('action:ajaxify.end.contact', function(ev, data) {
|
|
97
|
+
initContactForm($); [cite: 20]
|
|
98
|
+
$(window).off('action:ajaxify.end.contact').on('action:ajaxify.end.contact', function(ev, data) { [cite: 20]
|
|
96
99
|
if (data.url === 'contact') {
|
|
97
100
|
initContactForm($);
|
|
98
101
|
}
|
|
99
102
|
});
|
|
100
|
-
}
|
|
103
|
+
} [cite: 21]
|
|
101
104
|
|
|
102
105
|
safeBoot();
|
|
103
106
|
})();
|
|
104
|
-
</script>
|
|
107
|
+
</script>
|