[MIG] web_editor_background_color: Migrate to v11
- Better JS framework usage. - Split readme. - Update bootstrap-colorpicker lib. - Remove image, serve it from GitHub CDN.pull/1074/head
-
3web_editor_background_color/__manifest__.py
-
1web_editor_background_color/readme/CONTRIBUTORS.rst
-
3web_editor_background_color/readme/CREDITS.rst
-
5web_editor_background_color/readme/DESCRIPTION.rst
-
10web_editor_background_color/readme/USAGE.rst
-
BINweb_editor_background_color/static/description/mass_mailing_editor.png
-
2web_editor_background_color/static/src/css/background_color.less
-
74web_editor_background_color/static/src/js/background_color.js
-
BINweb_editor_background_color/static/src/lib/bootstrap-colorpicker/alpha-horizontal.png
-
BINweb_editor_background_color/static/src/lib/bootstrap-colorpicker/alpha.png
-
230web_editor_background_color/static/src/lib/bootstrap-colorpicker/bootstrap-colorpicker.css
-
124web_editor_background_color/static/src/lib/bootstrap-colorpicker/bootstrap-colorpicker.js
-
273web_editor_background_color/static/src/lib/bootstrap-colorpicker/colorpicker.less
-
BINweb_editor_background_color/static/src/lib/bootstrap-colorpicker/hue-horizontal.png
-
BINweb_editor_background_color/static/src/lib/bootstrap-colorpicker/hue.png
-
BINweb_editor_background_color/static/src/lib/bootstrap-colorpicker/saturation.png
-
2web_editor_background_color/templates/assets.xml
@ -0,0 +1 @@ |
|||
* Jairo Llopis <jairo.llopis@tecnativa.com> - https://www.tecnativa.com |
@ -0,0 +1,3 @@ |
|||
* This addon includes code copied from bootstrap-colorpicker_ |
|||
|
|||
.. _bootstrap-colorpicker: https://github.com/itsjavi/bootstrap-colorpicker/tree/2.5.3 |
@ -0,0 +1,5 @@ |
|||
This module extends the functionality of the web editor to support |
|||
setting a custom background color to any snippet allowing you to customize it. |
|||
|
|||
.. figure:: https://user-images.githubusercontent.com/973709/46802401-1c915180-cd55-11e8-9397-f198548a690c.gif |
|||
:alt: Screenshot of color picker in mass mailing editor |
@ -0,0 +1,10 @@ |
|||
To use this module, you need to: |
|||
|
|||
#. Install any module that makes use of the web editor, such as |
|||
``mass_mailing`` or ``website``. |
|||
#. Use that module's facilities to edit some web content. |
|||
#. Drag & drop any snippet into the web editor body. |
|||
#. Click on *Customize > Text-Image > Background Color > </> icon*. |
|||
#. Choose a custom color by either: |
|||
* Writing any valid HTML color code in the text input. |
|||
* Selecting a color from the color picker. |
Before Width: 559 | Height: 329 | Size: 43 KiB |
Before Width: 100 | Height: 10 | Size: 557 B |
Before Width: 10 | Height: 100 | Size: 488 B |
230
web_editor_background_color/static/src/lib/bootstrap-colorpicker/bootstrap-colorpicker.css
File diff suppressed because it is too large
View File
@ -1,273 +0,0 @@ |
|||
/*! |
|||
* Bootstrap Colorpicker v2.5.1 |
|||
* https://itsjavi.com/bootstrap-colorpicker/ |
|||
* |
|||
* Originally written by (c) 2012 Stefan Petre |
|||
* Licensed under the Apache License v2.0 |
|||
* http://www.apache.org/licenses/LICENSE-2.0.txt |
|||
* |
|||
*/ |
|||
@colorpicker-img-path: "../img/bootstrap-colorpicker/"; |
|||
|
|||
.bgImg(@imgFilename) { |
|||
background-image: url("@{colorpicker-img-path}@{imgFilename}"); |
|||
} |
|||
|
|||
.borderRadius(@size) { |
|||
-webkit-border-radius: @size; |
|||
-moz-border-radius: @size; |
|||
border-radius: @size; |
|||
} |
|||
|
|||
.colorpicker-saturation { |
|||
width: 100px; |
|||
height: 100px; |
|||
.bgImg('saturation.png'); |
|||
cursor: crosshair; |
|||
float: left; |
|||
i { |
|||
display: block; |
|||
height: 5px; |
|||
width: 5px; |
|||
border: 1px solid #000; |
|||
.borderRadius(5px); |
|||
position: absolute; |
|||
top: 0; |
|||
left: 0; |
|||
margin: -4px 0 0 -4px; |
|||
b { |
|||
display: block; |
|||
height: 5px; |
|||
width: 5px; |
|||
border: 1px solid #fff; |
|||
.borderRadius(5px); |
|||
} |
|||
} |
|||
} |
|||
|
|||
.colorpicker-hue, |
|||
.colorpicker-alpha { |
|||
width: 15px; |
|||
height: 100px; |
|||
float: left; |
|||
cursor: row-resize; |
|||
margin-left: 4px; |
|||
margin-bottom: 4px; |
|||
} |
|||
|
|||
.colorpicker-hue i, |
|||
.colorpicker-alpha i { |
|||
display: block; |
|||
height: 1px; |
|||
background: #000; |
|||
border-top: 1px solid #fff; |
|||
position: absolute; |
|||
top: 0; |
|||
left: 0; |
|||
width: 100%; |
|||
margin-top: -1px; |
|||
} |
|||
|
|||
.colorpicker-hue { |
|||
.bgImg('hue.png'); |
|||
} |
|||
|
|||
.colorpicker-alpha { |
|||
.bgImg('alpha.png'); |
|||
display: none; |
|||
} |
|||
|
|||
.colorpicker-saturation, |
|||
.colorpicker-hue, |
|||
.colorpicker-alpha { |
|||
background-size: contain; |
|||
} |
|||
|
|||
.colorpicker { |
|||
padding: 4px; |
|||
min-width: 130px; |
|||
margin-top: 1px; |
|||
.borderRadius(4px); |
|||
z-index: 2500; |
|||
} |
|||
|
|||
.colorpicker:before, |
|||
.colorpicker:after { |
|||
display: table; |
|||
content: ""; |
|||
line-height: 0; |
|||
} |
|||
|
|||
.colorpicker:after { |
|||
clear: both; |
|||
} |
|||
|
|||
.colorpicker:before { |
|||
content: ''; |
|||
display: inline-block; |
|||
border-left: 7px solid transparent; |
|||
border-right: 7px solid transparent; |
|||
border-bottom: 7px solid #ccc; |
|||
border-bottom-color: rgba(0, 0, 0, 0.2); |
|||
position: absolute; |
|||
top: -7px; |
|||
left: 6px; |
|||
} |
|||
|
|||
.colorpicker:after { |
|||
content: ''; |
|||
display: inline-block; |
|||
border-left: 6px solid transparent; |
|||
border-right: 6px solid transparent; |
|||
border-bottom: 6px solid #ffffff; |
|||
position: absolute; |
|||
top: -6px; |
|||
left: 7px; |
|||
} |
|||
|
|||
.colorpicker div { |
|||
position: relative; |
|||
} |
|||
|
|||
.colorpicker.colorpicker-with-alpha { |
|||
min-width: 140px; |
|||
} |
|||
|
|||
.colorpicker.colorpicker-with-alpha .colorpicker-alpha { |
|||
display: block; |
|||
} |
|||
|
|||
.colorpicker-color { |
|||
height: 10px; |
|||
margin-top: 5px; |
|||
clear: both; |
|||
.bgImg('alpha.png'); |
|||
background-position: 0 100%; |
|||
} |
|||
|
|||
.colorpicker-color div { |
|||
height: 10px; |
|||
} |
|||
|
|||
.colorpicker-selectors { |
|||
display: none; |
|||
height: 10px; |
|||
margin-top: 5px; |
|||
clear: both; |
|||
} |
|||
|
|||
.colorpicker-selectors i { |
|||
cursor: pointer; |
|||
float: left; |
|||
height: 10px; |
|||
width: 10px; |
|||
} |
|||
|
|||
.colorpicker-selectors i + i { |
|||
margin-left: 3px; |
|||
} |
|||
|
|||
.colorpicker-element .input-group-addon i, |
|||
.colorpicker-element .add-on i { |
|||
display: inline-block; |
|||
cursor: pointer; |
|||
height: 16px; |
|||
vertical-align: text-top; |
|||
width: 16px; |
|||
} |
|||
|
|||
.colorpicker.colorpicker-inline { |
|||
position: relative; |
|||
display: inline-block; |
|||
float: none; |
|||
z-index: auto; |
|||
} |
|||
|
|||
.colorpicker.colorpicker-horizontal { |
|||
width: 110px; |
|||
min-width: 110px; |
|||
height: auto; |
|||
} |
|||
|
|||
.colorpicker.colorpicker-horizontal .colorpicker-saturation { |
|||
margin-bottom: 4px; |
|||
} |
|||
|
|||
.colorpicker.colorpicker-horizontal .colorpicker-color { |
|||
width: 100px; |
|||
} |
|||
|
|||
.colorpicker.colorpicker-horizontal .colorpicker-hue, |
|||
.colorpicker.colorpicker-horizontal .colorpicker-alpha { |
|||
width: 100px; |
|||
height: 15px; |
|||
float: left; |
|||
cursor: col-resize; |
|||
margin-left: 0px; |
|||
margin-bottom: 4px; |
|||
} |
|||
|
|||
.colorpicker.colorpicker-horizontal .colorpicker-hue i, |
|||
.colorpicker.colorpicker-horizontal .colorpicker-alpha i { |
|||
display: block; |
|||
height: 15px; |
|||
background: #ffffff; |
|||
position: absolute; |
|||
top: 0; |
|||
left: 0; |
|||
width: 1px; |
|||
border: none; |
|||
margin-top: 0px; |
|||
} |
|||
|
|||
.colorpicker.colorpicker-horizontal .colorpicker-hue { |
|||
.bgImg('hue-horizontal.png'); |
|||
} |
|||
|
|||
.colorpicker.colorpicker-horizontal .colorpicker-alpha { |
|||
.bgImg('alpha-horizontal.png'); |
|||
} |
|||
|
|||
.colorpicker-right:before { |
|||
left: auto; |
|||
right: 6px; |
|||
} |
|||
|
|||
.colorpicker-right:after { |
|||
left: auto; |
|||
right: 7px; |
|||
} |
|||
|
|||
.colorpicker-no-arrow:before { |
|||
border-right: 0; |
|||
border-left: 0; |
|||
} |
|||
|
|||
.colorpicker-no-arrow:after { |
|||
border-right: 0; |
|||
border-left: 0; |
|||
} |
|||
|
|||
.colorpicker, |
|||
.colorpicker-alpha, |
|||
.colorpicker-saturation, |
|||
.colorpicker-hue, |
|||
.colorpicker-selectors { |
|||
&.colorpicker-visible { |
|||
display: block; |
|||
} |
|||
} |
|||
|
|||
.colorpicker, |
|||
.colorpicker-alpha, |
|||
.colorpicker-saturation, |
|||
.colorpicker-hue, |
|||
.colorpicker-selectors { |
|||
&.colorpicker-hidden { |
|||
display: none; |
|||
} |
|||
} |
|||
|
|||
.colorpicker-inline.colorpicker-visible { |
|||
display: inline-block; |
|||
} |
Before Width: 100 | Height: 1 | Size: 478 B |
Before Width: 1 | Height: 100 | Size: 504 B |
Before Width: 100 | Height: 100 | Size: 4.0 KiB |