nodebb-theme-persona 11.3.21 → 11.3.22

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/less/mobile.less CHANGED
@@ -63,15 +63,50 @@
63
63
  left: auto;
64
64
  right: 7px;
65
65
  top: 10px;
66
-
66
+ &[component="notifications/icon"] {
67
+ right: 41px;
68
+ }
67
69
  &.unread-count::after {
68
70
  position: static;
69
71
  }
70
72
  }
71
73
  }
74
+ .navbar-header .navbar-search {
75
+ input[name="term"] {
76
+ width: 150px;
77
+ }
72
78
 
73
- #menu {
74
- padding-top: 100px;
79
+ padding: 4px 0px 4px 0px;
80
+ }
81
+ #menu .menu-section {
82
+ padding-top: 20px;
83
+ }
84
+ #chats-menu {
85
+ .nav-pills {
86
+ [component="user/status"] {
87
+ position: absolute;
88
+ right: 20px;
89
+ }
90
+
91
+ background-color: #101010;
92
+ height: 50px;
93
+ li {
94
+ margin: 0;
95
+ padding: 0;
96
+ width: 33%;
97
+ text-align: center;
98
+ height: 100%;
99
+ a {
100
+ height: 100%;
101
+ padding-top: 15px;
102
+ }
103
+ &.active {
104
+ a {
105
+ background-color: #1D1F20;
106
+ }
107
+ }
108
+ }
109
+ }
75
110
  }
76
111
 
