-
Notifications
You must be signed in to change notification settings - Fork 114
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
add FontAwesomeOption + fix BuilderColorPicker
- Loading branch information
1 parent
abd770e
commit 3fc547d
Showing
7 changed files
with
81 additions
and
9 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
16 changes: 16 additions & 0 deletions
16
addons/html_builder/static/src/builder/options/font_awesome_option.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,16 @@ | ||
import { Plugin } from "@html_editor/plugin"; | ||
import { registry } from "@web/core/registry"; | ||
|
||
class FontAwesomeOptionPlugin extends Plugin { | ||
static id = "FontAwesomeOptionPlugin"; | ||
resources = { | ||
builder_options: [ | ||
{ | ||
template: "html_builder.FontAwesomeOption", | ||
selector: "span.fa, i.fa", | ||
exclude: "[data-oe-xpath]", | ||
}, | ||
], | ||
}; | ||
} | ||
registry.category("website-plugins").add(FontAwesomeOptionPlugin.id, FontAwesomeOptionPlugin); |
32 changes: 32 additions & 0 deletions
32
addons/html_builder/static/src/builder/options/font_awesome_option.xml
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,32 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<templates xml:space="preserve"> | ||
|
||
<t t-name="html_builder.FontAwesomeOption"> | ||
<BuilderRow label.translate="Color"> | ||
<BuilderColorPicker styleAction="'color'"/> | ||
</BuilderRow> | ||
|
||
<BuilderRow label.translate="Background Color"> | ||
<BuilderColorPicker styleAction="'backgroundColor'"/> | ||
</BuilderRow> | ||
|
||
<BuilderRow label.translate="Size"> | ||
<BuilderButtonGroup> | ||
<BuilderButton classAction="''" title="'Size 1x'">1x</BuilderButton> | ||
<BuilderButton classAction="'fa-2x'" title="'Size 2x'">2x</BuilderButton> | ||
<BuilderButton classAction="'fa-3x'" title="'Size 3x'">3x</BuilderButton> | ||
<BuilderButton classAction="'fa-4x'" title="'Size 4x'">4x</BuilderButton> | ||
<BuilderButton classAction="'fa-5x'" title="'Size 5x'">5x</BuilderButton> | ||
|
||
<!-- TODO: nothing use it ??? Hidden buttons which allows to automatically remove other fa | ||
sizing class we do not suggest. | ||
TODO: implement a param to add those extra classes to remove | ||
via selectClass (also fixes the fact that nothing is selected | ||
if fa-1x is actually used on the icon in this case) --> | ||
<!-- <BuilderButton classAction="'fa-1x'" dependencies="'fake'"/> | ||
<BuilderButton classAction="'fa-lg'" dependencies="'fake'"/> --> | ||
</BuilderButtonGroup> | ||
</BuilderRow> | ||
</t> | ||
|
||
</templates> |
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