-
-
Notifications
You must be signed in to change notification settings - Fork 835
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
# Conflicts: # framework/core/less/common/root.less
- Loading branch information
Showing
75 changed files
with
1,722 additions
and
897 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
import Extend from 'flarum/common/extenders'; | ||
import app from 'flarum/admin/app'; | ||
|
||
export default [ | ||
new Extend.Admin() | ||
.setting(() => ({ | ||
setting: 'flarum-akismet.api_key', | ||
type: 'text', | ||
label: app.translator.trans('flarum-akismet.admin.akismet_settings.api_key_label'), | ||
})) | ||
.setting(() => ({ | ||
// https://blog.akismet.com/2014/04/23/theres-a-ninja-in-your-akismet/ | ||
setting: 'flarum-akismet.delete_blatant_spam', | ||
type: 'boolean', | ||
label: app.translator.trans('flarum-akismet.admin.akismet_settings.delete_blatant_spam_label'), | ||
help: app.translator.trans('flarum-akismet.admin.akismet_settings.delete_blatant_spam_help'), | ||
})) | ||
.permission( | ||
() => ({ | ||
icon: 'fas fa-vote-yea', | ||
label: app.translator.trans('flarum-akismet.admin.permissions.bypass_akismet'), | ||
permission: 'bypassAkismet', | ||
}), | ||
'start' | ||
), | ||
]; |
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,26 +1,7 @@ | ||
import app from 'flarum/admin/app'; | ||
|
||
export { default as extend } from './extend'; | ||
|
||
app.initializers.add('flarum-akismet', () => { | ||
app.extensionData | ||
.for('flarum-akismet') | ||
.registerSetting({ | ||
setting: 'flarum-akismet.api_key', | ||
type: 'text', | ||
label: app.translator.trans('flarum-akismet.admin.akismet_settings.api_key_label'), | ||
}) | ||
.registerSetting({ | ||
//https://blog.akismet.com/2014/04/23/theres-a-ninja-in-your-akismet/ | ||
setting: 'flarum-akismet.delete_blatant_spam', | ||
type: 'boolean', | ||
label: app.translator.trans('flarum-akismet.admin.akismet_settings.delete_blatant_spam_label'), | ||
help: app.translator.trans('flarum-akismet.admin.akismet_settings.delete_blatant_spam_help'), | ||
}) | ||
.registerPermission( | ||
{ | ||
icon: 'fas fa-vote-yea', | ||
label: app.translator.trans('flarum-akismet.admin.permissions.bypass_akismet'), | ||
permission: 'bypassAkismet', | ||
}, | ||
'start' | ||
); | ||
// ... | ||
}); |
File renamed without changes.
File renamed without changes.
38 changes: 14 additions & 24 deletions
38
extensions/approval/js/src/admin/index.js → extensions/approval/js/src/admin/extend.tsx
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,43 +1,33 @@ | ||
import { extend } from 'flarum/common/extend'; | ||
import Extend from 'flarum/common/extenders'; | ||
import app from 'flarum/admin/app'; | ||
|
||
app.initializers.add('flarum-approval', () => { | ||
extend(app, 'getRequiredPermissions', function (required, permission) { | ||
if (permission === 'discussion.startWithoutApproval') { | ||
required.push('startDiscussion'); | ||
} | ||
if (permission === 'discussion.replyWithoutApproval') { | ||
required.push('discussion.reply'); | ||
} | ||
}); | ||
|
||
app.extensionData | ||
.for('flarum-approval') | ||
.registerPermission( | ||
{ | ||
export default [ | ||
new Extend.Admin() | ||
.permission( | ||
() => ({ | ||
icon: 'fas fa-check', | ||
label: app.translator.trans('flarum-approval.admin.permissions.start_discussions_without_approval_label'), | ||
permission: 'discussion.startWithoutApproval', | ||
}, | ||
}), | ||
'start', | ||
95 | ||
) | ||
.registerPermission( | ||
{ | ||
.permission( | ||
() => ({ | ||
icon: 'fas fa-check', | ||
label: app.translator.trans('flarum-approval.admin.permissions.reply_without_approval_label'), | ||
permission: 'discussion.replyWithoutApproval', | ||
}, | ||
}), | ||
'reply', | ||
95 | ||
) | ||
.registerPermission( | ||
{ | ||
.permission( | ||
() => ({ | ||
icon: 'fas fa-check', | ||
label: app.translator.trans('flarum-approval.admin.permissions.approve_posts_label'), | ||
permission: 'discussion.approvePosts', | ||
}, | ||
}), | ||
'moderate', | ||
65 | ||
); | ||
}); | ||
), | ||
]; |
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,15 @@ | ||
import { extend } from 'flarum/common/extend'; | ||
import app from 'flarum/admin/app'; | ||
|
||
export { default as extend } from './extend'; | ||
|
||
app.initializers.add('flarum-approval', () => { | ||
extend(app, 'getRequiredPermissions', function (required, permission) { | ||
if (permission === 'discussion.startWithoutApproval') { | ||
required.push('startDiscussion'); | ||
} | ||
if (permission === 'discussion.replyWithoutApproval') { | ||
required.push('discussion.reply'); | ||
} | ||
}); | ||
}); |
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,15 @@ | ||
{ | ||
// Use Flarum's tsconfig as a starting point | ||
"extends": "flarum-tsconfig", | ||
// This will match all .ts, .tsx, .d.ts, .js, .jsx files in your `src` folder | ||
// and also tells your Typescript server to read core's global typings for | ||
// access to `dayjs` and `$` in the global namespace. | ||
"include": ["src/**/*", "../../../*/*/js/dist-typings/@types/**/*", "@types/**/*"], | ||
"compilerOptions": { | ||
// This will output typings to `dist-typings` | ||
"declarationDir": "./dist-typings", | ||
"paths": { | ||
"flarum/*": ["../../../framework/core/js/dist-typings/*"] | ||
} | ||
} | ||
} |
9 changes: 5 additions & 4 deletions
9
extensions/emoji/js/src/admin/index.js → extensions/emoji/js/src/admin/extend.tsx
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,13 +1,14 @@ | ||
import Extend from 'flarum/common/extenders'; | ||
import app from 'flarum/admin/app'; | ||
import { version } from '../common/cdn'; | ||
|
||
app.initializers.add('flarum-emoji', () => { | ||
app.extensionData.for('flarum-emoji').registerSetting({ | ||
export default [ | ||
new Extend.Admin().setting(() => ({ | ||
setting: 'flarum-emoji.cdn', | ||
type: 'text', | ||
label: app.translator.trans('flarum-emoji.admin.settings.cdn_label'), | ||
help: app.translator.trans('flarum-emoji.admin.settings.cdn_help', { | ||
version: version, | ||
}), | ||
}); | ||
}); | ||
})), | ||
]; |
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 app from 'flarum/admin/app'; | ||
|
||
export { default as extend } from './extend'; | ||
|
||
app.initializers.add('flarum-emoji', () => { | ||
// ... | ||
}); |
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,15 @@ | ||
{ | ||
// Use Flarum's tsconfig as a starting point | ||
"extends": "flarum-tsconfig", | ||
// This will match all .ts, .tsx, .d.ts, .js, .jsx files in your `src` folder | ||
// and also tells your Typescript server to read core's global typings for | ||
// access to `dayjs` and `$` in the global namespace. | ||
"include": ["src/**/*", "../../../*/*/js/dist-typings/@types/**/*", "@types/**/*"], | ||
"compilerOptions": { | ||
// This will output typings to `dist-typings` | ||
"declarationDir": "./dist-typings", | ||
"paths": { | ||
"flarum/*": ["../../../framework/core/js/dist-typings/*"] | ||
} | ||
} | ||
} |
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,37 @@ | ||
import Extend from 'flarum/common/extenders'; | ||
import app from 'flarum/admin/app'; | ||
|
||
export default [ | ||
new Extend.Admin() | ||
.setting( | ||
() => ({ | ||
setting: 'flarum-flags.guidelines_url', | ||
type: 'text', | ||
label: app.translator.trans('flarum-flags.admin.settings.guidelines_url_label'), | ||
}), | ||
15 | ||
) | ||
.setting(() => ({ | ||
setting: 'flarum-flags.can_flag_own', | ||
type: 'boolean', | ||
label: app.translator.trans('flarum-flags.admin.settings.flag_own_posts_label'), | ||
})) | ||
.permission( | ||
() => ({ | ||
icon: 'fas fa-flag', | ||
label: app.translator.trans('flarum-flags.admin.permissions.view_flags_label'), | ||
permission: 'discussion.viewFlags', | ||
}), | ||
'moderate', | ||
65 | ||
) | ||
.permission( | ||
() => ({ | ||
icon: 'fas fa-flag', | ||
label: app.translator.trans('flarum-flags.admin.permissions.flag_posts_label'), | ||
permission: 'discussion.flagPosts', | ||
}), | ||
'reply', | ||
65 | ||
), | ||
]; |
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,38 +1,7 @@ | ||
import app from 'flarum/admin/app'; | ||
|
||
app.initializers.add('flarum-flags', () => { | ||
app.extensionData | ||
.for('flarum-flags') | ||
.registerSetting( | ||
{ | ||
setting: 'flarum-flags.guidelines_url', | ||
type: 'text', | ||
label: app.translator.trans('flarum-flags.admin.settings.guidelines_url_label'), | ||
}, | ||
15 | ||
) | ||
.registerSetting({ | ||
setting: 'flarum-flags.can_flag_own', | ||
type: 'boolean', | ||
label: app.translator.trans('flarum-flags.admin.settings.flag_own_posts_label'), | ||
}) | ||
.registerPermission( | ||
{ | ||
icon: 'fas fa-flag', | ||
label: app.translator.trans('flarum-flags.admin.permissions.view_flags_label'), | ||
permission: 'discussion.viewFlags', | ||
}, | ||
'moderate', | ||
65 | ||
) | ||
export { default as extend } from './extend'; | ||
|
||
.registerPermission( | ||
{ | ||
icon: 'fas fa-flag', | ||
label: app.translator.trans('flarum-flags.admin.permissions.flag_posts_label'), | ||
permission: 'discussion.flagPosts', | ||
}, | ||
'reply', | ||
65 | ||
); | ||
app.initializers.add('flarum-flags', () => { | ||
// ... | ||
}); |
21 changes: 12 additions & 9 deletions
21
extensions/likes/js/src/admin/index.js → extensions/likes/js/src/admin/extend.tsx
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,20 +1,23 @@ | ||
import Extend from 'flarum/common/extenders'; | ||
import app from 'flarum/admin/app'; | ||
import commonExtend from '../common/extend'; | ||
|
||
app.initializers.add('flarum-likes', () => { | ||
app.extensionData | ||
.for('flarum-likes') | ||
.registerPermission( | ||
{ | ||
export default [ | ||
...commonExtend, | ||
|
||
new Extend.Admin() | ||
.permission( | ||
() => ({ | ||
icon: 'far fa-thumbs-up', | ||
label: app.translator.trans('flarum-likes.admin.permissions.like_posts_label'), | ||
permission: 'discussion.likePosts', | ||
}, | ||
}), | ||
'reply' | ||
) | ||
.registerSetting({ | ||
.setting(() => ({ | ||
setting: 'flarum-likes.like_own_post', | ||
type: 'bool', | ||
label: app.translator.trans('flarum-likes.admin.settings.like_own_posts_label'), | ||
help: app.translator.trans('flarum-likes.admin.settings.like_own_posts_help'), | ||
}); | ||
}); | ||
})), | ||
]; |
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 app from 'flarum/admin/app'; | ||
|
||
export { default as extend } from './extend'; | ||
|
||
app.initializers.add('flarum-likes', () => { | ||
// ... | ||
}); |
This file was deleted.
Oops, something went wrong.
16 changes: 9 additions & 7 deletions
16
extensions/lock/js/src/admin/index.js → extensions/lock/js/src/admin/extend.tsx
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,15 +1,17 @@ | ||
import Extend from 'flarum/common/extenders'; | ||
import app from 'flarum/admin/app'; | ||
import commonExtend from '../common/extend'; | ||
|
||
export { default as extend } from './extend'; | ||
export default [ | ||
...commonExtend, | ||
|
||
app.initializers.add('flarum-lock', () => { | ||
app.extensionData.for('flarum-lock').registerPermission( | ||
{ | ||
new Extend.Admin().permission( | ||
() => ({ | ||
icon: 'fas fa-lock', | ||
label: app.translator.trans('flarum-lock.admin.permissions.lock_discussions_label'), | ||
permission: 'discussion.lock', | ||
}, | ||
}), | ||
'moderate', | ||
95 | ||
); | ||
}); | ||
), | ||
]; |
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 app from 'flarum/admin/app'; | ||
|
||
export { default as extend } from './extend'; | ||
|
||
app.initializers.add('flarum-lock', () => { | ||
// ... | ||
}); |
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,3 +1,23 @@ | ||
import Extend from 'flarum/common/extenders'; | ||
import app from 'flarum/admin/app'; | ||
import commonExtend from '../common/extend'; | ||
|
||
export default [...commonExtend]; | ||
export default [ | ||
...commonExtend, | ||
|
||
new Extend.Admin() | ||
.setting(() => ({ | ||
setting: 'flarum-mentions.allow_username_format', | ||
type: 'boolean', | ||
label: app.translator.trans('flarum-mentions.admin.settings.allow_username_format_label'), | ||
help: app.translator.trans('flarum-mentions.admin.settings.allow_username_format_text'), | ||
})) | ||
.permission( | ||
() => ({ | ||
permission: 'mentionGroups', | ||
label: app.translator.trans('flarum-mentions.admin.permissions.mention_groups_label'), | ||
icon: 'fas fa-at', | ||
}), | ||
'start' | ||
), | ||
]; |
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.