Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove all direct references to font-awesome #24448

Merged
merged 2 commits into from
Apr 30, 2023
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions public/img/svg/gitea-empty-checkbox.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
9 changes: 5 additions & 4 deletions web_src/js/features/comp/ComboMarkdownEditor.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ import {handleGlobalEnterQuickSubmit} from './QuickSubmit.js';
import {emojiString} from '../emoji.js';
import {renderPreviewPanelContent} from '../repo-editor.js';
import {matchEmoji, matchMention} from '../../utils/match.js';
import {svg} from '../../svg.js';

let elementIdCounter = 0;

Expand Down Expand Up @@ -218,7 +219,7 @@ class ComboMarkdownEditor {
cm.replaceSelection(`\n- [ ] ${cm.getSelection()}`);
cm.focus();
},
className: 'fa fa-square-o',
icon: svg('gitea-empty-checkbox'),
title: 'Add Checkbox (empty)',
},
'gitea-checkbox-checked': {
Expand All @@ -227,15 +228,15 @@ class ComboMarkdownEditor {
cm.replaceSelection(`\n- [x] ${cm.getSelection()}`);
cm.focus();
},
className: 'fa fa-check-square-o',
icon: svg('octicon-checkbox'),
title: 'Add Checkbox (checked)',
},
'gitea-switch-to-textarea': {
action: () => {
this.userPreferredEditor = 'textarea';
this.switchToTextarea();
},
className: 'fa fa-file',
icon: svg('octicon-file'),
title: 'Revert to simple textarea',
},
'gitea-code-inline': {
Expand All @@ -249,7 +250,7 @@ class ComboMarkdownEditor {
}
cm.focus();
},
className: 'fa fa-angle-right',
icon: svg('octicon-chevron-right'),
title: 'Add Inline Code',
}
};
Expand Down
4 changes: 4 additions & 0 deletions web_src/js/svg.js
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,8 @@ import octiconOrganization from '../../public/img/svg/octicon-organization.svg';
import octiconTag from '../../public/img/svg/octicon-tag.svg';
import octiconGitBranch from '../../public/img/svg/octicon-git-branch.svg';
import octiconRss from '../../public/img/svg/octicon-rss.svg';
import octiconCheckbox from '../../public/img/svg/octicon-checkbox.svg';
import giteaEmptyCheckbox from '../../public/img/svg/gitea-empty-checkbox.svg';

const svgs = {
'octicon-blocked': octiconBlocked,
Expand Down Expand Up @@ -91,6 +93,8 @@ const svgs = {
'octicon-tag': octiconTag,
'octicon-git-branch': octiconGitBranch,
'octicon-rss': octiconRss,
'octicon-checkbox': octiconCheckbox,
'gitea-empty-checkbox': giteaEmptyCheckbox,
yardenshoham marked this conversation as resolved.
Show resolved Hide resolved
};

// TODO: use a more general approach to access SVG icons.
Expand Down
1 change: 1 addition & 0 deletions web_src/svg/gitea-empty-checkbox.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.