Commit Graph

112 Commits

Author SHA1 Message Date
Julian Lam
03a0e72fae refactor: split out logic dedicated to calculating unread counts, to a separate local method 2021-01-08 14:15:54 -05:00
Julian Lam
6e2da9966e refactor: move plugin hook methods to plugin.hooks.* 2020-11-20 16:32:39 -05:00
Barış Soner Uşaklı
120999bf63 feat: #7550, show message if post is queued when js is disabled 2020-11-17 14:47:06 -05:00
Barış Soner Uşaklı
4b63f9937c fix: check is banned in buildHeader
remove unused banReason
remove generateHeader function
2020-11-04 13:23:10 -05:00
Barış Soner Uşaklı
a05905f196 performance improvements (#8795)
* perf: nconf/winston/render

cache nconf.get calls
modify middleware.pageView to call next earlier
don't call winston.verbose on every hook see https://github.com/winstonjs/winston/issues/1669
translate header/footer separately and cache results for guests

* fix: copy paste fail

* refactor: style and fire hook only log in dev mode

* fix: cache key, header changes based on template

* perf: change replace

* fix: add missing await

* perf: category

* perf: lodash clone

* perf: remove escapeRegexChars
2020-10-26 10:43:18 -04:00
Barış Soner Uşaklı
fda2aedfd8 feat: #8734, jquery-ui, jquery-form, timeago (#8748)
* feat: #8734, jquery-ui, jquery-form, timeago

get rid of forum/footer.js move that code to app.js & wait for app to load before calling ajaxify.end
make sockets.js a requirejs module
move jquery-ui to node_modules and load via requirejs
move jquery-form to node_modules and load via requirejs
move timeago to node_modules and load via requirejs
only include the css for needed jquery-ui widgets

* feat: keep socket/io global for backwards compat

* refactor: move socket listener to chat
2020-10-10 21:47:27 -04:00
Julian Lam
cf2f1e956a refactor: changed way middleware was exported 2020-08-21 15:29:40 -04:00
Barış Soner Uşaklı
6e91885836 feat: use assetBaseUrl instead of hardcoding 2020-08-11 11:09:46 -04:00
Barış Soner Uşaklı
3f01f4a2b8 Revert "feat: load timeago strings client-side"
This reverts commit 558a2d739c.
2020-08-11 11:06:46 -04:00
Julian Lam
558a2d739c feat: load timeago strings client-side
9adaccd036 introduced the ability to
configure an assetBaseUrl, but the timeago strings were still
calling a hardcoded value as it was handled server-side. There's
no need for the strings to be loaded until timeago is initialised.
2020-08-11 11:00:45 -04:00
Barış Soner Uşaklı
2355d9d5dd fix: escape navigation item fields, theme:id, category fields 2020-06-26 15:19:18 -04:00
Barış Soner Uşaklı
842b8abb84 feat: add buildHeaderAsync (#8367)
* feat: add buildHeaderAsync

make helphers.notAllowed async

* fix: remove csrf from buildHeader

* fix: remove unused method, use middleware

* fix: /post/pid redirect doesn't need buildHeader

use buildHeaderAsync
2020-06-04 01:14:46 -04:00
Barış Soner Uşaklı
dcb85ee7a1 #8344 (#8346)
* feat: wip

* feat: wrap middlewares

* feat: middleware errors

* feat: more middleware changes

* fix: remove unused async

* fix: prevent version errors from blocking acp render

* feat: wrap more middlewares
2020-06-03 20:18:42 -04:00
Julian Lam
023942da7d refactor: making rendering of header and footer async functions
* refactor: make middleware.admin.renderHeader async

* refactor: making rendering of header and footer async functions

* fix: use app.renderAsync instead of promifying it
2020-06-03 19:07:08 -04:00
Barış Soner Uşaklı
5781a2dc65 feat: fix session mismatch errors by clearing cookie on logout (#8338)
* feat: fix session mismatch errors by clearing cookie on logout

* feat: remove app.upateHeader

ported from 2.0

* feat: handle if user doesn't click button and just refreshes page
2020-05-27 12:15:02 -04:00
Barış Soner Uşaklı
2727f472ed feat: add the data from page into filter:middleware.renderHeader 2020-05-26 22:08:54 -04:00
Barış Soner Uşaklı
4eaa630b1c refactor: async/await controllers/api 2019-08-18 19:06:51 -04:00
Julian Lam
29f96b199c fix(style): requiring parens in block bodies 2019-08-13 15:12:27 -04:00
Julian Lam
0921230976 fix(style): updated code to follow new eslint recommendations
Squashed commit of the following:

commit f9ce878b26
Author: Julian Lam <julian@nodebb.org>
Date:   Tue Aug 13 14:30:46 2019 -0400

    fix(style): updated code to follow new eslint recommendations

commit 80dd370e41
Author: Julian Lam <julian@nodebb.org>
Date:   Tue Aug 13 14:14:58 2019 -0400

    fix(deps): update dependency sitemap to v4

    Squashed commit of the following:

    commit f4dd9cabb2
    Author: Julian Lam <julian@nodebb.org>
    Date:   Tue Aug 13 11:33:05 2019 -0400

        fix: resolved breaking changes from sitemap v4 upgrade

    commit 9043415ee1
    Merge: e3352b272 72590b346
    Author: Julian Lam <julian@nodebb.org>
    Date:   Tue Aug 13 11:09:55 2019 -0400

        Merge branch 'master' into renovate/sitemap-4.x

    commit e3352b272e
    Author: Renovate Bot <bot@renovateapp.com>
    Date:   Mon Aug 12 07:59:05 2019 +0000

        fix(deps): update dependency sitemap to v4

commit 8e3c0cdcae
Author: Renovate Bot <bot@renovateapp.com>
Date:   Fri Aug 9 00:49:51 2019 +0000

    fix(deps): update dependency commander to v3

commit 2104449d38
Author: Renovate Bot <bot@renovateapp.com>
Date:   Tue Aug 13 15:00:27 2019 +0000

    fix(deps): update dependency mongodb to v3.3.0

commit d2937f446a
Author: Barış Soner Uşaklı <barisusakli@gmail.com>
Date:   Tue Aug 13 10:36:48 2019 -0400

    feat: async/await admin/controllers

commit 1b97e8b199
Author: Misty (Bot) <deploy@nodebb.org>
Date:   Tue Aug 13 09:28:39 2019 +0000

    Latest translations and fallbacks

commit 69a48957a2
Author: Barış Soner Uşaklı <barisusakli@gmail.com>
Date:   Mon Aug 12 21:56:09 2019 -0400

    feat: async/await

commit b9b2a7e593
Author: Barış Soner Uşaklı <barisusakli@gmail.com>
Date:   Mon Aug 12 20:58:29 2019 -0400

    feat: async/await refactor

    controllers/accounts

commit a8d43a1759
Author: Baris Usakli <barisusakli@gmail.com>
Date:   Mon Aug 12 14:49:40 2019 -0400

    feat: async/await controllers/accounts

commit 2f25aae57b
Author: Barış Soner Uşaklı <barisusakli@gmail.com>
Date:   Sun Aug 11 23:09:50 2019 -0400

    fix: #7831, fix pagination

    convert to async/await

commit c9e83f2374
Author: Barış Soner Uşaklı <barisusakli@gmail.com>
Date:   Sun Aug 11 00:14:35 2019 -0400

    fix: remove empty line

commit 30be91b26c
Author: Barış Soner Uşaklı <barisusakli@gmail.com>
Date:   Sun Aug 11 00:13:41 2019 -0400

    fix: remove useless catchs and empty line

commit 2e4a71c0b6
Author: Renovate Bot <bot@renovateapp.com>
Date:   Sat Aug 10 06:51:50 2019 +0000

    chore(deps): update dependency eslint-config-airbnb-base to v14
2019-08-13 15:12:27 -04:00
Barış Soner Uşaklı
4b843ba16f fix: #7567, allow invite and approval at the same time 2019-06-04 11:10:20 -04:00
Julian Lam
b70e03a7b0 fix: broken test for meta tags on ajaxify 2019-05-16 10:51:22 -04:00
Julian Lam
a41769e61c feat: update meta tags on ajaxify (#7580), fixes #7544
* feat: wip -- refresh meta tags on ajaxify

* feat: wrapped up meta tags update on ajaxify feature

* fix: removed commented-out line

* fix: removed another commented-out line
2019-05-16 09:41:56 -04:00
Aziz Khoury
3fbb6faf28 feat: update unban logic/invocation and refactor User.bans module
* auto unban when User.getUsersFields is called and the user is banned but has expired

* cleanups and removal of expiry_readable

* expiry_readable make an alias for backward compatibility

* User.bans.func vs User.*ban*Func

* console.log cleanups, plus todo message added

* use code util.deprecate

* fix: remove ununsed winston require
2019-04-05 14:14:48 -04:00
Barış Soner Uşaklı
c72da5595a fix: #6806
3 new global privileges
view:users
view:tags
view:groups
2019-02-05 12:08:18 -05:00
Julian Lam
f122fc44d0 fix: #7266 body does not contain skin class
A regression was identified where the skin was not shown in the
body class. This resolves the issue and adds a workaround so that
the fix does not become breaking for custom themes.
2019-01-19 12:03:12 -05:00
Barış Soner Uşaklı
ed5d2d6d15 feat: get rid of disk access 2019-01-18 15:32:34 -05:00
Julian Lam
c831ff0de3 fix: removal of timeago fallback middleware (#7259)
* fix: removal of timeago fallback middleware

Instead of loading English fallback on missing language, we opt
to not send a script tag for a missing language to begin with.

Timeago already loads with English as default, so it will just
continue to use English.

* fix: check userLang against supported language codes

* fix: cleaned up code as per @pitaj

* fix: added comments

* fix: more fixes as per @pitaj

* feat: added addl. test for timeago locales, fixed broken test
2019-01-17 12:25:53 -05:00
Julian Lam
d81e0a5f5b fix: #7146 Better RTL handling on (de-)authentication
- RTL is applied (or unapplied) on login and logout depending on
  user language/guest-detected language.
- config is automatically saved into res.locals.config whenever
  loadConfig is called
- On login/logout, buildHeader is called instead of getting config
- On logout, req.uid is deleted instead of set to 0
2018-12-21 11:49:11 -05:00
Barış Soner Uşaklı
b2a74b4172 fix: remove cache 2018-12-17 17:54:33 -05:00
Barış Soner Uşaklı
0cb9bba4da feat: header 2018-12-17 17:11:35 -05:00
Barış Soner Uşaklı
4650a76036 fix: #7124 2018-12-16 00:09:13 -05:00
Barış Soner Uşaklı
9f5062682d fix: unread badge
- only increase unread badge if topic or category is watched
- fix logic for "there are new posts/topics" on /unread and /recent
2018-12-15 16:38:30 -05:00
Barış Soner Uşaklı
99e0895e99 fix: move the check to get methods
all .post methods will have csrf
2018-12-14 23:38:05 -05:00
Barış Soner Uşaklı
9d28b935fd dont load uid 0, -1 from db 2018-11-22 21:57:56 -05:00
Barış Soner Uşaklı
b6771836cf closes #6937 2018-11-10 20:51:07 -05:00
renovate[bot]
64b9dabff8 chore(deps): update dependency eslint-config-airbnb-base to v13 (#6599)
* chore(deps): update dependency eslint-config-airbnb-base to v13

* chore: #6599, linting 😬
2018-11-07 15:53:14 -05:00
Julian Lam
501b3a79ca Refactor skins to be built on server-side (#6849)
* WIP

* using bootswatch from npm instead of bootswatch CDN url

* feat: on-demand client css building for skins

* added ability for client-side to select a skin

* updated loading and saving logic of bootstrapSkin on client side user settings

* fix: broken test for #6849
2018-11-07 13:44:35 -05:00
Julian Lam
84433f29ab Do not require a full refresh on login/logout (#6841)
* no-refresh login as well, plus lots of fixes for missing config on login

* replace config with new set on logout as well

* passing new payload data into new action:app.loggedIn hook, and old action:app.loggedOut hook

* fixed issues with socket.io not properly representing uid on server

* some light refactoring and cleanup

* minor cleanup, fixed spa logout not working after login

* have reconnection handler for socket.io wait 2s to confirm disconnection before reporting -- stops flicker if reconnecting immediately

* Dynamically replace chat and slideout menu on updateHeader()

... instead of just the menu items.

* more efficient calls to Benchpress and translator /cc @pitaj

* fix: chats and notification handlers not working after login

* fix: accidentally calling cb multiple times
2018-11-07 12:34:12 -05:00
Barış Soner Uşaklı
f3a679e268 remove parseInts 2018-10-25 17:02:59 -04:00
Barış Soner Uşaklı
9c022afae1 Parse int (#6853)
* Store config fields as JSON in the db

Fewer parseInts

* Remove unnecessary parseInts

* remove some dupe code add tests

* remove console.log

* remove more parseInts

* WIP: read meta.configs defaults from defaults.json

remove more parseInts

* more work

* add log for failing test

* update admin pwd

* fix tests, dont require posts/cache before configs are initialized

* handle saves

* Test boolean conditions

* remove more parseInts

* Fix boolean values

* remove lots more parseInts

* removed json parsing

* renamed var to number

* categories dont have timestamp
2018-10-21 16:47:51 -04:00
Barış Soner Uşaklı
702be3f6de https://github.com/NodeBB/nodebb-theme-persona/issues/363 2018-10-10 22:46:36 -04:00
Barış Soner Uşaklı
cf75c79611 Unread changes closes #6781 (#6783)
* WIP

* more unread work

* faster teaser block handling

if user doesn't have anyone blocked don't check

* much faster filtering of blocked posts

* add missing uid

* add tidsByFilter to return

* dont load all pids to find previous non-blocked teaser

* fix unread filters

they no longer use unread/new unread/watched etc they are query strings now

* shorter nav item code

* add unreplied to filters

fix icons not clearing to 0
dont increment unread counters if there is a reply in a topic where you ignored the topic creator
2018-09-24 12:58:59 -04:00
Julian Lam
3522ad0e05 Revert "closes #6664"
This reverts commit f27a0d252c.
2018-07-24 16:05:05 -04:00
Julian Lam
f27a0d252c closes #6664 2018-07-24 15:43:54 -04:00
Barış Soner Uşaklı
0070f5c1b2 Merge remote-tracking branch 'refs/remotes/origin/master' into develop 2018-04-05 12:34:38 -04:00
Baris Usakli
52ab0a00d9 use the acp config for homePageTitle 2018-03-12 13:24:16 -04:00
Barış Soner Uşaklı
245e1a9159 closes #6334 2018-02-28 16:32:39 -05:00
Barış Soner Uşaklı
5069892b97 pass correct uid to client side
-1 spider,0 guest, >0 regular user
2018-02-23 15:34:31 -05:00
Julian Lam
1ce448f2a1 Merge remote-tracking branch 'origin/master' into develop 2018-02-16 21:23:25 -05:00
Barış Soner Uşaklı
d16667a5fb closes #6304 2018-02-05 10:04:19 -05:00