61 Commits (72b03d8deaf5d931586e1d62a7e40a185031992d)

Author SHA1 Message Date
Barış Soner Uşaklı d20b07cfea
Webpack5 (#10311)
* feat: webpack 5 part 1

* fix: gruntfile fixes

* fix: fix taskbar warning

add app.importScript
copy public/src/modules to build folder

* refactor: remove commented old code

* feat: reenable admin

* fix: acp settings pages, fix sortable on manage categories

embedded require in html not allowed

* fix: bundle serialize/deserizeli so plugins dont break

* test: fixe util tests

* test: fix require path

* test: more test fixes

* test: require correct utils module

* test: require correct utils

* test: log stack

* test: fix db require blowing up tests

* test: move and disable bundle test

* refactor: add aliases

* test: disable testing route

* fix: move webpack modules necessary for build, into `dependencies`

* test: fix one more test

remove 500-embed.tpl

* fix: restore use of assets/nodebb.min.js, at least for now

* fix: remove unnecessary line break

* fix: point to proper ACP bundle

* test: maybe fix build test

* test: composer

* refactor: dont need dist

* refactor: more cleanup

use everything from build/public folder

* get rid of conditional import in app.js

* fix: ace

* refactor: cropper alias

* test: lint and test fixes

* lint: fix

* refactor: rename function to app.require

* refactor: go back to using app.require

* chore: use github branch

* chore: use webpack branch

* feat: webpack webinstaller

* feat: add chunkFile name with contenthash

* refactor: move hooks to top

* refactor: get rid of template500Function

* fix(deps): use webpack5 branch of 2factor plugin

* chore: tagging v2.0.0-beta.0 pre-release version 💥 :shipit: 🎉 🚀

* refactor: disable cache on templates

loadTemplate is called once by benchpress and the result is cache internally

* refactor: add server side helpers.js

* feat: deprecate /plugins shorthand route, closes #10343

* refactor: use build/public for webpack

* test: fix filename

* fix: more specific selector

* lint: ignore

* refactor: fix comments

* test: add debug for random failing test

* refactor: cleanup

remove test page, remove dupe functions in utils.common

* lint: use relative path  for now

* chore: bump prerelease version

* feat: add translateKeys

* fix: optional params

* fix: get rid of extra timeago files

* refactor: cleanup, require timeago locale earlier

remove translator.prepareDOM, it is in header.tpl html tag

* refactor: privileges system to use a Map in the backend instead of separate objects for keys and labels (#10378)

* refactor: privileges system to use a Map in the backend instead of separate objects for keys and labels

- Existing hooks are preserved (to be deprecated at a later date, possibly)
- New init hooks are called on NodeBB start, and provide a one-stop shop to add new privileges, instead of having to add to four different hooks

* docs: fix typo in comment

* test: spec changes

* refactor: privileges system to use a Map in the backend instead of separate objects for keys and labels (#10378)

* refactor: privileges system to use a Map in the backend instead of separate objects for keys and labels

- Existing hooks are preserved (to be deprecated at a later date, possibly)
- New init hooks are called on NodeBB start, and provide a one-stop shop to add new privileges, instead of having to add to four different hooks

* docs: fix typo in comment

* test: spec changes

* feat: allow app.require('bootbox'/'benchpressjs')

* refactor: require server side utils

* test: jquery ready

* change istaller to use build/public

* test: use document.addEventListener

* refactor: closes #10301

* refactor: generateTopicClass

* fix: column counts for other privileges

* fix: #10443, regression where sorted-list items did not render into the DOM in the predicted order [breaking]

* fix: typo in hook name

* refactor: introduce a generic autocomplete.init() method that can be called to add nodebb-style autocompletion but using different data sources (e.g. not user/groups/tags)

* fix: crash if `delay` not passed in (as it cannot be destructured)

* refactor: replace substr

* feat: set --panel-offset style in html element based on stored value in localStorage

* refactor: addDropupHandler() logic to be less naive

- Take into account height of the menu
- Don't apply dropUp logic if there's nothing in the dropdown
- Remove 'hidden' class (added by default in Persona for post tools) when menu items are added

closes #10423

* refactor: simplify utils.params [breaking]

Retrospective analysis of the usage of this method suggests that the options passed in are superfluous, and that only `url` is required. Using a browser built-in makes more sense to accomplish what this method sets out to do.

* feat: add support for returning full URLSearchParams for utils.params

* fix: utils.params() fallback handling

* fix: default empty obj for params()

* fix: remove \'loggedin\' and \'register\' qs parameters once they have been used, delay invocation of messages until ajaxify.end

* fix: utils.params() not allowing relative paths to be passed in

* refactor(DRY): new assertPasswordValidity utils method

* fix: incorrect error message returned on insufficient privilege on flag edit

* fix: read/update/delete access to flags API should be limited for moderators to only post flags in categories they moderate

- added failing tests and patched up middleware.assert.flags to fix

* refactor: flag api v3 tests to create new post and flags on every round

* fix: missing error:no-flag language key

* refactor: flags.canView to check flag existence, simplify middleware.assert.flag

* feat: flag deletion API endpoint, #10426

* feat: UI for flag deletion, closes #10426

* chore: update plugin versions

* chore: up emoji

* chore: update markdown

* chore: up emoji-android

* fix: regression caused by utils.params() refactor, supports arrays and pipes all values through utils.toType, adjusts tests to type check

Co-authored-by: Julian Lam <[email protected]>
3 years ago
Barış Soner Uşaklı 1980feed46 refactor: use alerts module 3 years ago
Barış Soner Uşaklı 8b4510cc70 refactor: deprecate app.logout
use logout module instead
move header related code out of app.js
3 years ago
Barış Soner Uşaklı 619034484f refactor: simpler rejoin
remove pointless app.cacheBuster = null
3 years ago
Barış Soner Uşaklı 666fe209f0 refactor: move session messages 3 years ago
gasoved b0a24d6dd5
refactor: var to const and let (#9885)
* refactor: var to const and let

* fix: missed global bootbox usage

* refactor: align with eslint expectations
3 years ago
gasoved 227456fb17
fix: no global bootbox (#9879)
* fix: require bootbox (easy ones)

* fix: require bootbox (ugly ones)

* fix(eslint): a lengthy line
3 years ago
Barış Soner Uşaklı 7a2f0ae15b fix: show local time for ban 3 years ago
Barış Soner Uşaklı 77c3085a7b fix: #9727, addHandlers after hooks 3 years ago
Anton Grigoryev 342503e07a
Feat: Client-side hooks - replace window.trigger (#9679)
* feat/clientside-hooks: replace window.trigger with hooks.fire

* feat(clientside-hooks): Move hooks require to the top

* fix: simplifying complex logical expression

* fix: client-side hook for translator - post-review fixes
4 years ago
Julian Lam 8cc61f1197 feat: automatically attempt reconnection on window focus 4 years ago
Julian Lam ec6d1e2321
fix: #9507 session reroll causes socket.io to become confused (#9534)
* fix: #9507 session reroll causes socket.io to become confused

* fix: added return

* fix: simpler logic for error handling

* fix: overly sensitive catch
4 years ago
Barış Soner Uşaklı c5ae8a70e1 fix: #9463 4 years ago
Barış Soner Uşaklı cb53a64cde fix: acp crash 4 years ago
Julian Lam d9e2029074 fix: hooks for alert animate, no more fadein/fadeout for reconnect alert 4 years ago
Barış Soner Uşaklı 7ae7626c1b Revert "feat: add logout to invalid session"
This reverts commit beb1427387.
4 years ago
Barış Soner Uşaklı beb1427387 feat: add logout to invalid session 4 years ago
gasoved 53e0d4d2e0 feat: banned-users group 4 years ago
Julian Lam e5edbc6faf feat: automatically attempt socket.io reconnection on ajaxify
Also, updated messaging and toaster to accurately reflect offline-mode state
4 years ago
Barış Soner Uşaklı c1ecfd1ebf feat: #9135, don't try to reconnect forever 4 years ago
Barış Soner Uşaklı b369dc888b fix: #9129, event is fired on socket.io 4 years ago
Barış Soner Uşaklı 13d5a1440b fix: reconnectin no longer fires on socket.io 3 4 years ago
Barış Soner Uşaklı 5080f35752 fix: #8991, logout on password reset, dont verify email if password expired
dont allow same password on reset
4 years ago
Barış Soner Uşaklı 5c3deb4b0e fix: #8973, fix timestamp on ban modal 4 years ago
Barış Soner Uşaklı 46acbfdaf1 fix: show messages after app load 4 years ago
Julian Lam 58043e07ba fix: use POST call for user creation in ACP
- Not entirely sure about error handling yet, more research needed
- Also added socket method deprecation utility method
4 years ago
Barış Soner Uşaklı 5002e0f62c feat: refactor app.js 4 years ago
Barış Soner Uşaklı fddeb5c0f8 feat: remove app.isConnected, use socket.connected 4 years ago
Julian Lam 922d49be0b fix(style): switch..case 5 years ago
Barış Soner Uşaklı 4083a6e39b feat: add awaitable socket.emit 5 years ago
Julian Lam 289dada5f7 fix(deps): update to eslint@6 6 years ago
Barış Soner Uşaklı e59b907d7c fix: #7229 6 years ago
Baris Usakli 69e0dbbf4a fix: #7091, #7093 6 years ago
Peter Jaszkowiak ba619c7ec8 style(eslint): match operator-linebreak preferences 6 years ago
Peter Jaszkowiak 89c025d102 feat: close #7002, console message if mismatched origins 6 years ago
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
6 years ago
Barış Soner Uşaklı 245e1a9159 closes #6334 7 years ago
Julian Lam a4a961639d only triggering forum updated messaging if hostname matches, fixes #6333 7 years ago
Julian Lam 73d4517d27 Revert "fixes #5894"
This reverts commit e2b40ddf34.
8 years ago
Julian Lam 9d2bf4746c Revert "fix reload loop for guests"
This reverts commit a67a0b0a08.
8 years ago
Julian Lam a67a0b0a08 fix reload loop for guests 8 years ago
Julian Lam e2b40ddf34 fixes #5894 8 years ago
psychobunny b3bd70235a refactor ban messaging; add ban duration to message; use bootbox instead of alert 8 years ago
Peter Jaszkowiak b227297ef3 ESlint no-use-before-define 8 years ago
Peter Jaszkowiak 1493afee2a ESlint indent 8 years ago
Peter Jaszkowiak 3b0dd2d1ef ESlint padded-blocks 8 years ago
Peter Jaszkowiak feb8405f95 ESlint eol-last 8 years ago
Peter Jaszkowiak 604358ecc4 ESlint keyword-spacing, no-multi-spaces 8 years ago
Peter Jaszkowiak b09b3aef7f ESlint no-undef, remove global comments 8 years ago
Peter Jaszkowiak bc1d70c126 ESlint comma-dangle 8 years ago