Skip to content

Commit 90c617d

Browse files
author
sivin
committed
Added support for 'Pro' version fontawesome
1 parent 3f2809f commit 90c617d

File tree

5 files changed

+26
-9
lines changed

5 files changed

+26
-9
lines changed
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
.tox .fa,
2+
.tox .fas {
3+
font-family: 'Font Awesome 5 Free';
4+
font-weight: 900;
5+
}
6+
.tox .far {
7+
font-family: 'Font Awesome 5 Free';
8+
font-weight: 400;
9+
}
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
.tox .fa,
2+
.tox .fas {
3+
font-family: 'Font Awesome 5 Pro';
4+
font-weight: 900;
5+
}
6+
.tox .far {
7+
font-family: 'Font Awesome 5 Pro';
8+
font-weight: 400;
9+
}

fontawesomepicker/asset/style.css

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -93,13 +93,4 @@
9393
.tox .fab {
9494
font-family: 'Font Awesome 5 Brands';
9595
font-weight: 400;
96-
}
97-
.tox .fa,
98-
.tox .fas {
99-
font-family: 'Font Awesome 5 Free';
100-
font-weight: 900;
101-
}
102-
.tox .far {
103-
font-family: 'Font Awesome 5 Free';
104-
font-weight: 400;
10596
}

fontawesomepicker/plugin.js

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -85,8 +85,15 @@
8585

8686
function initAsset(editor, pluginUrl) {
8787
var fontawesomeUrl = editor.getParam('fontawesomeUrl')
88+
var fontawesomePro = editor.getParam('fontawesomePro')
8889
utils.loadStyle(document, fontawesomeUrl)
8990
utils.loadStyle(document, pluginUrl + '/asset/style.css')
91+
if (fontawesomePro === undefined || fontawesomePro === false) {
92+
utils.loadStyle(document, pluginUrl + '/asset/style-free.css')
93+
}
94+
else {
95+
utils.loadStyle(document, pluginUrl + '/asset/style-pro.css')
96+
}
9097
utils.loadStyle(editor.contentDocument, fontawesomeUrl)
9198

9299
if ( !categories.all ) {

readme.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ A plugin for `tinymce v5` that selects the `fontawesome` icon.
2222
plugins: 'fontawesomepicker',
2323
toolbar: 'fontawesomepicker',
2424
fontawesomeUrl: 'https://www.unpkg.com/@fortawesome/fontawesome-free@5.14.0/css/all.min.css',
25+
fontawesomePro: true, //default: false, enable or disable Pro vs Free font
2526
external_plugins: {
2627
// url
2728
fontawesomepicker: 'https://www.unpkg.com/tinymce-fontawesomepicker/fontawesomepicker/plugin.min.js'

0 commit comments

Comments
 (0)