-
-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #28 from aschmutt/fontawesome-6pro
Fontawesome 6pro
- Loading branch information
Showing
15 changed files
with
406 additions
and
7 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
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,16 @@ | ||
# Register wordcount plugin for ckeditor | ||
editor: | ||
externalPlugins: | ||
ckeditor_fa: | ||
resource: "EXT:rte_ckeditor_fontawesome/Resources/Public/JavaScript/Plugins/ckeditor_fa6pro/plugin.js?v=11.5.5" | ||
|
||
config: | ||
|
||
coreStyles_italic: | ||
element: 'i' | ||
overrides: 'span' | ||
|
||
extraAllowedContent: | ||
- i(*)[*] | ||
- span(*)[*] | ||
- em(*)[*] |
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 |
---|---|---|
@@ -1,6 +1,6 @@ | ||
(function ($) { | ||
var CKEDITOR_FA = { | ||
version: '11.5.4' | ||
version: '11.5.5' | ||
}; | ||
|
||
CKEDITOR.dtd.$removeEmpty.span = 0; | ||
|
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,6 +1,6 @@ | ||
(function ($) { | ||
var CKEDITOR_FA = { | ||
version: '11.5.4' | ||
version: '11.5.5' | ||
}; | ||
|
||
CKEDITOR.dtd.$removeEmpty.span = 0; | ||
|
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,6 +1,6 @@ | ||
(function ($) { | ||
var CKEDITOR_FA = { | ||
version: '11.5.4' | ||
version: '11.5.5' | ||
}; | ||
|
||
CKEDITOR.dtd.$removeEmpty.span = 0; | ||
|
38 changes: 38 additions & 0 deletions
38
Resources/Public/JavaScript/Plugins/ckeditor_fa6pro/css/ckeditor-fa.css
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,38 @@ | ||
|
||
#ckeditor-fa-icons { | ||
text-align: center; | ||
white-space: normal; | ||
width: 100%; | ||
height: 350px; | ||
overflow: auto | ||
} | ||
|
||
#ckeditor-fa-icons a { | ||
display: inline-block; | ||
width: 72px; | ||
padding: 5px 0; | ||
text-align: center; | ||
vertical-align: top | ||
} | ||
|
||
#ckeditor-fa-icons a span { | ||
font-size: 28px; | ||
display: block; | ||
text-align: center | ||
} | ||
|
||
#ckeditor-fa-icons a.active { | ||
background-color: rgba(0, 0, 0, .1) | ||
} | ||
|
||
.faSelect { | ||
width: 100% | ||
} | ||
|
||
div[name="font-awesome"] .cke_dialog_ui_input_select { | ||
width: 100%; | ||
} | ||
|
||
div[name="font-awesome"] .cke_dialog_ui_input_text { | ||
min-width: 100px; | ||
} |
42 changes: 42 additions & 0 deletions
42
Resources/Public/JavaScript/Plugins/ckeditor_fa6pro/dialogs/READNE.md
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,42 @@ | ||
Update Icons https://cdpn.io/MarkBoots/fullpage/LYyeGzo | ||
|
||
```javascript | ||
fetch("https://raw.githubusercontent.com/FortAwesome/Font-Awesome/6.x/metadata/icons.json") | ||
.then(response =>response.json()).then(jsondata => { | ||
var solid = [], regular = [], brand = []; | ||
|
||
Object.entries(jsondata).forEach(([key, value]) => { | ||
if(typeof value.free != 'undefined') { | ||
if(value.free.indexOf('brands') >= 0) brand.push(`"${key}"`); | ||
if(value.free.indexOf('solid') >= 0) solid.push(`"${key}"`); | ||
if(value.free.indexOf('regular') >= 0) regular.push(`"${key}"`); | ||
} | ||
}); | ||
|
||
console.warn('%cSOLID', "font-size:3rem"); console.log(solid.join(',')); | ||
console.warn('%cREGULAR', "font-size:3rem"); console.log(regular.join(',')); | ||
console.warn('%cBRAND', "font-size:3rem"); console.log(brand.join(',')); | ||
}); | ||
``` | ||
|
||
### Update Icons with bash | ||
|
||
When loading with npm, there is a folder with SVGs: | ||
|
||
`node_modules/@fortawesome/fontawesome-pro/svgs/light` | ||
|
||
Bash script to get the list of icons: | ||
|
||
```bash | ||
#!/bin/bash | ||
|
||
filelist="" | ||
for file in *.svg | ||
do | ||
filename="${file%.svg}" | ||
filelist+=\"$filename\", | ||
done | ||
echo $filelist | ||
``` | ||
|
||
=> copy output, remove last `,` and paste into ckeditor-fa.js => `var faLight = [` |
211 changes: 211 additions & 0 deletions
211
Resources/Public/JavaScript/Plugins/ckeditor_fa6pro/dialogs/ckeditor-fa.js
Large diffs are not rendered by default.
Oops, something went wrong.
Binary file added
BIN
+2.95 KB
Resources/Public/JavaScript/Plugins/ckeditor_fa6pro/icons/fa32x32.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
47 changes: 47 additions & 0 deletions
47
Resources/Public/JavaScript/Plugins/ckeditor_fa6pro/plugin.js
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,47 @@ | ||
(function ($) { | ||
var CKEDITOR_FA = { | ||
version: '11.5.5' | ||
}; | ||
|
||
CKEDITOR.dtd.$removeEmpty.span = 0; | ||
CKEDITOR.dtd.$removeEmpty.em = 0; | ||
CKEDITOR.dtd.$removeEmpty.i = 0; | ||
|
||
CKEDITOR.plugins.add('ckeditor_fa', { | ||
icons: 'ckeditor-fa', | ||
init: function (editor) { | ||
editor.addCommand('ckeditor_fa', new CKEDITOR.dialogCommand('ckeditorFaDialog', { | ||
allowedContent: 'i(!fa-*)', | ||
})); | ||
editor.ui.addButton('ckeditor_fa', { | ||
label: 'Insert FontAwesome icon', | ||
command: 'ckeditor_fa', | ||
toolbar: 'insert', | ||
icon: this.path + 'icons/fa32x32.png', | ||
}); | ||
CKEDITOR.dialog.add('ckeditorFaDialog', this.path + 'dialogs/ckeditor-fa.js?v=' + CKEDITOR_FA.version); | ||
CKEDITOR.document.appendStyleSheet(this.path + 'css/ckeditor-fa.css?v=' + CKEDITOR_FA.version); | ||
// add styles | ||
if(typeof editor.config.fontAwesome != 'undefined'){ | ||
editor.config.fontAwesome.map(function (css_file) { | ||
editor.addContentsCss(css_file); | ||
loadCSS(css_file); | ||
}); | ||
} | ||
} | ||
}); | ||
|
||
/** | ||
* Load Fontawesome | ||
* @param href | ||
*/ | ||
function loadCSS(href) { | ||
var headID = document.getElementsByTagName('head')[0]; | ||
var cssLink = document.createElement("link"); | ||
cssLink.rel = "stylesheet"; | ||
cssLink.type = "text/css"; | ||
cssLink.href = href; | ||
// add to dom | ||
headID.appendChild(cssLink); | ||
} | ||
})(TYPO3.jQuery); |
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 |
---|---|---|
|
@@ -9,7 +9,7 @@ | |
'clearCacheOnLoad' => 0, | ||
'author' => 'Dirk Persky', | ||
'author_email' => '[email protected]', | ||
'version' => '11.5.4', | ||
'version' => '11.5.5', | ||
'constraints' => [ | ||
'depends' => [ | ||
'typo3' => '10.4.0-11.5.99', | ||
|
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