77
112
  .slideout-menu {
@@ -170,7 +205,6 @@
170
205
  font-style: normal;
171
206
 
172
207
  &:after {
173
- left: 5px;
174
208
  top: -1px;
175
209
  padding: 3px 7px;
176
210
  background: #333;
@@ -189,10 +223,6 @@
189
223
  margin: 0;
190
224
  }
191
225
 
192
- .menu-section {
193
- margin: 25px 0;
194
- }
195
-
196
226
  .menu-section-title {
197
227
  text-transform: uppercase;
198
228
  color: #85888d;
@@ -205,7 +235,7 @@
205
235
 
206
236
  .menu-section-list {
207
237
  padding: 0;
208
- margin: 10px 0;
238
+ margin: 0;
209
239
  list-style: none;
210
240
 
211
241
  a, button {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "nodebb-theme-persona",
3
- "version": "11.3.21",
3
+ "version": "11.3.22",
4
4
  "nbbpm": {
5
5
  "compatibility": "^1.18.0"
6
6
  },
package/public/persona.js CHANGED
@@ -10,10 +10,6 @@ $(document).ready(function () {
10
10
  $(window).on('resize', utils.debounce(configureNavbarHiding, 200));
11
11
  $(window).on('resize', updatePanelOffset);
12
12
 
13
- $(window).on('action:app.loggedIn', function () {
14
- setupMobileMenu();
15
- });
16
-
17
13
  $(window).on('action:app.load', function () {
18
14
  setupTaskbar();
19
15
  setupMobileMenu();
@@ -196,14 +192,14 @@ $(document).ready(function () {
196
192
  return;
197
193
  }
198
194
 
199
- require(['pulling', 'storage'], function (Pulling, Storage) {
195
+ require(['pulling', 'storage', 'alerts'], function (Pulling, Storage, alerts) {
200
196
  if (!Pulling) {
201
197
  return;
202
198
  }
203
199
 
204
200
  // initialization
205
201
 
206
- var chatMenuVisible = !config.disableChat && app.user && parseInt(app.user.uid, 10);
202
+ var chatMenuVisible = app.user && parseInt(app.user.uid, 10);
207
203
  var swapped = !!Storage.getItem('persona:menus:legacy-layout');
208
204
  var margin = window.innerWidth;
209
205
 
@@ -285,19 +281,16 @@ $(document).ready(function () {
285
281
  navSlideout.enable().toggle();
286
282
  });
287
283
 
288
- function loadNotifications() {
289
- require(['notifications'], function (notifications) {
290
- const notifList = $('#menu [data-section="notifications"] ul');
291
- notifications.loadNotifications(notifList, function () {
292
- notifList.find('.deco-none').removeClass('deco-none');
293
- console.log(notifList.find('.deco-none'));
284
+ if (chatMenuVisible) {
285
+ chatsSlideout.on('opened', function loadNotifications() {
286
+ require(['notifications'], function (notifications) {
287
+ const notifList = $('#chats-menu [data-section="notifications"] ul');
288
+ notifications.loadNotifications(notifList, function () {
289
+ notifList.find('.deco-none').removeClass('deco-none');
290
+ });
294
291
  });
295
292
  });
296
- }
297
-
298
- navSlideout.on('opened', loadNotifications);
299
293
 
300
- if (chatMenuVisible) {
301
294
  navSlideout.on('beforeopen', function () {
302
295
  chatsSlideout.close();
303
296
  chatsSlideout.disable();
@@ -306,13 +299,16 @@ $(document).ready(function () {
306
299
  });
307
300
  }
308
301
 
309
- $('#menu [data-section="navigation"] ul').html($('#main-nav').html() + ($('#search-menu').html() || '') + ($('#logged-out-menu').html() || ''));
302
+ $('#menu [data-section="navigation"] ul').html(
303
+ $('#main-nav').html() +
304
+ ($('#logged-out-menu').html() || '')
305
+ );
310
306
 
311
- $('#user-control-list').children().clone(true, true).appendTo($('#menu [data-section="profile"] ul'));
307
+ $('#user-control-list').children().clone(true, true).appendTo($('#chats-menu [data-section="profile"] ul'));
312
308
 
313
309
  socket.on('event:user_status_change', function (data) {
314
310
  if (parseInt(data.uid, 10) === app.user.uid) {
315
- app.updateUserStatus($('#menu [component="user/status"]'), data.status);
311
+ app.updateUserStatus($('#chats-menu [component="user/status"]'), data.status);
316
312
  navSlideout.close();
317
313
  }
318
314
  });
@@ -344,6 +340,27 @@ $(document).ready(function () {
344
340
  });
345
341
  }
346
342
 
343
+ const searchInputEl = $('.navbar-header .navbar-search input[name="term"]');
344
+ const searchButton = $('.navbar-header .navbar-search button[type="button"]');
345
+ searchButton.off('click').on('click', function () {
346
+ if (!config.loggedIn && !app.user.privileges['search:content']) {
347
+ alerts.alert({
348
+ message: '[[error:search-requires-login]]',
349
+ timeout: 3000,
350
+ });
351
+ ajaxify.go('login');
352
+ return false;
353
+ }
354
+
355
+ searchButton.addClass('hidden');
356
+ searchInputEl.removeClass('hidden').focus();
357
+ searchInputEl.off('blur').on('blur', function () {
358
+ searchInputEl.addClass('hidden');
359
+ searchButton.removeClass('hidden');
360
+ });
361
+ return false;
362
+ });
363
+
347
364
  // add a checkbox in the user settings page
348
365
  // so users can swap the sides the menus appear on
349
366
 
@@ -5,78 +5,80 @@
5
5
  {{{end}}}
6
6
  </div>
7
7
  <div class="row login">
8
- <div class="row {{{ if widgets.sidebar.length }}}col-lg-9 col-sm-12{{{ else }}}col-lg-12{{{ end }}}">
9
- {{{ if allowLocalLogin }}}
10
- <div class="{{{ if alternate_logins }}}col-md-6{{{ else }}}col-md-12{{{ end }}}">
11
- <div class="login-block">
12
- <div class="alert alert-danger" id="login-error-notify" <!-- IF error -->style="display:block"<!-- ELSE -->style="display: none;"<!-- ENDIF error -->>
13
- <button type="button" class="close" data-dismiss="alert">&times;</button>
14
- <strong>[[login:failed_login_attempt]]</strong>
15
- <p>{error}</p>
16
- </div>
8
+ <div class="{{{ if widgets.sidebar.length }}}col-lg-9 col-sm-12{{{ else }}}col-lg-12{{{ end }}}">
9
+ <div class="row">
10
+ {{{ if allowLocalLogin }}}
11
+ <div class="{{{ if alternate_logins }}}col-md-6{{{ else }}}col-md-12{{{ end }}}">
12
+ <div class="login-block">
13
+ <div class="alert alert-danger" id="login-error-notify" <!-- IF error -->style="display:block"<!-- ELSE -->style="display: none;"<!-- ENDIF error -->>
14
+ <button type="button" class="close" data-dismiss="alert">&times;</button>
15
+ <strong>[[login:failed_login_attempt]]</strong>
16
+ <p>{error}</p>
17
+ </div>
17
18
 
18
- <form class="form-horizontal" role="form" method="post" id="login-form">
19
- <div class="form-group">
20
- <label for="username" class="col-lg-2 control-label">{allowLoginWith}</label>
21
- <div class="col-lg-10">
22
- <input class="form-control" type="text" placeholder="{allowLoginWith}" name="username" id="username" autocorrect="off" autocapitalize="off" value="{username}"/>
19
+ <form class="form-horizontal" role="form" method="post" id="login-form">
20
+ <div class="form-group">
21
+ <label for="username" class="col-lg-2 control-label">{allowLoginWith}</label>
22
+ <div class="col-lg-10">
23
+ <input class="form-control" type="text" placeholder="{allowLoginWith}" name="username" id="username" autocorrect="off" autocapitalize="off" value="{username}"/>
24
+ </div>
23
25
  </div>
24
- </div>
25
- <div class="form-group">
26
- <label for="password" class="col-lg-2 control-label">[[user:password]]</label>
27
- <div class="col-lg-10">
28
- <input class="form-control" type="password" placeholder="[[user:password]]" name="password" id="password" <!-- IF username -->autocomplete="off"<!-- ENDIF username -->/>
29
- <p id="caps-lock-warning" class="text-danger hidden">
30
- <i class="fa fa-exclamation-triangle"></i> [[login:caps-lock-enabled]]
31
- </p>
26
+ <div class="form-group">
27
+ <label for="password" class="col-lg-2 control-label">[[user:password]]</label>
28
+ <div class="col-lg-10">
29
+ <input class="form-control" type="password" placeholder="[[user:password]]" name="password" id="password" <!-- IF username -->autocomplete="off"<!-- ENDIF username -->/>
30
+ <p id="caps-lock-warning" class="text-danger hidden">
31
+ <i class="fa fa-exclamation-triangle"></i> [[login:caps-lock-enabled]]
32
+ </p>
33
+ </div>
32
34
  </div>
33
- </div>
34
- <div class="form-group">
35
- <div class="col-lg-offset-2 col-lg-10">
36
- <div class="checkbox">
37
- <label>
38
- <input type="checkbox" name="remember" id="remember" checked /> [[login:remember_me]]
39
- </label>
35
+ <div class="form-group">
36
+ <div class="col-lg-offset-2 col-lg-10">
37
+ <div class="checkbox">
38
+ <label>
39
+ <input type="checkbox" name="remember" id="remember" checked /> [[login:remember_me]]
40
+ </label>
41
+ </div>
40
42
  </div>
41
43
  </div>
42
- </div>
43
- {{{each loginFormEntry}}}
44
- <div class="form-group loginFormEntry">
45
- <label for="login-{loginFormEntry.styleName}" class="col-lg-4 control-label">{loginFormEntry.label}</label>
46
- <div id="login-{loginFormEntry.styleName}" class="col-lg-8">{{loginFormEntry.html}}</div>
47
- </div>
48
- {{{end}}}
49
- <input type="hidden" name="_csrf" value="{config.csrf_token}" />
50
- <input type="hidden" name="noscript" id="noscript" value="true" />
51
- <div class="form-group">
52
- <div class="col-lg-offset-2 col-lg-10">
53
- <button class="btn btn-primary btn-lg btn-block" id="login" type="submit">[[global:login]]</button>
54
- <!-- IF allowRegistration -->
55
- <span>[[login:dont_have_account]] <a href="{config.relative_path}/register">[[register:register]]</a></span>
56
- <!-- ENDIF allowRegistration -->
57
- <!-- IF allowPasswordReset -->
58
- &nbsp; <a id="reset-link" href="{config.relative_path}/reset">[[login:forgot_password]]</a>
59
- <!-- ENDIF allowPasswordReset -->
44
+ {{{each loginFormEntry}}}
45
+ <div class="form-group loginFormEntry">
46
+ <label for="login-{loginFormEntry.styleName}" class="col-lg-4 control-label">{loginFormEntry.label}</label>
47
+ <div id="login-{loginFormEntry.styleName}" class="col-lg-8">{{loginFormEntry.html}}</div>
60
48
  </div>
61
- </div>
62
- </form>
49
+ {{{end}}}
50
+ <input type="hidden" name="_csrf" value="{config.csrf_token}" />
51
+ <input type="hidden" name="noscript" id="noscript" value="true" />
52
+ <div class="form-group">
53
+ <div class="col-lg-offset-2 col-lg-10">
54
+ <button class="btn btn-primary btn-lg btn-block" id="login" type="submit">[[global:login]]</button>
55
+ <!-- IF allowRegistration -->
56
+ <span>[[login:dont_have_account]] <a href="{config.relative_path}/register">[[register:register]]</a></span>
57
+ <!-- ENDIF allowRegistration -->
58
+ <!-- IF allowPasswordReset -->
59
+ &nbsp; <a id="reset-link" href="{config.relative_path}/reset">[[login:forgot_password]]</a>
60
+ <!-- ENDIF allowPasswordReset -->
61
+ </div>
62
+ </div>
63
+ </form>
63
64
 
65
+ </div>
64
66
  </div>
65
- </div>
66
- {{{ end }}}
67
+ {{{ end }}}
67
68
 
68
- {{{ if alternate_logins }}}
69
- <div class="{{{ if allowLocalLogin }}}col-md-6<{{{ else }}}col-md-12{{{ end }}}">
70
- <div class="alt-login-block">
71
- <h4>[[login:alternative_logins]]</h4>
72
- <ul class="alt-logins">
73
- {{{each authentication}}}
74
- <li class="{authentication.name}"><a rel="nofollow noopener noreferrer" target="_top" href="{config.relative_path}{authentication.url}"><i class="fa {authentication.icon} fa-3x"></i></a></li>
75
- {{{end}}}
76
- </ul>
69
+ {{{ if alternate_logins }}}
70
+ <div class="{{{ if allowLocalLogin }}}col-md-6<{{{ else }}}col-md-12{{{ end }}}">
71
+ <div class="alt-login-block">
72
+ <h4>[[login:alternative_logins]]</h4>
73
+ <ul class="alt-logins">
74
+ {{{each authentication}}}
75
+ <li class="{authentication.name}"><a rel="nofollow noopener noreferrer" target="_top" href="{config.relative_path}{authentication.url}"><i class="fa {authentication.icon} fa-3x"></i></a></li>
76
+ {{{end}}}
77
+ </ul>
78
+ </div>
77
79
  </div>
80
+ {{{ end }}}
78
81
  </div>
79
- {{{ end }}}
80
82
  </div>
81
83
  <div data-widget-area="sidebar" class="col-lg-3 col-sm-12 {{{ if !widgets.sidebar.length }}}hidden{{{ end }}}">
82
84
  {{{each widgets.sidebar}}}
@@ -1,11 +1,41 @@
1
- <!-- IF config.loggedIn -->
2
- <section class="menu-section" data-section="chats">
3
- <h3 class="menu-section-title">
4
- [[global:header.chats]]
5
- <i class="counter unread-count" component="chat/icon" data-content="{unreadCount.chat}"></i>
6
- </h3>
7
- <ul class="menu-section-list chat-list" component="chat/list">
8
- <a class="navigation-link" href="{relative_path}/user/{user.userslug}/chats">[[modules:chat.see_all]]</a>
9
- </ul>
10
- </section>
11
- <!-- ENDIF config.loggedIn -->
1
+ {{{ if config.loggedIn }}}
2
+ <ul class="nav nav-pills">
3
+ <li>
4
+ <a href="#notifications" data-toggle="tab"><span class="counter unread-count" component="notifications/icon" data-content="{unreadCount.notification}"></span> <i class="fa fa-fw fa-bell"></i></a>
5
+ </li>
6
+ {{{ if !config.disableChat }}}
7
+ <li>
8
+ <a href="#chats" data-toggle="tab"><i class="counter unread-count" component="chat/icon" data-content="{unreadCount.chat}"></i> <i class="fa fa-fw fa-comment"></i></a>
9
+ </li>
10
+ {{{ end }}}
11
+ <li class="active">
12
+ <a href="#profile" data-toggle="tab">
13
+ {buildAvatar(user, "sm", true, "user-icon")}
14
+ <i component="user/status" class="fa fa-fw fa-circle status {user.status}"></i>
15
+ </a>
16
+ </li>
17
+ </ul>
18
+
19
+ <div class="tab-content">
20
+ <div class="tab-pane fade active in" id="profile">
21
+ <section class="menu-section" data-section="profile">
22
+ <ul class="menu-section-list" component="header/usercontrol"></ul>
23
+ </section>
24
+ </div>
25
+ <div class="tab-pane fade" id="notifications">
26
+ <section class="menu-section" data-section="notifications">
27
+ <ul class="menu-section-list notification-list-mobile" component="notifications/list"></ul>
28
+ <p class="menu-section-list"><a href="{relative_path}/notifications">[[notifications:see_all]]</a></p>
29
+ </section>
30
+ </div>
31
+ {{{ if !config.disableChat }}}
32
+ <div class="tab-pane fade" id="chats">
33
+ <section class="menu-section" data-section="chats">
34
+ <ul class="menu-section-list chat-list" component="chat/list">
35
+ <a class="navigation-link" href="{relative_path}/user/{user.userslug}/chats">[[modules:chat.see_all]]</a>
36
+ </ul>
37
+ </section>
38
+ </div>
39
+ {{{ end }}}
40
+ </div>
41
+ {{{ end }}}
@@ -1,12 +1,25 @@
1
1
  <div class="navbar-header">
2
2
  <button type="button" class="navbar-toggle pull-left" id="mobile-menu">
3
- <span component="notifications/icon" class="notification-icon fa fa-fw fa-bell-o unread-count" data-content="{unreadCount.notification}"></span>
4
3
  <i class="fa fa-lg fa-fw fa-bars"></i>
5
4
  </button>
6
- <button type="button" class="navbar-toggle hidden" id="mobile-chats">
5
+ {{{ if config.loggedIn }}}
6
+ <button type="button" class="navbar-toggle" id="mobile-chats">
7
+ <span component="notifications/icon" class="notification-icon fa fa-fw fa-bell-o unread-count" data-content="{unreadCount.notification}"></span>
7
8
  <span component="chat/icon" class="notification-icon fa fa-fw fa-comments unread-count" data-content="{unreadCount.chat}"></span>
8
- <i class="fa fa-lg fa-comment-o"></i>
9
+ {buildAvatar(user, "md", true)}
9
10
  </button>
11
+ {{{ end }}}
12
+
13
+ {{{ if config.searchEnabled }}}
14
+ <div class="navbar-search visible-xs pull-right">
15
+ <form action="{config.relative_path}/search" method="GET">
16
+ <button type="button" class="btn btn-link"><i class="fa fa-search fa-fw" title="[[global:header.search]]"></i></button>
17
+ <input autocomplete="off" type="text" class="form-control hidden" name="term" placeholder="[[global:search]]"/>
18
+ <button class="btn btn-primary hidden" type="submit"></button>
19
+ <input type="text" class="hidden" name="in" value="{config.searchDefaultInQuick}" />
20
+ </form>
21
+ </div>
22
+ {{{ end }}}
10
23
 
11
24
  <!-- IF brand:logo -->
12
25
  <a href="<!-- IF brand:logo:url -->{brand:logo:url}<!-- ELSE -->{relative_path}/<!-- ENDIF brand:logo:url -->">
@@ -1,27 +1,5 @@
1
- <div class="menu-profile">
2
- <!-- IF user.uid -->
3
- {buildAvatar(user, "lg", true, "user-icon")}
4
- <i component="user/status" class="fa fa-fw fa-circle status {user.status}"></i>
5
- <!-- ENDIF user.uid -->
6
- </div>
7
-
8
1
  <section class="menu-section" data-section="navigation">
9
2
  <h3 class="menu-section-title">[[global:header.navigation]]</h3>
10
3
  <ul class="menu-section-list"></ul>
11
4
  </section>
12
5
 
13
- <!-- IF config.loggedIn -->
14
- <section class="menu-section" data-section="profile">
15
- <h3 class="menu-section-title">[[global:header.profile]]</h3>
16
- <ul class="menu-section-list" component="header/usercontrol"></ul>
17
- </section>
18
-
19
- <section class="menu-section" data-section="notifications">
20
- <h3 class="menu-section-title">
21
- [[global:header.notifications]]
22
- <span class="counter unread-count" component="notifications/icon" data-content="{unreadCount.notification}"></span>
23
- </h3>
24
- <ul class="menu-section-list notification-list-mobile" component="notifications/list"></ul>
25
- <p class="menu-section-list"><a href="{relative_path}/notifications">[[notifications:see_all]]</a></p>
26
- </section>
27
- <!-- ENDIF config.loggedIn -->