nodebb-plugin-simple-contact 1.1.4 → 1.2.0

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/library.js CHANGED
@@ -160,12 +160,25 @@ async function deleteRequest(req, res) {
160
160
  }
161
161
 
162
162
  ContactPlugin.addNavigation = async function (header) {
163
- header.navigation.push({ route: '/contact', iconClass: 'fa-envelope', text: 'צור קשר' });
163
+ if (header && Array.isArray(header.navigation)) {
164
+ header.navigation.push({
165
+ route: '/contact',
166
+ iconClass: 'fa-envelope',
167
+ text: 'צור קשר',
168
+ title: 'צור קשר'
169
+ });
170
+ }
164
171
  return header;
165
172
  };
166
173
 
167
174
  ContactPlugin.addAdminNavigation = async function (header) {
168
- header.plugins.push({ route: '/plugins/contact', icon: 'fa-envelope', name: 'פניות צור קשר' });
175
+ if (header && Array.isArray(header.plugins)) {
176
+ header.plugins.push({
177
+ route: '/plugins/contact',
178
+ icon: 'fa-envelope',
179
+ name: 'פניות צור קשר'
180
+ });
181
+ }
169
182
  return header;
170
183
  };
171
184
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "nodebb-plugin-simple-contact",
3
- "version": "1.1.4",
3
+ "version": "1.2.0",
4
4
  "description": "תוסף טופס צור קשר עם התראות למנהלים וניהול פניות",
5
5
  "main": "library.js",
6
6
  "nbbpm": {
@@ -19,7 +19,6 @@
19
19
  <label for="username" style="font-weight:600; display:block; margin-bottom:6px;">שם משתמש בפורום</label>
20
20
  <input type="text" class="form-control" id="username" name="username" style="border-radius:10px; padding:10px;">
21
21
  </div>
22
-
23
22
  <div class="form-group" style="margin-bottom:16px;">
24
23
  <label for="email" style="font-weight:600; display:block; margin-bottom:6px;">כתובת מייל *</label>
25
24
  <input type="email" class="form-control" id="email" name="email" required style="border-radius:10px; padding:10px;">
@@ -58,7 +57,7 @@
58
57
 
59
58
  var formData = {
60
59
  fullName: form.find('#fullName').val(),
61
- username: form.find('#username').val(),
60
+ username: (app.user && app.user.uid > 0) ? app.user.username : form.find('#username').val(),
62
61
  email: form.find('#email').val(),
63
62
  content: form.find('#content').val(),
64
63
  _csrf: config.csrf_token
@@ -91,7 +90,6 @@
91
90
  }
92
91
  var $ = jQuery;
93
92
  initContactForm($);
94
-
95
93
  $(window).off('action:ajaxify.end.contact').on('action:ajaxify.end.contact', function(ev, data) {
96
94
  if (data.url === 'contact') {
97
95
  initContactForm($);
@@ -101,4 +99,4 @@
101
99
 
102
100
  safeBoot();
103
101
  })();
104
- </script>
102
+ </script>