-
-
Notifications
You must be signed in to change notification settings - Fork 837
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* feat: first iteration * chore: tweak * feat: second iteration * chore: incorrect code organization * feat: gambit input suggestions * feat: gambit keyboard navigation * chore: bugs * feat: negative gambits * feat: improve gambit highlighting * refactor: localize gambits * feat: negative and positive gambit buttons * fix: permissions * chore: wat * per: lazy load search modal * fix: extensibility and bug fixes * fix: bugs * feat: reusable autocomplete dropdown * chore: format * fix: tag filter
- Loading branch information
Showing
79 changed files
with
2,150 additions
and
746 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
21 changes: 5 additions & 16 deletions
21
extensions/lock/js/src/common/query/discussions/LockedGambit.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,23 +1,12 @@ | ||
import IGambit from 'flarum/common/query/IGambit'; | ||
import { BooleanGambit } from 'flarum/common/query/IGambit'; | ||
import app from 'flarum/common/app'; | ||
|
||
export default class LockedGambit implements IGambit { | ||
pattern(): string { | ||
return 'is:locked'; | ||
} | ||
|
||
toFilter(_matches: string[], negate: boolean): Record<string, any> { | ||
const key = (negate ? '-' : '') + 'locked'; | ||
|
||
return { | ||
[key]: true, | ||
}; | ||
export default class LockedGambit extends BooleanGambit { | ||
key(): string { | ||
return app.translator.trans('flarum-lock.lib.gambits.discussions.locked.key', {}, true); | ||
} | ||
|
||
filterKey(): string { | ||
return 'locked'; | ||
} | ||
|
||
fromFilter(value: string, negate: boolean): string { | ||
return `${negate ? '-' : ''}is:locked`; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
21 changes: 5 additions & 16 deletions
21
extensions/sticky/js/src/common/query/discussions/StickyGambit.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,23 +1,12 @@ | ||
import IGambit from 'flarum/common/query/IGambit'; | ||
import { BooleanGambit } from 'flarum/common/query/IGambit'; | ||
import app from 'flarum/common/app'; | ||
|
||
export default class StickyGambit implements IGambit { | ||
pattern(): string { | ||
return 'is:sticky'; | ||
} | ||
|
||
toFilter(_matches: string[], negate: boolean): Record<string, any> { | ||
const key = (negate ? '-' : '') + 'sticky'; | ||
|
||
return { | ||
[key]: true, | ||
}; | ||
export default class StickyGambit extends BooleanGambit { | ||
key(): string { | ||
return app.translator.trans('flarum-sticky.lib.gambits.discussions.sticky.key', {}, true); | ||
} | ||
|
||
filterKey(): string { | ||
return 'sticky'; | ||
} | ||
|
||
fromFilter(value: string, negate: boolean): string { | ||
return `${negate ? '-' : ''}is:sticky`; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
import 'flarum/common/models/User'; | ||
|
||
declare module 'flarum/common/models/User' { | ||
export default interface User { | ||
canSuspend: () => boolean; | ||
} | ||
} |
Oops, something went wrong.